platform/upstream/gstreamer.git
11 years agoBump version for development.
Gwenole Beauchesne [Fri, 29 Mar 2013 09:39:37 +0000 (10:39 +0100)]
Bump version for development.

11 years ago0.5.2.
Gwenole Beauchesne [Thu, 28 Mar 2013 09:18:51 +0000 (10:18 +0100)]
0.5.2.

11 years agoNEWS: updates.
Gwenole Beauchesne [Thu, 28 Mar 2013 09:15:53 +0000 (10:15 +0100)]
NEWS: updates.

11 years agoplugins: fix usage of gst_vaapi_reply_to_query().
Gwenole Beauchesne [Tue, 26 Mar 2013 17:57:00 +0000 (18:57 +0100)]
plugins: fix usage of gst_vaapi_reply_to_query().

Make gst_vaapi_reply_to_query() first check whether the query argument
is actually a video-context query, i.e. with type GST_QUERY_TYPE_CUSTOM.
Then, make sure vaapisink propagates the query to the parent class if
it is not a video-context query.

11 years agoplugins: streamline video buffers.
Gwenole Beauchesne [Tue, 26 Mar 2013 17:45:53 +0000 (18:45 +0100)]
plugins: streamline video buffers.

Add new gst_vaapi_video_buffer_new() helper function that allocates a video
buffer from a GstVaapiVideoMeta. Also remove obsolete and useless function
gst_vaapi_video_buffer_get_meta().

11 years agoplugins: integrate GstVaapiVideoMeta from libgstvaapi.
Gwenole Beauchesne [Tue, 26 Mar 2013 09:31:10 +0000 (10:31 +0100)]
plugins: integrate GstVaapiVideoMeta from libgstvaapi.

Move GstVaapiVideoMeta from core libgstvaapi decoding library to the
actual plugin elements. That's only useful there. Also inline reference
counting code from GstVaapiMiniObject.

11 years agoplugins: drop gstvaapipluginbuffer.[ch] helper files.
Gwenole Beauchesne [Thu, 21 Mar 2013 16:17:53 +0000 (17:17 +0100)]
plugins: drop gstvaapipluginbuffer.[ch] helper files.

Move all gst_vaapi_video_buffer_new*() helpers from gstvaapipluginbuffer.[ch]
to gstvaapivideobuffer.[ch], and drop the obsolete files.

11 years agoplugins: integrate GstVaapiVideoBuffer from libgstvaapi.
Gwenole Beauchesne [Thu, 21 Mar 2013 16:06:43 +0000 (17:06 +0100)]
plugins: integrate GstVaapiVideoBuffer from libgstvaapi.

Move GstVaapiVideoBuffer from core libgstvaapi decoding library to the
actual plugin elements. That's only useful there.

11 years agoplugins: use common helper function to apply compositions.
Gwenole Beauchesne [Thu, 21 Mar 2013 15:32:43 +0000 (16:32 +0100)]
plugins: use common helper function to apply compositions.

Use common gst_vaapi_apply_composition() helper function to apply compositions
attached to a buffer in vaapisink or GstVaapiVideoConverterGLX.

11 years agoplugins: integrate GstVaapiVideoConverterGLX from libgstvaapi.
Gwenole Beauchesne [Thu, 21 Mar 2013 15:09:42 +0000 (16:09 +0100)]
plugins: integrate GstVaapiVideoConverterGLX from libgstvaapi.

Make sure libgstvaapi core decoding library doesn't include un-needed
dependencies. So, move out GstVaapiVideoConverterGLX to plugins instead.
Besides, even if the vaapisink element is not used, we are bound to have
a correctly populated GstSurfaceBuffer from vaapidecode.

Also clean-up the file along the way.

11 years agovc1: fix use of possibly uninitialized variable.
Gwenole Beauchesne [Thu, 21 Mar 2013 12:32:15 +0000 (13:32 +0100)]
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.

11 years agojpeg: propagate buffer data as a const guchar * pointer (cosmetics).
Gwenole Beauchesne [Thu, 21 Mar 2013 12:43:46 +0000 (13:43 +0100)]
jpeg: propagate buffer data as a const guchar * pointer (cosmetics).

