Commit graph

420 commits

Author SHA1 Message Date
Alessandro Decina
5496fd3e75 avfvideosrc: improve timestamp code
Use a combination of the running time and CMClockGetTime from AVF to compute
timestamps.
2014-12-27 12:43:45 +11:00
Sebastian Dröge
568da160cb vtenc: Instead of crashing if no corresponding frame is found, ignore this
... and hope that everything will be fine. This shouldn't really happen but
previously happened during shutdown. It should be fixed in videoencoder now,
but better be on the safe side here.
2014-12-22 11:49:08 +01:00
Alessandro Decina
0156725480 avfvideosrc: improve timestamping and latency reporting
Use AVF provided timings to timestamp output buffers. Use the running time at
the time the first buffer is produced to base timestamps on. Report 1-frame
latency based on the negotiated framerate instead of hardcoding 4ms latency.
2014-12-17 12:24:05 +11:00
Alessandro Decina
4d89d7116b vtenc: bump rank to PRIMARY 2014-12-11 00:02:26 +11:00
Alessandro Decina
21f8c96d75 vtenc: negotiate profile and level with downstream 2014-12-10 22:36:53 +11:00
Alessandro Decina
8166487a00 vtenc: report latency 2014-12-10 19:44:51 +11:00
Sebastian Dröge
b88e4304f1 vtenc: Add properties to specify the maximum keyframe interval in frames and seconds 2014-12-05 16:33:54 +01:00
Sebastian Dröge
1a2362eb2b vtenc: Fix conversion of the bitrate property and our internal bitrate storage
The property is in kbit/s and we store it in bit/s, so just multiply and
divide by 1000. No need to put a factor of 8 in there.

kVTCompressionPropertyKey_AverageBitRate is also in bit/s according to
its documentation.
2014-12-05 16:17:16 +01:00
Alessandro Decina
d25813c9bc vtenc: add quality property 2014-11-27 18:41:21 +01:00
Alessandro Decina
6a4270d5cc vtenc: set profile and level in caps 2014-11-27 18:41:21 +01:00
Alessandro Decina
d45a2f0480 vtenc: let VT pick the bitrate by default 2014-11-21 15:48:08 +01:00
Alessandro Decina
d800ac023b vtenc: set H264_Baseline_AutoLevel on OSX as well 2014-11-20 16:06:46 +01:00
Alessandro Decina
d0ce9a6f7c vtdec: disable the reorder queue for baseline streams 2014-11-20 16:06:46 +01:00
Sebastian Dröge
6e2e8ec0ac vtdec: Fix divide by zero in the picture buffer length calculation 2014-11-20 09:42:24 +01:00
Alessandro Decina
5977ef5552 vtenc: fix build on iOS 2014-11-12 16:45:12 +01:00
Alessandro Decina
ad00f4a0e2 coremediabuffer: set ->pixel_buf for CVPixelBuffer buffers
Fix a bug for which we never actually set ->pixel_buf to non-NULL for
CVPixelBuffer buffers.
2014-11-12 15:40:30 +01:00
Alessandro Decina
a1cc1b34e1 vtenc: fix compilation on < 10.9 2014-11-12 10:00:11 +01:00
Alessandro Decina
bc7dbd7b51 vtenc: enable the hw encoder on OSX 2014-11-11 18:01:54 +01:00
Sebastian Dröge
98b856d630 avfvideosrc: Don't pretend to support reconfiguration
We will run into an assertion in set_caps() if we try to change
caps while the source is already running. Don't try to find new
caps in GstBaseSrc::negotiate() to prevent caps changes.
2014-11-09 10:41:52 +01:00
Alessandro Decina
1d97516731 vtenc: add realtime and allow-frame-reordering properties 2014-11-07 00:22:08 +01:00
Sebastian Dröge
68c067e3c9 vtenc: Fix locking
The object lock only protects the session, as we modify
the session from other threads when the bitrate property
is changed. Don't hold it much longer than for session
related things.

And we need to release the video decoder stream lock before
enqueueing a frames. It might wait for our callback to dequeue
a frame from another thread, which will then take the stream
lock too and deadlock.
2014-10-21 16:22:06 +02:00
Sebastian Dröge
ad649138aa vtenc: Use kVTProfileLevel_H264_Baseline_AutoLevel only on iOS
It is not required on OSX apparently and was only added in 10.9.6 there.
Calculating the correct level from the configuration is not trivial, so let's
just not set a level at all here.
2014-10-19 14:57:43 +02:00
Sebastian Dröge
b57f255f26 vtenc: VTCompressionSessionPrepareToEncodeFrames only exists since 10.9.6
Check with configure for it instead of using one of the availability macros
as those wouldn't work as expected with minor versions.
2014-10-19 14:51:40 +02:00
Sebastian Dröge
e79355078e vtenc: Remove unused #define 2014-10-19 14:32:31 +02:00
Sebastian Dröge
3cead041f6 vtdec: Set reorder length to 0 if we can't calculate it
Instead of leaving it at whatever value it had before.
2014-10-14 09:19:59 +02:00
Sebastian Dröge
3c1ccb64eb vtenc: Fix encoder to work on iOS
iOS has special stride requirements that we don't know yet, so copy
input buffers into buffers allocated by iOS for now.

