Commit graph

64 commits

Author SHA1 Message Date
Jan Schmidt
0d7d7f6c92 vtdec: Prefer GL output caps.
Prefer GL caps by putting them first in the pad template and
intersecting using GST_CAPS_INTERSECT_FIRST.
2015-09-12 04:33:34 +10:00
Ilya Konstantinov
bfa054a733 vtdec: handle non-consecutive GstBuffer input without copying
CMBlockBuffer offers a model similar to GstBuffer, as it can
consist of multiple non-consecutive memory blocks.

Prior to this change, what we were doing was:

 1) Incorrect:

   CMBlockBufferCreateWithMemoryBlock does not copy the data,
   but we gst_buffer_unmap'd right away.

 2) Inefficient:

   If the GstBuffer consisted of non-contiguous memory blocks,
   gst_buffer_map resulted in malloc / memcpy.

With this change, we construct a CMBlockBuffer out of individual mapped
GstMemory objects. CMBlockBuffer is made to retain the GstMemory
objects (through the use of CMBlockBufferCustomBlockSource), so the
original GstBuffer can be unref'd.

https://bugzilla.gnome.org/show_bug.cgi?id=751241
2015-07-13 11:11:04 -04:00
Ilya Konstantinov
cc3d79f7cc vtdec: fix refcount error in error handling
https://bugzilla.gnome.org/show_bug.cgi?id=751641
2015-07-07 20:18:50 +03:00
Ilya Konstantinov
1f7681dd0a vtdec: don't copy meta from input to output
Copying arbitrary metas is going to cause problems and this should really be
handled by the base class. It overrides most other things already anyway,
including timestamp and duration. Those are just set here now so we can
insert the frame sorted into the queue.

https://bugzilla.gnome.org/show_bug.cgi?id=748922
2015-06-09 16:20:06 +02:00
Nicolas Dufresne
4cca6efda8 vtdec: Require width and height field for H264
This decoder does not work if width and height field are not set
in the sinkpad caps. Let's make this explicit by adding them to
the template caps.

https://bugzilla.gnome.org/show_bug.cgi?id=749655
2015-06-01 11:23:41 -04:00
Sebastian Dröge
7020154f1c vtdec: We shouldn't manually check reconfigure flag on pads but instead implement ::negotiate()
Add FIXME comment related to that.
2015-05-08 15:08:18 +02:00
Alessandro Decina
edf9035d02 applemedia: avoid implicit color conversions
Rework the GL texture code a little to avoid implicit color conversion inside
AVF/VT on both iOS and OSX.
2015-04-20 17:09:58 +10:00
Alessandro Decina
a10232f7da applemedia: vtdec: fix GL negotiation 2015-04-14 20:33:25 +10:00
Sebastian Dröge
160df421ea vtdec: Register a hardware-only vtdec_hw on OSX and give it a higher rank
while having the default vtdec at secondary rank. This allows decodebin/playbin
to prefer the hardware based decoders, and if that fails to initialize because
hardware resources are busy to fall back to e.g. the libav based h264 decoder
instead of the software based vtdec (which is slower), and only fall back to
the software based vtdec if there is no higher ranked decoder available.
2015-03-07 10:31:26 +01:00
Matthew Waters
c873c57430 vtdec: only attempt use of the texture cache with GLMemory caps features
Otherwise we send rectangle textures to glimagesink
2015-02-25 00:03:34 +11:00
Alessandro Decina
052e4804eb vtdec: fix texture sharing on iOS
Move GLES calls to the context thread. Fix
CVOpenGLESTextureCacheCreateTextureFromImage usage on iOS.
2015-02-09 21:18:24 +11:00
Sebastian Dröge
dac3e4ca06 vtdec: Don't dereference NULL frames when draining/flushing 2015-02-03 15:38:40 +01:00
Alessandro Decina
f577b52e5d applemedia: rework GL texture sharing
Use YUV instead of RGB textures, then convert using the new apple specific
shader in GstGLColorConvert. Also use GLMemory directly instead of using the
GL upload meta, avoiding an extra texture copy we used to have before.
2015-01-30 00:34:08 +11:00
Alessandro Decina
77d48abfab applemedia: vtdec: fix CMBlockBufferRef leak
Fix huge leak that went unnoticed for too long. Oops.
2015-01-30 00:34:08 +11:00
Alessandro Decina
e91989136a applemedia: corevideobuffer: make mapping the CVPixelBuffer in CPU optional
Mapping is not necessary and impacts performance when doing texture sharing with
downstream
2015-01-30 00:34:08 +11:00
Alessandro Decina
d95a12e185 vtdec: implement the GL texture upload meta 2015-01-15 14:10:43 +11: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
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
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
e4563ce6cf vtdec: Properly scale timestamps for the API and set invalid values 2014-09-17 14:54:39 +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
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
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
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
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
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
Andoni Morales Alastruey
bab2bf3f11 applemedia: fix release of null pointer 2013-06-18 13:33:14 +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
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