11 years agodecoder: sanitize codec-data decoding.
Gwenole Beauchesne [Thu, 21 Mar 2013 13:36:40 +0000 (14:36 +0100)]
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.

11 years agodecoder: get rid of GstVaapiDecoderUnit::buffer field.
Gwenole Beauchesne [Thu, 21 Mar 2013 12:41:28 +0000 (13:41 +0100)]
decoder: get rid of GstVaapiDecoderUnit::buffer field.

Drop GstVaapiDecoderUnit buffer field (GstBuffer) since it's totally
useless nowadays as creating sub-buffers doesn't bring any value. It
actually means more memory allocations. We can't do without that in
JPEG and MPEG-4:2 decoders.

11 years agodecoder: sanitize uses of codec frame input buffer (cosmetics).
Gwenole Beauchesne [Thu, 21 Mar 2013 12:28:05 +0000 (13:28 +0100)]
decoder: sanitize uses of codec frame input buffer (cosmetics).

Alias GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer to a simple
"buffer" variable.

11 years agovaapisink: add helper function to apply a composition buffer.
Gwenole Beauchesne [Wed, 20 Mar 2013 16:34:38 +0000 (17:34 +0100)]
vaapisink: add helper function to apply a composition buffer.

Simplify application of a composition buffer to a GstVaapiSurface, and
all its peers, until that function is eventually promoted to libgstvaapi.

11 years agovaapisink: fix support for raw YUV buffers.
Gwenole Beauchesne [Wed, 20 Mar 2013 12:42:15 +0000 (13:42 +0100)]
vaapisink: fix support for raw YUV buffers.

If the raw YUV buffer was created from vaapisink, through the buffer_alloc()
hook, then it will have a valid GstVaapiVideoMeta object attached to it.
However, we previously assumed in that case that it was a "native" VA buffer,
thus not calling into GstVaapiUploader::process().

11 years agoplugins: use modern GstElement metadata information.
Gwenole Beauchesne [Wed, 20 Mar 2013 17:41:40 +0000 (18:41 +0100)]
plugins: use modern GstElement metadata information.

Use gst_element_class_set_static_metadata() from GStreamer 1.0, which
basically is the same as gst_element_class_set_details_simple() in
GStreamer 0.10 context.

11 years agoplugins: move up interfaces (cosmetics).
Gwenole Beauchesne [Wed, 20 Mar 2013 17:04:39 +0000 (18:04 +0100)]
plugins: move up interfaces (cosmetics).

Move GstImplementsInterface and GstVideoContext support functions up
so that to keep a clear separation between the plugin element and its
interface hooks.

11 years agoplugins: upgrade to newer APIs (GstVideoInfo based helpers).
Gwenole Beauchesne [Wed, 20 Mar 2013 11:57:18 +0000 (12:57 +0100)]
plugins: upgrade to newer APIs (GstVideoInfo based helpers).

Use GstVideoInfo and gst_video_info_from_caps() helper wherever possible.
Also use the newly added gst_vaapi_image_format_from_structure() helper
in GstVaapiUploader::ensure_allowed_caps().

11 years agoplugins: fix creation of video buffer from another source buffer.
Gwenole Beauchesne [Wed, 20 Mar 2013 13:02:48 +0000 (14:02 +0100)]
plugins: fix creation of video buffer from another source buffer.

gst_vaapi_video_buffer_new_from_buffer() needs to reference the source
buffer video meta since it would be unreference'd from the get_buffer()
helper function. For other cases, we still use (steal) the newly created
video meta.

11 years agoplugins: include "sysdeps.h" header instead of "config.h".
Gwenole Beauchesne [Wed, 20 Mar 2013 10:57:03 +0000 (11:57 +0100)]
plugins: include "sysdeps.h" header instead of "config.h".

11 years agotests: modernize GstTypeFind functions.
Gwenole Beauchesne [Wed, 20 Mar 2013 17:33:23 +0000 (18:33 +0100)]
tests: modernize GstTypeFind functions.