Later we should check the stride and probably provide a buffer pool for these
buffers so upstream can directly write in there.
2014-09-19 14:47:05 +03:00
Sebastian Dröge
bee1477f08 applemedia: We need to map the coremedia buffers in non-readonly mode
Our buffers claim to be writable so other elements expect to be able
to write there without losing their changes.
2014-09-19 14:47:04 +03:00
Sebastian Dröge
9380f6282d vtenc: Let the encoder automatically choose a h264 level
We should negotiate these things via caps...
2014-09-18 17:49:46 +03:00
Sebastian Dröge
31476a3c46 vtenc: Use 0 instead of G_MAXDOUBLE as the max keyframe interval
0 means no limit, which was meant here with G_MAXDOUBLE probably.
2014-09-18 13:45:33 +03:00
Sebastian Dröge
8c1e84ff71 vtenc: Expected duration is supposed to be the duration of the stream, not a frame
Just don't set it for now, it isn't really needed.
2014-09-18 13:42:24 +03:00
Sebastian Dröge
61c40523df vtenc: Properly handle keyframes
Especially set the SYNC_POINT flag on keyframes.
2014-09-18 13:11:05 +03:00
Sebastian Dröge
de9b0be86d vtdec: Fix compilation 2014-09-18 10:30:04 +03:00
Sebastian Dröge
e653068bc2 vtdec: Handle 0/1 framerates correctly by not calculating their frame duration 2014-09-18 09:47:06 +03:00
Sebastian Dröge
916155da2b atdec: Fix some compiler warnings with newer clang 2014-09-17 17:37:12 +03:00
Sebastian Dröge
ddea2e4498 vtenc: Prepare encoder after setup
This will allow encoding to happen faster on the first frame.
2014-09-17 17:10:58 +03:00
Sebastian Dröge
c6f17d6013 vtenc: Only drain the encoder in ::finish(), not on every frame
Otherwise quality and bitrate will be bad.
2014-09-17 17:08:57 +03:00
Sebastian Dröge
0390398e39 vtenc: Error out if encoding returned an error
Otherwise we will just continue consuming frames until all memory is filled
up and the app crashes.
2014-09-17 15:39:26 +03:00
Sebastian Dröge
e3bc32fb58 vtenc: Check for errors from VTCompressionSessionCompleteFrames() 2014-09-17 14:56:05 +03:00
Sebastian Dröge
b93e0f5f99 vtenc: Properly scale timestamps for the API and set invalid values 2014-09-17 14:55:24 +03:00
Sebastian Dröge
e4563ce6cf vtdec: Properly scale timestamps for the API and set invalid values 2014-09-17 14:54:39 +03:00
Sebastian Dröge
d789246077 applemedia: Remove old code that is of no use anymore 2014-09-17 13:19:04 +03:00
Sebastian Dröge
82aae4df74 applemedia: Do weak linking with the VideoToolbox framework
It does not exist on older OSX and iOS but we still want to
be able to use it when it's available.
2014-09-17 10:38:20 +03:00
Sebastian Dröge
7fa9bbc3b0 vtenc: Port to GstVideoEncoder base class 2014-09-16 17:04:31 +03:00
Sebastian Dröge
4e1f8285c2 vtenc: Use correct instance struct size 2014-09-16 16:13:16 +03:00
Sebastian Dröge
3a52f6b757 vtdec: Fix compiler warnings
values of type 'OSStatus' should not be used as format arguments; add an explicit cast to 'int' instead [-Wformat]
2014-09-16 15:48:11 +03:00
Sebastian Dröge
f2eedb9cee vtenc: Port to the real VideoToolbox API instead of using our dlopen() wrapper
It's a public framework since a long time.
2014-09-16 15:47:29 +03:00
Sebastian Dröge
0f0a50c119 vtdec: No need to set kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder on iOS 2014-09-15 15:42:41 +03:00
Sebastian Dröge
c82fa4f845 applemedia: Don't include VideoToolbox on iOS < 8.0
It's private API and does not work without a jailbroken device.
2014-09-15 15:12:31 +03:00
Sebastian Dröge
0b34cde46e vtdec: Fix compilation on iOS 8.0 2014-09-13 20:49:16 +03:00
Tim-Philipp Müller
ffe59820d8 avfvideosrc: fix bogus BGRA caps
Remove 0.10-style endianness/*_mask/bpp/depth fields.
2014-09-10 16:38:52 +01:00
Sebastian Rasmussen
b323fba934 vtenc: Avoid leaking caps object and its copy
gst_pad_get_pad_template_caps() returns a reference which is unreferenced,
so creating a copy using gst_caps_copy() results in a reference leak. Also
the caps are pushed as an event downstream, but this doesn't consume the
caps so it must still be unreferenced.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734534
2014-08-10 12:13:48 +01:00
Sebastian Dröge
2b63783c94 atdec: Change rank to MARGINAL until it can properly handle multichannel audio
https://bugzilla.gnome.org/show_bug.cgi?id=727757
2014-07-11 09:43:44 +02:00
Alessandro Decina
0258ec0273 applemedia: enable vtdec and vtenc only on >= 10.8 where VideoToolbox is public
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=723670
2014-07-02 12:56:06 +02:00
Thiago Santos
92dbcf2bf9 vtdec: avoid segfault when output isn't configured
This can help when the callback is called during/after videodecoder
base class shut down

https://bugzilla.gnome.org/show_bug.cgi?id=728435
2014-07-02 06:19:58 -03:00
Thiago Santos
f75f860ff3 vtdec: ignore the dropped flag if buffer was received
Apparently there is some issue with VT that makes it mark the dropped
flag even though the buffer was decoded.

https://bugzilla.gnome.org/show_bug.cgi?id=728435
2014-07-02 05:48:32 -03:00
Matthieu Bouron
e1601406a5 vtenc: fix memory leak
The pixel buffer release callback is called if the void *
dataPtr given to the CVPixelBufferCreateWithPlanarBytes
is not NULL.

According to the documentation dataPtr is supposed to be a
"plane description block" but no specific type is given.

https://bugzilla.gnome.org/show_bug.cgi?id=711847
2014-06-30 13:09:28 +02:00
Andoni Morales Alastruey
fc02ec2087 avfassetsrc: downgrade rank to SECONDARY in OS X 2014-04-24 12:28:17 +02:00
Andoni Morales Alastruey
d234bee52f avfassetsrc: rename references to iOS 2014-04-24 12:28:17 +02:00
Matthieu Bouron
2f0aad7158 iosavassetsrc: rename element to avfassetsrc
https://bugzilla.gnome.org/show_bug.cgi?id=728249
2014-04-24 12:28:17 +02:00
Matthieu Bouron
ecf765635b iosavassetsrc: Port to 1.0
Also enables this element on OSX >= 10.7.

https://bugzilla.gnome.org/show_bug.cgi?id=728249
2014-04-24 12:28:17 +02:00
Andoni Morales Alastruey
9fec222b5a applemedia: add new source/decoder element for iOS assets
https://bugzilla.gnome.org/show_bug.cgi?id=728249
2014-04-24 12:28:16 +02:00
Matthieu Bouron
e728ee8208 coremediabuffer: handle stride alignment
Handle stride alignment through the use of the video meta API. The
code is based on the corevideobuffer implementation.

If the video meta API is not supported and the underlying buffer
contains padding, the core media buffer is copied to a system memory
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=727885
2014-04-24 12:27:59 +02:00
Matthieu Bouron
c6572df9ff avfvideosrc: check if downstream supports the video meta API
Check if downstream supports the video meta API, so we can use it later
with the core media buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=727953
2014-04-24 10:46:51 +01:00
Andoni Morales Alastruey
110c21a136 vtenc: fix complier error using fixed lenght arrays 2014-04-18 20:17:00 +02:00
Sebastian Dröge
cba13ef301 atdec: Add some more debug output 2014-03-11 15:33:26 +01:00
Sebastian Dröge
fa8a7d7659 atdec: Implement draining properly 2014-03-11 15:33:26 +01:00
Sebastian Dröge
53ab9c6613 atdec: First dequeue a buffer before enqueueing anything from the queue
Required for offline rendering according to the docs. wtf.
2014-03-11 15:33:26 +01:00
Sebastian Dröge
f331d3159f atdec: Keep track of the current position
It's required to set a valid sample time for decoding on iOS.
2014-03-11 15:33:26 +01:00
Sebastian Dröge
8d8b3c0401 atdec: Always try to pull one decoded frame out of the queue
... instead of doing magic calculations with the buffer duration.
2014-03-11 15:33:25 +01:00
Sebastian Dröge
41b2cca8fc atdec: Handle errors in handle_frame() properly 2014-03-11 15:33:25 +01:00
Sebastian Dröge
dfe476c444 atdec: Call AudioQueueReset() for flushing
AudioQueueFlush() is for draining all remaining data.
2014-03-11 15:33:25 +01:00
Sebastian Dröge
1c13e513c9 atdec: Set correct number of frames for MP3 2014-03-11 15:33:25 +01:00
Sebastian Dröge
2d8b195911 atdec: Initialize the audio description with zeroes 2014-03-11 15:33:25 +01:00
Sebastian Dröge
a43db678c1 atdec: Set the correct layer depending on the MP3 caps 2014-03-11 15:33:25 +01:00
Edward Hervey
72127a85f5 applemedia: Fix libtool usage
--tag=CC is needed for static build
2014-02-06 16:17:39 +01:00
Sebastian Dröge
0d794993fb applemedia: Actually the enc/decbins are not used anywhere currently
Code is commented out.
2014-01-20 10:38:16 +01:00
Sebastian Dröge
1107e158f7 applemedia: Fix build on iOS and probably also on OSX
The video toolbox is not available on iOS, and also on OSX
we should probably build all source files that are used for
it.

https://bugzilla.gnome.org/show_bug.cgi?id=722590
2014-01-20 10:34:57 +01:00
Alessandro Decina
cd90748c5b applemedia: vtdec: set the correct stride in the video meta 2013-12-22 17:48:25 +01:00
Alessandro Decina
7a8d918472 applemedia: atdec: fix aac decoding on Mavericks 2013-12-22 17:48:25 +01:00
Alessandro Decina
cf2cf20cc3 applemedia: corevideobuffer: fix for planar formats 2013-12-19 08:59:39 +01:00
Alessandro Decina
a75ddf446b applemedia: vtdec: remove silly stride requirement
This is legacy from the 0.10 times, and it isn't clear how it was useful back
then also.'
2013-12-19 08:59:39 +01:00
Davide Bertola
72e989f2da applemedia: vtdec: Enable hardware accelerated decoding on 10.9 2013-12-18 10:28:17 +01:00
Alessandro Decina
d5eccb2285 applemedia: vtdec: handle level 3 in get_dpb_max_mb_s_from_level. oops. 2013-12-14 19:18:41 +01:00
Alessandro Decina
44e62613db applemedia: atdec: fix mp3 caps 2013-12-14 19:18:41 +01:00
Alessandro Decina
f387bd0342 applemedia: always include <Foundation/Foundation.h>
Fixes compilation with newest xcode.
2013-12-14 13:30:01 +01:00
Alessandro Decina
de60453a33 applemedia: vtdec: fix compiler warning (uninitialized variable) 2013-12-11 18:52:53 +01:00
Alessandro Decina
00392a6d16 applemedia: vtdec: rename reorder_queue_frame_delay to reorder_queue_length 2013-12-11 08:12:37 +01:00
Alessandro Decina
596aa8e05a applemedia: vtdec: report latency 2013-12-11 08:12:36 +01:00
Alessandro Decina
733a780e9d applemedia: vtdec: set reorder queue length to the max DPB length
Set reorder_queue_frame_delay from the DPB size (in frames). Still not optimal,
as the DPB size is larger than the max bframe forward prediction length, but I
don't know how to compute the latter without parsing every group of pictures.
2013-12-11 08:12:36 +01:00
Alessandro Decina
7dffa2e1f2 applemedia: vtdec: set the correct video format in the video meta
Fixes all kinds of weird bugs when videoconvert is used with the decoder.
2013-12-10 11:12:56 +01:00
Alessandro Decina
ffeb719d4c applemedia: corevideobuffer: set the correct stride for packed formats 2013-12-08 16:46:58 +01:00
Alessandro Decina
839970e07c applemedia: vtdec: fix mpeg2 video support 2013-12-08 15:31:09 +01:00
Alessandro Decina
938ce6a23d applemedia: vtdec: make jpeg decoding actually work 2013-12-08 15:25:27 +01:00
Alessandro Decina
1cd62000f5 applemedia: vtdec: fail gracefully when not negotiated 2013-12-08 15:24:58 +01:00
Alessandro Decina
b1a756fda7 applemedia: rewrite VideoToolbox decoder based on GstVideoDecoder 2013-12-08 15:13:26 +01:00
Matthieu Bouron
58be5ce16d avfvideosrc: declare missing instance variables
Fixes build on 32-bit system.

https://bugzilla.gnome.org/show_bug.cgi?id=711844
2013-11-11 14:36:19 +01:00
Andoni Morales Alastruey
31d7c42158 coremediabuffer: keep an extra ref to the image and data buffer 2013-11-07 21:37:29 +01:00
Matthieu Bouron
78f104aa61 applemedia: coremediabuffer: use correct retain/release functions on CMSampleBufferRef buffer
Fixes a crash while releasing the sample buffer after the image
buffer it contains.

Also fixes a minor coding style error.

https://bugzilla.gnome.org/show_bug.cgi?id=711606
2013-11-07 18:47:15 +01:00
Matthieu Bouron
c9a8224553 qtkitvideosrc: lower rank to GST_RANK_SECONDARY
Makes avfvideosrc be prefered over qtkitvideosrc since it is deprecated
with OS X 10.9.

https://bugzilla.gnome.org/show_bug.cgi?id=711614
2013-11-07 18:44:39 +01:00
Matthieu Bouron
314e01e83f avfvideosrc: set rank to GST_RANK_PRIMARY
Makes avfvideosrc to be used with autodetection.

https://bugzilla.gnome.org/show_bug.cgi?id=711614
2013-11-07 18:44:27 +01:00
Andoni Morales Alastruey
7e195cdcdc avfvideosrc: fix compiler warning in iOS 2013-11-07 15:24:29 +01:00
Andoni Morales Alastruey
98e849a092 avfvideosrc: fix build in iOS with isEqualTo doesn't exists 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
a2b90eeb8c avfvideosrc: fix build with older SDK not supporting AVDeviceFormat
AVDeviceFormat and AVFrameRateRange are available in iOS since 7.0
so we need a more dynamic approach to support compilation with older
SDK's. We use a NSObject to avoid referencing those types and key-value
coding or preformSelector to access properties.
2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
46a61ea036 avfvideosrc: fix checks for HAVE_IOS 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
81cb13be64 avfvideosrc: include config.h 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
ef7f6e4654 avfvideosrc: add more debug 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
606a50e550 avfvideosrc: fix compilation with gcc
The synthesize block needs to be moved to fix a compiler error
2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
94d77829a4 avfvideosrc: sort caps with the highest resolution first
When started without any caps filter we prefer the highest
supported resolution.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
66334591cc avfvideosrc: support screen capture on OSX
https://bugzilla.gnome.org/show_bug.cgi?id=711432
2013-11-07 15:24:28 +01:00
Matthieu Bouron
88b5ff76f6 avfvideosrc: minor cosmetic 2013-11-07 15:24:28 +01:00
Matthieu Bouron
752d74b31f avfvideosrc: use input device formats to set/get caps if available
https://bugzilla.gnome.org/show_bug.cgi?id=711211
2013-11-07 15:24:28 +01:00
Matthieu Bouron
35587efdc9 avfvideosrc: update caps if frame size has changed
On OSX, setting the pixel format on the output reset the capture device
to its native resolution, so we need to update the caps if the output
frame size has changed before a proper solution is found.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
fae79751ad avfvideosrc: check if low preset is available 2013-11-07 15:24:28 +01:00
Matthieu Bouron
7f807270fa avfvideosrc: use a dedicated queue for AVFoundation calls
Replace the main queue with a dedicated queue for AVFoundation calls
so the execution on this queue won't block if the main queue
is not running.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
5d612768a4 avfvideosrc: remove trailing space 2013-11-07 15:24:28 +01:00
Matthieu Bouron
19844fab47 avfvideosrc: dispatch AVFoundation calls synchronously in the main queue 2013-11-07 15:24:27 +01:00
Matthieu Bouron
0d74dc802a applemedia: enable avfvideosrc if AVFoundation is present 2013-11-07 15:24:27 +01:00
Matthieu Bouron
b6925d5c56 avfvideosrc: only enable 1920x1080 preset on iOS 2013-11-07 15:24:27 +01:00
Matthieu Bouron
06d59e7829 applemedia: port avfvideosrc to 1.0 2013-11-07 15:24:27 +01:00
Sebastian Dröge
831c67c07b applemedia: Link with gmodule for g_module_open() and others 2013-11-04 10:05:40 +01:00
Matthieu Bouron
1b2b879bf4 vtenc: use proper release callback type in CVPixelBufferCreateWithPlanarBytes
https://bugzilla.gnome.org/show_bug.cgi?id=711140
2013-10-30 16:27:58 +00:00
Matthieu Bouron
22eaf39c1a avfvideosrc: fix truncated line
https://bugzilla.gnome.org/show_bug.cgi?id=710657
2013-10-30 16:27:58 +00:00
Dominik Röttsches
b002490ab2 vtenc: Add support for I420
https://bugzilla.gnome.org/show_bug.cgi?id=709241
2013-10-02 13:18:04 +02:00
Dominik Röttsches
24c79af394 vtenc: Use correct strides, etc from the GstVideoFrame
https://bugzilla.gnome.org/show_bug.cgi?id=706211
2013-10-02 13:14:32 +02:00
Sebastian Dröge
4bed01aff9 iosassetsrc: Port to 1.0 and fix some bugs on the way 2013-09-28 20:36:21 +02:00
Andoni Morales Alastruey
e5d5faa67e iosassetsrc: Add new element from the GStreamer SDK project 2013-09-28 20:36:21 +02:00
Sebastian Dröge
dd19715961 applemedia: avfvideosrc is not ported to 1.0 yet 2013-09-28 20:36:21 +02:00
Alessandro Decina
95d5a8055b applemedia: atdec: destroy the queue if set_format fails 2013-07-24 09:18:43 +02:00
Alessandro Decina
10d02e381b applemedia: atdec: remove c++ style comments 2013-07-24 09:15:49 +02:00
Alessandro Decina
d71aaec486 applemedia: atdec: 1st round of fixes 2013-07-24 09:11:59 +02:00
Alessandro Decina
92bcdd9c4b applemedia: add AudioToolbox based audio decoder 2013-07-23 10:36:47 +02:00
Andoni Morales Alastruey
bab2bf3f11 applemedia: fix release of null pointer 2013-06-18 13:33:14 +02:00
Thiago Santos
eecc951070 applemedia: coremediabuffer: fix leaking of apple media structs
remember to release the apple's api buffers to avoid huge leaking
2013-06-18 13:17:52 +02:00
Andoni Morales Alastruey
22be93cd04 applemedia: move defines to CPPFLAGS for obj-c files 2013-06-18 13:02:42 +02:00
Andoni Morales Alastruey
0690238c59 applemedia: fix duplicated symbols with applemedia 2013-05-24 09:39:10 +02:00
Andoni Morales Alastruey
5f4ac8c58f vtdec: simplify caps setting 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
2f36ffb7d0 applemedia: fix H264 streams with b-frames
The decoder output frames in DTS order, even with the flag
kVTDecodeFrame_EnableTemporalProcessing. We store a internal
queue of the decoded frames and push them PTS order.
2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
3b249f6761 applemedia: fix segfault with dropped frames 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
d9db0c2d4a applemedia: improve usage of the VT API
Add timing information to CV samples and pass the GstBuffer
as extra data in the decode function
2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
db49a77682 applemedia: add support for MPEG-1 too 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
9645d1df2d applemedia: add support for MPEG-2 decoding 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
5e09d61638 applemedia: use the best colorformat on each platform
This saves a colorspace conversion before the sink in OS X
2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
c69f41d299 applemedia: replace private function with its public variant
FigVideoFormatDescriptionCreateWithSampleDescriptionExtensionAtom
is an un-documented private function which might change its signature
as it already did in the past. Replace it with
CMVideoFormatDescriptionCreate and the also un-documented Extensions
dictionary.
2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
9b168e6b4d applemedia: remove the unneeded buffer factory 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
97bb1edf6c applemedia: don't use the dynamic API for public frameworks
Public frameworks don't need to build the API dynamically, we instead
use the framework directly.
The exception is for VideoToolbox which went public in the 10.8 SDK,
but it's still private in older version of the SDK and iOS. This allow
building the plugin against SDK's where it's not a public framework.
2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
57b97beb6d applemedia: move plugins using private frameworks to applemedia-nonpublic 2013-05-20 13:31:02 +02:00
Sebastian Dröge
e51cd4fe2f gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
Andoni Morales Alastruey
27c546ad1e avfvideosrc: fix deadlock draining queue from the same thread 2013-04-15 09:02:37 +02:00
Thiago Santos
23b2b46993 applemedia: fix build for objc
The obj-c api version option is required to get applemedia to
build for ios, otherwise it won't find some symbols during linking
2013-03-25 12:56:55 -03:00
Josep Torra
1870a4d58b applemedia: suppress warnings for deprecated glib API 2013-03-10 22:06:31 +01:00
Ole André Vadla Ravnås
519cefdeee applemedia: update contact information 2013-02-16 02:51:52 +01:00
Ole André Vadla Ravnås
ad2d6be695 applemedia: fix gst_buffer_get_core_media_meta macro 2013-02-16 02:51:52 +01:00
Ole André Vadla Ravnås
73bcf51f9f applemedia: port vtenc to 1.0 2013-02-16 02:51:51 +01:00
Ole André Vadla Ravnås
bace18bacc applemedia: replace usage of deprecated gst_pad_set_caps() in vtdec 2013-02-16 02:51:51 +01:00
Ole André Vadla Ravnås
af6df7292c applemedia: port vtapi to run on OS X 10.8 2013-02-16 02:51:51 +01:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Olivier Crête
9a328a8f71 avfvideosrc: Negotiate format, also support more resolutions
This should enable supprt for old and new iPhones with the same code.
2012-10-30 19:32:59 +01:00
Michael Smith
0c2159a220 meta info: register thread-safely. 2012-10-03 11:05:06 -07:00
Mark Nauwelaerts
9cb0cc216d applemedia: init videoinfo 2012-09-18 13:19:37 +02:00
Mark Nauwelaerts
578861abea replace gst_element_class_set_details_simple with gst_element_class_set_metadata 2012-09-14 17:27:49 +02:00
Sebastian Dröge
30617d23a3 applemedia: Put the right flags into the right variable 2012-05-30 13:54:11 +02:00
Sebastian Dröge
df5f39658f configure: Add OBJC specific compiler flags
See bug #643939.
2012-05-30 11:28:53 +02:00
Wim Taymans
1cbd31e3ee fix for video api update 2012-04-19 14:24:45 +02:00
Sebastian Dröge
7ff3293a44 video: Update for libgstvideo API changes 2012-04-19 12:31:39 +02:00
Matej Knopp
156d80d74b applemedia: do not link gstinterfaces 2012-04-16 11:19:17 +02:00
Sebastian Dröge
cda192b3b7 gst: Update for GST_PLUGIN_DEFINE() API changes 2012-04-05 18:02:56 +02:00
Alessandro Decina
d36fe4593d applemedia: update corevideobuffer after buffer meta API change 2012-04-05 09:08:35 +02:00
Alessandro Decina
13334dfa8f applemedia: update coremediabuffer after buffer meta API change 2012-04-05 09:08:24 +02:00
Alessandro Decina
10387bd629 qtkitvideosrc: update after BaseSrc::fixate API change 2012-04-05 09:08:14 +02:00
Sebastian Dröge
1318a97e0a gst: Update versioning 2012-04-04 14:44:34 +02:00
Wim Taymans
48ba9063b0 update for buffer api change 2012-03-30 18:15:36 +02:00
Alessandro Decina
8546458617 applemedia: port vtdec 2012-03-03 19:04:36 +01:00
Alessandro Decina
b45250e9d2 applemedia: update signature of CMSampleBufferCreate and CMBlockBufferCreateWithMemoryBlock
Change data type for counters passed on the stack from UInt32 to size_t. Fixes
64bit builds.
2012-03-03 19:04:36 +01:00
Alessandro Decina
42dd6a145a applemedia: update format description helper signature
Update the FigVideoFormatDescriptionCreateWithSampleDescriptionExtensionAtom
signature to match the implementation on OSX Lion.
2012-03-03 19:04:36 +01:00
Alessandro Decina
7a4a3833c3 applemedia: port qtkitvideosrc 2012-02-28 08:14:00 +01:00
Wim Taymans
de1f89bf07 GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 16:37:13 +01:00
Alessandro Decina
b6747292e0 qtkitvideosrc: get the framerate from caps
...and configure QTKit accordingly. Hardcoding to 30fps was pretty -bad.
2011-08-15 02:10:26 +02:00
Alessandro Decina
e21e8ddd4e applemedia: bump the rank of qtkitvideosrc to PRIMARY 2011-05-15 10:04:50 +02:00
Leo Singer
369f41913c applemedia: fix compiler warning: redundant declaration of 'parent_class'
GST_BOILERPLATE_FULL declares parent_class as well.

https://bugzilla.gnome.org/show_bug.cgi?id=637532
2010-12-18 21:32:36 +00:00
Ole André Vadla Ravnås
f3d8e3920d applemedia: only enqueue buffers in the VideoToolbox callbacks
These callbacks may fire from any thread, hence we should only enqueue
buffers and let the streaming thread take care of the rest as soon as
the blocking encode or decode operation has finished.
2010-12-10 04:07:05 +01:00
Ole André Vadla Ravnås
f7e5878c9e applemedia: bring back Leopard compatibility
At least as far as miovideosrc is concerned. Turns out that CoreVideo's
CVPixelBufferGetIOSurface is not present in Leopard's version of CoreVideo.
We solve this by making it possible for symbols to be marked as optional.
2010-12-10 04:06:59 +01:00
Alessandro Decina
0b6e0b7b13 qtkitvideosrc: reset the queue condition to NO_FRAMES in unlockStop.
Fixes a segfault in create: when going PLAYING -> PAUSED -> PLAYING.
2010-12-09 12:04:10 +01:00
Alessandro Decina
ec6c307334 qtkitvideosrc: run the mainRunLoop for a while if not running.
QTCaptureSession::addInput and QTCaptureSession::addOutput call
NSObject::performSelectorOnMainThread internally so they need the mainRunLoop to
run at least for a while to complete.
2010-12-09 11:55:57 +01:00
Alessandro Decina
536a30f2df applemedia: don't use the deprecated g_strcasecmp function.
Replace g_strcasecmp with g_ascii_strcasecmp.
2010-12-01 23:21:33 +01:00
Alessandro Decina
aae72680bd Fix compiler warnings with gcc 4.2.1 on OSX. 2010-12-01 23:20:36 +01:00
Ole André Vadla Ravnås
abdb30c567 celvideosrc: fix nasty deadlock
We cannot call any CMBufferQueue functions while holding the lock that
our callback also depends on. So now we make use of CMBufferQueue's
trigger API in order to get notified when the queue has data.
2010-11-12 00:44:42 +01:00
Ole André Vadla Ravnås
de76e9fdb6 cmapi: cover CMBufferQueue's trigger API 2010-11-12 00:44:42 +01:00
Ole André Vadla Ravnås
e4db4257d5 celvideosrc: unlock should also notify
Otherwise we depend on being woken up by the CoreMedia queue getting
its next buffer.
2010-11-12 00:44:42 +01:00
Ole André Vadla Ravnås
ebd2a6d6e9 applemedia: don't push synchronously from callback
The codec that called us might be holding locks to shared resources, so
we should never push downstream from within its buffer callback.

Note that a GstBufferList is not used here because we need to preserve
the buffer metadata held by our GstBuffer subclasses.
2010-11-11 00:22:31 +01:00
Ole André Vadla Ravnås
6b63954f63 vtenc: bump H.264 level from 1.3 to 3.0
This should be turned into a property.
2010-11-11 00:22:31 +01:00
Ole André Vadla Ravnås
6e909dc474 celvideosrc: add basic device selection support 2010-11-11 00:22:31 +01:00
Ole André Vadla Ravnås
2382f10b98 cvapi: add wrapper for IO surface access
To be used in a future video sink for zero-copy rendering.
2010-11-11 00:22:31 +01:00
Ole André Vadla Ravnås
420943972c celapi: add capture port type constants 2010-11-11 00:22:31 +01:00
Ole André Vadla Ravnås
d10e029f51 applemedia: biplanar is actually NV12, not I420
D'oh!
2010-11-08 23:58:25 +01:00
Ole André Vadla Ravnås
d865feca82 vtenc: remove keyframe enforcement workaround
Was only needed for old iOS where the H.264 encoder didn't support
kVTEncodeFrameOptionKey_ForceKeyFrame.
2010-11-08 23:58:25 +01:00
Ole André Vadla Ravnås
abba3a4126 cvapi: add a few extra bits of wrapping 2010-11-08 23:58:25 +01:00
Ole André Vadla Ravnås
b4654f537f applemedia: lock CVPixelBuffer read-only
As per Apple's docs, this may improve performance by avoiding redundant
invalidations of existing caches of the buffer contents.
2010-11-08 23:58:24 +01:00
Ole André Vadla Ravnås
6428d306ea celvideosrc: put planar first in template caps 2010-11-08 14:02:50 +01:00
Ole André Vadla Ravnås
c2672f71cd applemedia: improve vtenc/vtdec performance
Profiling of H.264 encode and decode revealed that conversions
between packed and planar were happening behind the scenes.

Hence we now choose I420 instead of YUY2.
2010-11-08 14:02:50 +01:00
Ole André Vadla Ravnås
1eb9190ad9 celvideosrc: measure fps when statistics is enabled
Also refactor timestamping slightly.
2010-11-05 16:52:58 +01:00
Ole André Vadla Ravnås
b7368c34fd celvideosrc: update to new Celestial and MediaToolbox APIs
This means celvideosrc is no longer compatible with iOS 3.x.
2010-11-05 15:32:37 +01:00
Ole André Vadla Ravnås
bf095e891f celvideosrc: fix debug category description 2010-11-05 15:32:37 +01:00
Ole André Vadla Ravnås
517f3a75c2 celapi: update to reflect new API on iOS 4.x
Also add remaining property constants for device and stream.
2010-11-05 15:32:37 +01:00
Ole André Vadla Ravnås
da5da05540 mtapi: update to reflect new API on iOS 4.x
Also add remaining property constants for device and stream.
2010-11-05 15:32:37 +01:00
Ole André Vadla Ravnås
8402211bac applemedia: make video source element details consistent
Inspired by the v4l2src element details.
2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
445d7502c4 applemedia: consistently use gst_element_class_set_details_simple 2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
5d71ad0d52 celvideosrc: update e-mail address 2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
44df8abea8 applemedia: rename iphonecamerasrc to celvideosrc
This is in order to improve consistency with the other three sources.
2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
8b22f855ec avfvideosrc: don't explicitly empty the buffer queue
We're holding the only reference to it so there's no need to explicitly
empty it right before letting go of our reference.
2010-11-04 17:58:59 +01:00
Ole André Vadla Ravnås
89e5b60130 avfvideosrc: make buffer offset start from zero 2010-11-04 17:52:05 +01:00
Ole André Vadla Ravnås
86e2539816 qtkitvideosrc: implement zero-copy by using buffer-factory
This means we'll wrap each CoreVideo buffer inside a GstBuffer instead of
making a copy.
2010-11-04 17:52:05 +01:00
Ole André Vadla Ravnås
835b2988b6 bufferfactory: add support for wrapping CVBuffer 2010-11-04 17:52:05 +01:00
Ole André Vadla Ravnås
3a44d4c1f9 qtkitvideosrc: fix up refcounting
Should keep a strong reference to the device, but we don't need to manage
the reference count of elements of an NSMutableArray as it takes care of
that for us.
2010-11-04 17:52:04 +01:00
Ole André Vadla Ravnås
b39609b405 qtkitvideosrc: simplify timestamping algorithm
Aligning timestamps on duration boundaries, skipping frames and so forth
are clearly things that fall outside the scope of a video source.
2010-11-04 17:52:04 +01:00
Ole André Vadla Ravnås
3ba76f825d applemedia: add new iOS video source based on AVFoundation
This element makes use of the documented AVFoundation framework made
available starting with iOS 4.0, and hence this means we can finally
capture video using a public API.
2010-11-04 14:32:10 +01:00
Ole André Vadla Ravnås
50c6e05924 applemedia: fix stream-format caps used for H.264
The stream-format's "avc-sample" member is now called just "avc".
2010-11-04 14:32:09 +01:00
Ole André Vadla Ravnås
b873920eaa applemedia: update e-mail addresses 2010-11-04 14:32:09 +01:00
Ole André Vadla Ravnås
c6b32b42de applemedia: switch vtapi to CFTypeRef style typedefs 2010-11-02 23:14:26 +01:00
Ole André Vadla Ravnås
2e349576eb applemedia: support public version of CoreMedia
Also rename the relevant API so we mirror the public API more closely, and
switch to CoreFoundation CFTypeRef style typedefs. We still support the old
private CoreMedia in order to not break OS X support.

This means that vtenc and vtdec are now compatible with iOS 4.x, and in
theory also future versions of OS X, where this API may turn public like
it has on iOS.
2010-11-02 23:14:26 +01:00
Ole André Vadla Ravnås
0e4e351b83 applemedia: New plugin for Apple multimedia APIs
Provides the following elements:

qtkitvideosrc: OS X video source relying on the QTKit API. Comes with
hard-coded caps as the API does not provide any way of querying for
formats supported by the hardware. Hasn't been tested a lot, but seems
to work.

miovideosrc: OS X video source which uses the undocumented/private
CoreMediaIOServices API, which is also the one used by iChat.
Present on latest version of Leopard and all versions of Snow Leopard.
Has been tested extensively with built-in cameras and TANDBERG's
PrecisionHD USB camera.

vtenc, vtdec: Generic codec wrappers which make use of the undocumented/
private VideoToolbox API on OS X and iOS. List of codecs are currently
hard-coded to H.264 for vtenc, and H.264 + JPEG for vtdec. Can easily be
expanded by adding new entries to the lists, but haven't yet had time to
do that. Should probably also implement probing as available codecs depend
on the OS and its version, and there doesn't seem to be any way to
enumerate the available codecs.

vth264decbin, vth264encbin: Wrapper bins to make it easier to use
vtdec_h264/vtenc_h264 in live scenarios.

iphonecamerasrc: iPhone camera source relying on the undocumented/private
Celestial API. Tested on iOS 3.1 running on an iPhone 3GS. Stops working
after a few minutes, presumably because of a resource leak. Needs some
love.

Note that the iOS parts haven't yet been ported to iOS 4.x.
2010-10-28 15:08:08 +02:00