Commit graph

42 commits

Author SHA1 Message Date
Sreerenj Balachandran
f9ae0c0de4 vc1: add support for video cropping.
If the Advanced profile has display_extension fields, then set the display
width/height dimension as cropping rectangle to the GstVaapiPicture.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-08 18:54:15 +02:00
Gwenole Beauchesne
3cc7b26961 libs: use GstVaapiMiniObject for video decoders.
Port GstVaapiDecoder and GstVaapiDecoder{MPEG2,MPEG4,JPEG,H264,VC1} to
GstVaapiMiniObject. Add gst_vaapi_decoder_set_codec_state_changed_func()
helper function to let the user add a callback to a function triggered
whenever the codec state (e.g. caps) changes.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
788d337505 decoder: fix unpaired GstBuffer map/unmaps.
This possibly fixes a few memory leaks along the way.
2013-04-10 14:58:17 +02:00
Sreerenj Balachandran
51151e7aa1 Add initial support for GStreamer 1.0.
This integrates support for GStreamer API >= 1.0 only in the libgstvaapi
core decoding library. The changes are kept rather minimal here so that
the library retains as little dependency as possible on core GStreamer
functionality.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-04-10 14:58:16 +02:00
Gwenole Beauchesne
2000d5d6e1 vc1: fix use of possibly uninitialized variable.
In decode_codec_data(), force initialization of format to zero so that
we can catch up cases where codec-data has neither "format" nor "wmvversion"
fields, thus making it possible to gracefully fail in this case.
2013-03-21 14:38:06 +01:00
Gwenole Beauchesne
4009430bec decoder: sanitize codec-data decoding.
Add a new GstVaapiDecoder::decode_codec_data() hook to actually decode
codec-data in the decoder sub-class. Provide a common shared helper
function to do the actual work and delegating further to the sub-class.
2013-03-21 14:38:06 +01:00
Gwenole Beauchesne
57ed7e3f8b decoder: sanitize uses of codec frame input buffer (cosmetics).
Alias GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer to a simple
"buffer" variable.
2013-03-21 13:28:05 +01:00
Gwenole Beauchesne
0c99f351fc legal: fix year for some copyright notices (2013). 2013-01-29 14:37:02 +01:00
Gwenole Beauchesne
22094ed053 legal: fix year for some copyright notices (2012). 2013-01-29 14:37:02 +01:00
Gwenole Beauchesne
efd90114bf vc1: handle frames with multiple slices. 2013-01-23 17:02:45 +01:00
Gwenole Beauchesne
3eeff1786a vc1: handle CLOSED_ENTRY.
When CLOSED_ENTRY == 0, and if the B pictures that follow an entry-point
lack a reference anchor picture, these B pictures shall be discarded.

https://bugs.freedesktop.org/show_bug.cgi?id=59505
2013-01-23 11:19:32 +01:00
Gwenole Beauchesne
ee181d1b85 vc1: cope with latest codecparser changes.
Fix build with newer VC-1 codecparser where dqsbedge was renamed to
dqbedge, and now represents either DQSBEDGE or DQDBEDGE depending on
the actual value of DQPROFILE.
2013-01-23 10:25:52 +01:00
Gwenole Beauchesne
df411e435f vc1: fix size of encapsulated BDU.
Fix size of encapsulated BDUs since GstVC1BDU.size actually represents
the size of the BDU data, starting from offset, i.e. after any start
code is parsed.