Use the GstTypeFind hooks from GStreamer 1.0. They look safer and
exactly correspond to the expected behaviour.

11 years agotests: fix license templates.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:57:57 +0000 (11:57 +0100)]
tests: fix license templates.

11 years agotests: use gst_vaapi_image_format_from_structure() in test-display.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:53:59 +0000 (11:53 +0100)]
tests: use gst_vaapi_image_format_from_structure() in test-display.

Use gst_vaapi_image_format_from_structure() helper in test-display and
then extract a VAImageFormat from it instead of relying on GstCaps for
YUV and RGB formats.

11 years agotests: include "sysdeps.h" header instead of "config.h".
Gwenole Beauchesne [Wed, 20 Mar 2013 10:50:15 +0000 (11:50 +0100)]
tests: include "sysdeps.h" header instead of "config.h".

11 years agosubpicture: use gst_video_overlay_rectangle_get_pixels_unscaled_raw().
Gwenole Beauchesne [Wed, 20 Mar 2013 17:25:05 +0000 (18:25 +0100)]
subpicture: use gst_video_overlay_rectangle_get_pixels_unscaled_raw().

Use newer gst_video_overlay_rectangle_get_pixels_unscaled_raw() helper
function with GStreamer 0.10 compatible semantics, or that tries to
approach the current meaning. Basically, this is also just about moving
the helper to gstcompat.h.

11 years agoimage: add gst_vaapi_image_format_from_structure() helper.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:10:31 +0000 (11:10 +0100)]
image: add gst_vaapi_image_format_from_structure() helper.

Add helper function to convert video formats from a GstStructure to a
plain GstVaapiImageFormat.

11 years agosysdeps: split out GStreamer API compatibility glue to "gstcompat.h".
Gwenole Beauchesne [Wed, 20 Mar 2013 17:12:18 +0000 (18:12 +0100)]
sysdeps: split out GStreamer API compatibility glue to "gstcompat.h".

11 years agosysdeps: add more standard includes by default.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:56:15 +0000 (11:56 +0100)]
sysdeps: add more standard includes by default.

11 years agoconfigure: improve GStreamer API version checks.
Gwenole Beauchesne [Wed, 20 Mar 2013 13:43:46 +0000 (14:43 +0100)]
configure: improve GStreamer API version checks.

11 years agoconfigure: rename GST_MAJORMINOR to GST_API_VERSION.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:44:10 +0000 (11:44 +0100)]
configure: rename GST_MAJORMINOR to GST_API_VERSION.

11 years agoconfigure: improve check for H.264 codecparser.
Gwenole Beauchesne [Wed, 20 Mar 2013 10:28:06 +0000 (11:28 +0100)]
configure: improve check for H.264 codecparser.

11 years agovaapiupload: fix illegal write in ensure_image().
Holger Kaelberer [Mon, 25 Feb 2013 23:38:24 +0000 (00:38 +0100)]
vaapiupload: fix illegal write in ensure_image().

Fix ensure_image() to only zero-initialize the first line of each plane.
Properly initializing each plane to their full vertical resolution would
require to actually compute it based on the image format.

In particular, for NV12 images, the UV plane has half vertical resolution
vs. the Y plane. So using the full image height to initialize the UV plane
will obviously lead to a buffer overflow. Likewise for other YUV format.

Since ensure_image() is only a helper function to initialize something,
and not necessarily the whole thing, it is fine to initializ the first
line only. Besides, the target surface is not rendered either.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
11 years agobuild: fix compiling of local GstVideoDecoder and codecparsers.
Xiang, Haihao [Sun, 17 Feb 2013 08:28:47 +0000 (16:28 +0800)]
build: fix compiling of local GstVideoDecoder and codecparsers.

Generated source files were missing a dependency on the complete set of
generated header files. e.g. gstvideodecoder.c requires gstvideoutils.h
to build and almost every codec parser source depends on parserutils.h.

https://bugs.freedesktop.org/show_bug.cgi?id=59575

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
11 years agoh264: set {luma,chroma}_log2_weight_denom to 0 if no pred_weight_table().
Gwenole Beauchesne [Fri, 8 Feb 2013 10:56:54 +0000 (11:56 +0100)]
h264: set {luma,chroma}_log2_weight_denom to 0 if no pred_weight_table().

Force luma_log2_weight_denom and chroma_log2_weight_denom to zero if
there is no pred_weight_table() that was parsed.

This is a workaround for the VA intel-driver on Ivy Bridge.

11 years agoh264: use new profile definitions from codecparsers.
Gwenole Beauchesne [Thu, 7 Feb 2013 14:42:55 +0000 (15:42 +0100)]
h264: use new profile definitions from codecparsers.

11 years agocodecparsers: update to gst-vaapi-branch commit 500bc02.
Gwenole Beauchesne [Thu, 7 Feb 2013 14:29:44 +0000 (15:29 +0100)]
codecparsers: update to gst-vaapi-branch commit 500bc02.

500bc02 h264: add profile enums

11 years agoNEWS: updates.
Gwenole Beauchesne [Wed, 6 Feb 2013 14:27:18 +0000 (15:27 +0100)]
NEWS: updates.

11 years agocodecparsers: update to gst-vaapi-branch commit 31b1c57.
Gwenole Beauchesne [Wed, 6 Feb 2013 14:21:27 +0000 (15:21 +0100)]
codecparsers: update to gst-vaapi-branch commit 31b1c57.

8957fb7 mpeg2: add helpers to convert quantization matrices
07c4034 mpeg2: store quantization matrices in zigzag scan order

11 years agotests: simple-decoder: fix build on older platforms.
Gwenole Beauchesne [Thu, 31 Jan 2013 10:32:24 +0000 (11:32 +0100)]
tests: simple-decoder: fix build on older platforms.

Make simple-decoder build and execute correctly on older platforms,
and more precisely older versions of glib.

11 years agoglibcompat: add replacement for g_async_queue_timeout_pop().
Gwenole Beauchesne [Thu, 31 Jan 2013 10:30:12 +0000 (11:30 +0100)]
glibcompat: add replacement for g_async_queue_timeout_pop().

g_async_queue_timeout_pop() appeared in glib 2.31.18. Implement it as
g_async_queue_timed_pop() with a GTimeVal as the final time to wait for
new data to arrive in the queue.

11 years agoglibcompat: add replacement for g_cond_wait().
Gwenole Beauchesne [Thu, 31 Jan 2013 10:25:18 +0000 (11:25 +0100)]
glibcompat: add replacement for g_cond_wait().

11 years agompeg2: fix decoding of 4K videos.
Gwenole Beauchesne [Wed, 30 Jan 2013 17:38:38 +0000 (18:38 +0100)]
mpeg2: fix decoding of 4K videos.

Account for slice_vertical_position_extension when vertical_size > 2800.

11 years agompeg2: fix decoding of sequence_end().
Gwenole Beauchesne [Wed, 30 Jan 2013 17:54:13 +0000 (18:54 +0100)]
mpeg2: fix decoding of sequence_end().

There shall be only one place to call decode_current_picture(), and this
is in the end_frame() hook. The EOS unit is processed after end_frame()
so this means we cannot have a valid picture to decode/output at this
point.

11 years agompeg2: improve robustness when packets are missing.
Gwenole Beauchesne [Wed, 30 Jan 2013 14:10:06 +0000 (15:10 +0100)]
mpeg2: improve robustness when packets are missing.

Improve robustness when some expected packets where not received yet
or that were not correctly decoded. For example, don't try to decode
a picture if there was no valid sequence or picture headers.

11 years agodecoder: handle decode-only frames in raw API mode.
Gwenole Beauchesne [Wed, 30 Jan 2013 17:58:01 +0000 (18:58 +0100)]
decoder: handle decode-only frames in raw API mode.

Fix gst_vaapi_decoder_get_surface() to only return frames with a valid
surface proxy, i.e. with a valid VA surface. This means that any frame
marked as decode-only is simply skipped.