This fixes a buffer overflow during the unescaping process.
2013-01-22 16:59:40 +01:00
Wind Yuan
a68c218c8e vc1: fix decoding of WMV3 videos in AVI format.
The AVI demuxer (avidemux) does not set a proper "format" attribute
to the generated caps. So, try to recover the video codec format from
the "wmvversion" property instead.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-01-22 16:10:07 +01:00
Gwenole Beauchesne
d69cb4389f vc1: review and report errors accordingly.
Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().
2013-01-22 16:10:07 +01:00
Gwenole Beauchesne
b134a97d42 vc1: don't create GstBuffers for all decoder units.
Don't create temporary GstBuffers for all decoder units, even if they
are lightweight "sub-buffers", since it is not really necessary to keep
the buffer data around.
2013-01-22 16:10:07 +01:00
Gwenole Beauchesne
ec3c4576c0 vc1: implement flush() hook.
Make it a simple DPB flush.
2013-01-22 16:09:45 +01:00
Gwenole Beauchesne
1513f52fc1 vc1: implement {start,end}_frame() hooks.
Implement GstVaapiDecoder.start_frame() and end_frame() semantics so
that to create new VA context earlier and submit VA pictures to the
HW for decoding as soon as possible. i.e. don't wait for the next
frame to start decoding the previous one.
2013-01-22 16:08:25 +01:00
Gwenole Beauchesne
823f16d7ce vc1: fix next POC for new sequence layers.
Fix next POC when a new sequence layer is reached. At this point, we
need to reset any previous reference picture, i.e. non B-frame.
2013-01-22 09:30:04 +01:00
Sreerenj Balachandran
472f3473e0 vc1: port to common GstVaapiDpb interface.
Use GstVaapiDpb interface instead of maintaining our own prev and next
picture pointers. While doing so, try to derive a sensible POC value.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-01-21 19:08:00 +01:00
Gwenole Beauchesne
142e13f637 vc1: fix decode_sequence_end() to return success, not EOS. 2013-01-21 16:35:58 +01:00
Gwenole Beauchesne
2c449e42ca decoder: refactor decoder unit API.
Allocate decoder unit earlier in the main parse() function and don't
delegate this task to derived classes. The ultimate purpose is to get
rid of dynamic allocation of decoder units.
2013-01-07 14:10:13 +01:00
Gwenole Beauchesne
94982b5c05 vc1: initial port to new GstVaapiDecoder API 2012-12-18 15:31:51 +01:00
Sreerenj Balachandran
e7e5c74a6e decoder: use GstVideoCodecState.
Use standard GstVideoCodecState throughout GstVaapiDecoder and expose
it with a new gst_vaapi_decoder_get_codec_state() function. This makes
it possible to drop picture size (width, height) information, framerate
(fps_n, fps_d) information, pixel aspect ratio (par_n, par_d) information,
and interlace mode (is_interlaced field).

This is a new API with backwards compatibility maintained. In particular,
gst_vaapi_decoder_get_caps() is still available.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-12-18 15:31:51 +01:00
Gwenole Beauchesne
193b14c0f2 vc1: use framerate information from bitstream parser. 2012-10-11 15:04:12 +02:00
Simon Farnsworth
b07eb2056b vc1: use pixel-aspect-ratio from bitstream parser.
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-10-11 15:00:44 +02:00
Gwenole Beauchesne
a10b3d3032 decoder: cope with new GstVaapiContextInfo based API.
Update decoders to report the maximum number of reference frames to use.
2012-09-10 18:27:40 +02:00
Gwenole Beauchesne
61cc02f54b libs: fix build in strict ISO C mode. 2012-09-07 16:23:42 +02:00
Gwenole Beauchesne
a7ec623279 decoder: fix semantics of SKIPPED pictures.
If GstVaapiPicture has flag SKIPPED set, this means gst_vaapi_picture_output()
will not push the underlying surface for rendering. Besides, VC-1 skipped P-frame
has nothing to do with rendering. This only means that the currently decoded
picture is just a copy of its reference picture.
2012-03-28 17:59:19 +02:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +01:00
Gwenole Beauchesne
2897618b85 decoder: properly reference count pictures.
This fixes cases where a GstVaapiPicture would be destroyed whereas
there is still a valid instance of it in either prev, current or
next picture.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
e5d12e8853 decoder: rework the internal VA objects API.
The new API simplifies a lot reference counting and makes it more
flexible for future additions/changes. The GstVaapiCodecInfo is
also gone. Rather, new helper macros are provided to allocate
picture, slice and quantization matrix parameter buffers.
2012-01-27 13:28:11 +01:00
Sreerenj Balachandran
c3455e341e vc1: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
6ae97634cf vc1: fix codec-data decoding for WMV3 format. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
7b1d784197 vc1: fix presentation timestamps. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
b5ab2e56a9 vc1: fix MV mode packing. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a7ccbde2af vc1: handle codec-data. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
032486912f vc1: handle encapsulated bitstreams. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
5aea02a66f vc1: fix bitplanes decoding. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
e686c440c7 vc1: fix BFRACTION reconstruction. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a6a1653d92 vc1: fix framerate calculation. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
b865d4a740 Add initial VC-1 decoder. 2012-01-16 11:40:51 +01:00