11 years agodecoder: allow frames to be dropped.
Gwenole Beauchesne [Wed, 30 Jan 2013 15:33:48 +0000 (16:33 +0100)]
decoder: allow frames to be dropped.

If the decoder was not able to decode a frame because insufficient
information was available, e.g. missing sequence or picture header,
then allow the frame to be gracefully dropped without generating
any error.

It is also possible that a frame is not meant to be displayed but
only used as a reference, so dropping that frame is also a valid
operation since GstVideoDecoder base class has extra references to
that GstVideoCodecFrame that needs to be released.

11 years agovaapidecode: handle decode-only frames.
Gwenole Beauchesne [Wed, 30 Jan 2013 15:26:07 +0000 (16:26 +0100)]
vaapidecode: handle decode-only frames.

Decode-only frames may not have a valid surface proxy. So, simply discard
them gracefully, i.e. don't create meta data information. GstVideoDecoder
base class will properly handle this case and won't try to push any buffer
to downstream elements.

11 years agovaapidecode: add support for post-seek semantics reset.
Sreerenj Balachandran [Wed, 23 Jan 2013 22:49:17 +0000 (00:49 +0200)]
vaapidecode: add support for post-seek semantics reset.

Implement GstVideoDecoder::reset() as a destruction of the VA decoder
and the creation of a new VA decoder.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
11 years agoBump version for development.
Gwenole Beauchesne [Wed, 30 Jan 2013 08:38:07 +0000 (09:38 +0100)]
Bump version for development.

11 years ago0.5.1.
Gwenole Beauchesne [Wed, 30 Jan 2013 08:37:38 +0000 (09:37 +0100)]
0.5.1.

11 years agompeg2: implement GstVaapiDecoder::flush() as a DPB flush.
Sreerenj Balachandran [Wed, 23 Jan 2013 22:48:26 +0000 (00:48 +0200)]
mpeg2: implement GstVaapiDecoder::flush() as a DPB flush.

11 years agodecoder: fix documentation for GstVaapiDecoderFrame.
Sreerenj Balachandran [Thu, 24 Jan 2013 15:34:43 +0000 (17:34 +0200)]
decoder: fix documentation for GstVaapiDecoderFrame.

Drop superfluous reference to prev_slice member.

11 years agodecoder: assume current frame is complete at end-of-stream.
Gwenole Beauchesne [Tue, 29 Jan 2013 15:18:13 +0000 (16:18 +0100)]
decoder: assume current frame is complete at end-of-stream.

Assume we got a complete frame when the end-of-stream is reached and that
the current codec frame contains at least one slice data unit.

11 years agolegal: fix year for some copyright notices (2013).
Gwenole Beauchesne [Tue, 29 Jan 2013 13:14:45 +0000 (14:14 +0100)]
legal: fix year for some copyright notices (2013).

11 years agolegal: fix year for some copyright notices (2012).
Gwenole Beauchesne [Tue, 29 Jan 2013 13:03:27 +0000 (14:03 +0100)]
legal: fix year for some copyright notices (2012).

11 years agolegal: add Intel copyright on modified files.
Gwenole Beauchesne [Tue, 29 Jan 2013 13:00:04 +0000 (14:00 +0100)]
legal: add Intel copyright on modified files.

11 years agoNEWS: updates.
Gwenole Beauchesne [Tue, 29 Jan 2013 12:37:41 +0000 (13:37 +0100)]
NEWS: updates.

11 years agowayland: use a local event queue to avoid lock contention.
Gwenole Beauchesne [Mon, 28 Jan 2013 17:09:09 +0000 (18:09 +0100)]
wayland: use a local event queue to avoid lock contention.

This improves performance when rendering several surfaces from within
the same process. e.g. a tee of vaapidecode'd buffers to vaapisink.

11 years agowayland: fix thread-safe issues.
Gwenole Beauchesne [Mon, 28 Jan 2013 16:28:58 +0000 (17:28 +0100)]
wayland: fix thread-safe issues.

The Wayland API is not fully thread-safe and client applications shall
perform locking themselves on key functions. Besides, make sure to
release the lock if the _render() function fails.

11 years agowayland: really wait until the pending redraw completed.
Gwenole Beauchesne [Mon, 28 Jan 2013 15:37:28 +0000 (16:37 +0100)]
wayland: really wait until the pending redraw completed.

Introduce gst_vaapi_window_wayland_sync() helper function to wait for
the completion of the redraw request. Use it in _render() function to
actually block until the previous draw request is completed.

11 years agowayland: fix frame_redraw callback.
Gwenole Beauchesne [Wed, 23 Jan 2013 09:10:35 +0000 (10:10 +0100)]
wayland: fix frame_redraw callback.

The redraw callback needs to be attached to the surface prior to the
commit. Otherwise, the callback notifies the next surface repaint,
which is not the desired behaviour. i.e. we want to be notified for
the surface we have just filled.

Another isse was the redraw_pending was reset before the actual completion
of the frame redraw callback function, thus causing concurrency issues.
e.g. the callback could have been called again, but with a NULL buffer.

11 years agowayland: fix display sharing.
Gwenole Beauchesne [Mon, 28 Jan 2013 13:45:28 +0000 (14:45 +0100)]
wayland: fix display sharing.

When the Wayland display is shared, we still have to create our own local
shell and compositor objects, since they are not propagated from the cache.
Likewise, we also need to determine the display size or vaapisink would
fail to account for the display aspect ratio, and will try to create a 0x0
window.

11 years agocodecparsers: update to gst-vaapi-branch commit 21a098e.
Gwenole Beauchesne [Thu, 24 Jan 2013 16:38:53 +0000 (17:38 +0100)]
codecparsers: update to gst-vaapi-branch commit 21a098e.

21a098e vc1: fix bitplanes decoding (DIFF6 or NORM6) [residual]
f8c836a vc1: fix bitplanes decoding (DIFF6 or NORM6)

11 years agovc1: handle frames with multiple slices.
Gwenole Beauchesne [Wed, 23 Jan 2013 15:38:24 +0000 (16:38 +0100)]
vc1: handle frames with multiple slices.

11 years agocodecparsers: update to gst-vaapi-branch commit 3fba492.
Gwenole Beauchesne [Wed, 23 Jan 2013 16:01:34 +0000 (17:01 +0100)]
codecparsers: update to gst-vaapi-branch commit 3fba492.

3fba492 vc1: add API to parse slice headers

11 years agovc1: handle CLOSED_ENTRY.
Gwenole Beauchesne [Wed, 23 Jan 2013 10:11:25 +0000 (11:11 +0100)]
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

11 years agovc1: cope with latest codecparser changes.
Gwenole Beauchesne [Wed, 23 Jan 2013 09:25:52 +0000 (10:25 +0100)]
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.

11 years agocodecparsers: update to gst-vaapi-branch commit 3d2c67c.
Gwenole Beauchesne [Wed, 23 Jan 2013 09:24:04 +0000 (10:24 +0100)]
codecparsers: update to gst-vaapi-branch commit 3d2c67c.

3d2c67c vc1: simplify GstVC1VopDquant structure

11 years agocodecparsers: update to gst-vaapi-branch commit 5d33da8.
Gwenole Beauchesne [Tue, 22 Jan 2013 09:51:40 +0000 (10:51 +0100)]
codecparsers: update to gst-vaapi-branch commit 5d33da8.

5d33da8 vc1: fix bitplanes decoding
562bdc4 vc1: fix VOPDQUANT parser for DQUANT == 2
0b13d2b vc1: fix calculation of ALTPQUANT
ba88e63 vc1: fix parser for DQPROFILE in VOPDQUANT

11 years agovc1: fix size of encapsulated BDU.
Gwenole Beauchesne [Tue, 22 Jan 2013 14:47:09 +0000 (15:47 +0100)]
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.

11 years agovc1: fix decoding of WMV3 videos in AVI format.
Wind Yuan [Fri, 11 Jan 2013 09:08:00 +0000 (17:08 +0800)]
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>
11 years agovc1: review and report errors accordingly.
Gwenole Beauchesne [Tue, 22 Jan 2013 12:28:13 +0000 (13:28 +0100)]
vc1: review and report errors accordingly.

Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().

11 years agovc1: don't create GstBuffers for all decoder units.
Gwenole Beauchesne [Tue, 22 Jan 2013 12:50:39 +0000 (13:50 +0100)]
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.

11 years agovc1: implement flush() hook.
Gwenole Beauchesne [Tue, 22 Jan 2013 15:03:18 +0000 (16:03 +0100)]
vc1: implement flush() hook.

Make it a simple DPB flush.

11 years agovc1: implement {start,end}_frame() hooks.
Gwenole Beauchesne [Tue, 22 Jan 2013 12:44:32 +0000 (13:44 +0100)]
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.

11 years agovc1: fix next POC for new sequence layers.
Gwenole Beauchesne [Tue, 22 Jan 2013 08:30:04 +0000 (09:30 +0100)]
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.

11 years agovc1: port to common GstVaapiDpb interface.
Sreerenj Balachandran [Thu, 2 Aug 2012 14:15:26 +0000 (17:15 +0300)]
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>
11 years agovc1: fix decode_sequence_end() to return success, not EOS.
Gwenole Beauchesne [Tue, 15 Jan 2013 16:10:56 +0000 (17:10 +0100)]
vc1: fix decode_sequence_end() to return success, not EOS.

11 years agodecoder: simplify gst_vaapi_decoder_get_surface().
Gwenole Beauchesne [Fri, 18 Jan 2013 16:00:18 +0000 (17:00 +0100)]
decoder: simplify gst_vaapi_decoder_get_surface().

Avoid extraenous branches, i.e. immediately return with success once we
have a decoded frame available.

11 years agodecoder: optimize and clean decode_step() up.
Gwenole Beauchesne [Fri, 18 Jan 2013 15:56:15 +0000 (16:56 +0100)]
decoder: optimize and clean decode_step() up.

Avoid usage of goto. Simplify decode_step() process to first accumulate all
pending buffers into the GstAdapter, and then parse and decode units from
that input adapter. Stop the process once a frame is fully decoded or an
error occurred.

11 years agodisplay: move "vaapi" debug init to libgstvaapi_init_once().
Gwenole Beauchesne [Fri, 18 Jan 2013 13:46:23 +0000 (14:46 +0100)]
display: move "vaapi" debug init to libgstvaapi_init_once().

11 years agodisplay: dump gstreamer-vaapi version for debugging purposes.
Gwenole Beauchesne [Fri, 18 Jan 2013 13:17:34 +0000 (14:17 +0100)]
display: dump gstreamer-vaapi version for debugging purposes.

11 years agotests: simple-decoder: fix build with built-in videoutils.
Gwenole Beauchesne [Fri, 18 Jan 2013 13:30:48 +0000 (14:30 +0100)]
tests: simple-decoder: fix build with built-in videoutils.

Fix build with built-in videoutils, i.e. when system GStreamer installation
does not know about GstVideoDecoder API.

11 years agotests: simple-decoder: flush decoded frames at EOS.
Gwenole Beauchesne [Fri, 18 Jan 2013 09:35:44 +0000 (10:35 +0100)]
tests: simple-decoder: flush decoded frames at EOS.

Flush the remaining decoded frames when an end-of-stream is reached.

11 years agotests: simple-decoder: drop use of GstVaapiVideoMeta.
Gwenole Beauchesne [Fri, 18 Jan 2013 09:25:14 +0000 (10:25 +0100)]
tests: simple-decoder: drop use of GstVaapiVideoMeta.

Don't use GstVaapiVideoMeta since that object is not guaranteed to live
in libgstvaapi forever. Rather, that'd move to plugin elements at some
point.

11 years agotests: simple-decoder: add benchmark mode.
Gwenole Beauchesne [Wed, 16 Jan 2013 12:53:43 +0000 (13:53 +0100)]
tests: simple-decoder: add benchmark mode.

Add --benchmark option to enable benchmark mode where rendering is not
synchronized with presentation timestamps of the decoded surfaces.

11 years agotests: simple-decoder: honour framerate from the bitstream.
Gwenole Beauchesne [Wed, 16 Jan 2013 12:29:06 +0000 (13:29 +0100)]
tests: simple-decoder: honour framerate from the bitstream.

Try to honour the framerate from the bitstream, or cap the playback to
60 fps by default.

11 years agotests: simple-decoder: set window size to the surface dimensions.
Gwenole Beauchesne [Tue, 15 Jan 2013 17:49:28 +0000 (18:49 +0100)]
tests: simple-decoder: set window size to the surface dimensions.

Set the window size to the decoded surface dimensions, if the user has
not requested the application to run in full-screen mode. Besides, no
effort is made to preserve aspect ratio or to center the video within
the mapped window.

11 years agotests: add simple decoder application.
Gwenole Beauchesne [Tue, 15 Jan 2013 16:33:18 +0000 (17:33 +0100)]
tests: add simple decoder application.

Add simple decoder application to show off decoding capabilities from
raw bitstreams, for debugging or performance evaluation purposes.

11 years agotests: add codec helper utils.
Gwenole Beauchesne [Tue, 15 Jan 2013 16:30:57 +0000 (17:30 +0100)]
tests: add codec helper utils.

Add helper functions to determine the codec type from a specific file
or utility functions to convert from codec type to GstCaps or from
codec name to codec type.

11 years agotests: allow fullscreen mode.
Gwenole Beauchesne [Tue, 15 Jan 2013 16:47:13 +0000 (17:47 +0100)]
tests: allow fullscreen mode.

Add new --fullscreen|-f option to create new windows in fullscreen mode.

11 years agoh264: implement GstVaapiDecoder::flush() as a DPB flush.
Gwenole Beauchesne [Thu, 17 Jan 2013 17:35:58 +0000 (18:35 +0100)]
h264: implement GstVaapiDecoder::flush() as a DPB flush.

11 years agoh264: handle end-of-stream NALU.
Gwenole Beauchesne [Thu, 17 Jan 2013 17:07:03 +0000 (18:07 +0100)]
h264: handle end-of-stream NALU.

Handle <end-of-stream> NAL unit to actually flush any pending picture
from the DPB.

11 years agovaapidecode: handle EOS events.
Gwenole Beauchesne [Thu, 17 Jan 2013 17:22:49 +0000 (18:22 +0100)]
vaapidecode: handle EOS events.

Flush all decoded frames to downstream when EOS is received. This is
performed by implementing GstVideoDecoder::finish() hook.

11 years agovaapidecode: split gvd_handle_frame() into decode/push frames.
Gwenole Beauchesne [Thu, 17 Jan 2013 17:19:14 +0000 (18:19 +0100)]
vaapidecode: split gvd_handle_frame() into decode/push frames.

Split GstVideoDecoder::handle_frame() implementation into two functions:
(i) one for decoding the provided GstVideoCodecFrame and (ii) another one
for purging all decoded frames and submit them downstream.

11 years agodecoder: add GstVaapiDecoder::flush() hook.
Gwenole Beauchesne [Thu, 17 Jan 2013 17:33:32 +0000 (18:33 +0100)]
decoder: add GstVaapiDecoder::flush() hook.

11 years agodecoder: fix check for end-of-stream in raw API mode.
Gwenole Beauchesne [Tue, 15 Jan 2013 16:21:50 +0000 (17:21 +0100)]
decoder: fix check for end-of-stream in raw API mode.

Make sure to immediately return GST_VAAPI_DECODER_STATUS_END_OF_STREAM
if the end-of-stream was already reached at the previous iteration.

11 years agodecoder: make decode_step() return once the frame is decoded.
Gwenole Beauchesne [Tue, 15 Jan 2013 15:55:29 +0000 (16:55 +0100)]
decoder: make decode_step() return once the frame is decoded.

Make sure we always have a free surface left to use for decoding the
current frame. This means that decode_step() has to return once a frame
gets decoded. If the current adapter contains more buffers with valid
frames, they will get parsed and decoded on subsequent iterations.