5 years agoh264: fix incorrect integration of previous commit (4d31e1e). master
Gwenole Beauchesne [Wed, 14 Nov 2012 18:22:13 +0000 (19:22 +0100)]
h264: fix incorrect integration of previous commit (4d31e1e).

git am got confused somehow, though the end result doesn't change at
all since we require both SPS and PPS to be parsed prior to decoding
the first slice.

5 years agoh264: start decoding slices after first SPS/PPS activation.
Gwenole Beauchesne [Wed, 14 Nov 2012 17:40:47 +0000 (18:40 +0100)]
h264: start decoding slices after first SPS/PPS activation.

Only start decoding slices when at least one SPS and PPS got activated.
This fixes cases when a source represents a substream of another stream
and no SPS and PPS was inserted before the first slice of the generated

5 years agoh264: fix VAPictureParameterBufferH264.ReferenceFrames[] construction.
Gwenole Beauchesne [Wed, 14 Nov 2012 13:25:34 +0000 (14:25 +0100)]
h264: fix VAPictureParameterBufferH264.ReferenceFrames[] construction.

... for interlaced streams. The short_ref[] and long_ref[] arrays may
contain up to 32 fields but VA ReferenceFrames[] array expects up to
16 reference frames, thus including both fields.

5 years agoh264: fix interlaced stream decoding with MMCO.
Gwenole Beauchesne [Wed, 14 Nov 2012 09:27:12 +0000 (10:27 +0100)]
h264: fix interlaced stream decoding with MMCO.

Fix decoding of interlaced streams when adaptive_ref_pic_marking_mode_flag
is equal to 1, i.e. when memory management control operations are used. In
particular, when field_pic_flag is set to 0, the new reference flags shall
be applied to both fields.

5 years agoh264: add initial support for interlaced streams.
Gwenole Beauchesne [Tue, 13 Nov 2012 16:14:39 +0000 (17:14 +0100)]
h264: add initial support for interlaced streams.

Decoded frames are only output when they are complete, i.e. when both
fields are decoded. This also means that the "interlaced" caps is not
propagated to vaapipostproc or vaapisink elements. Another limitation
is that interlaced bitstreams with MMCO are unlikely to work.

5 years agoh264: split remove_reference_at() into finer units.
Gwenole Beauchesne [Tue, 13 Nov 2012 15:35:30 +0000 (16:35 +0100)]
h264: split remove_reference_at() into finer units.

Split remove_reference_at() into a function that actually removes the
specified entry from the short-term or long-term reference picture array,
and a function that sets reference flags to the desired value, possibly
zero. The latters marks the picture as "unused for reference".

5 years agodecoder: fix gst_vaapi_picture_new_field() object type.
Gwenole Beauchesne [Tue, 23 Oct 2012 12:04:22 +0000 (14:04 +0200)]
decoder: fix gst_vaapi_picture_new_field() object type.

Fix gst_vaapi_picture_new_field() to preserve the original picture type.
e.g. gst_vaapi_picture_new_field() with a GstVaapiPictureH264 argument
shall generate a GstVaapiPictureH264 object.

5 years agoh264: add picture structure for reference picture marking process.
Gwenole Beauchesne [Tue, 13 Nov 2012 13:04:31 +0000 (14:04 +0100)]
h264: add picture structure for reference picture marking process.

Introduce new `structure' field to the H.264 specific picture structure
so that to simplify the reference picture marking process. That local
picture structure is derived from the original picture structure, as
defined by the syntax elements field_pic_flag and bottom_field_flag.

5 years agoh264: introduce new frame store structure.
Gwenole Beauchesne [Fri, 2 Nov 2012 14:14:58 +0000 (15:14 +0100)]
h264: introduce new frame store structure.

The frame store represents a Decoded Picture Buffer entry, which can
hold up to two fields. So far, the frame store is only used to hold
full frames.

5 years agocodecparsers: update to gst-vaapi-rebased commit 73d6aab.
Gwenole Beauchesne [Tue, 13 Nov 2012 09:10:31 +0000 (10:10 +0100)]
codecparsers: update to gst-vaapi-rebased commit 73d6aab.

73d6aab h264: fix rbsp_more_data() implementation
25d04cf h264: fix error code for invalid size parsed in SPS
84798e5 fix FSF address

5 years agoh264: minor clean-ups.
Gwenole Beauchesne [Wed, 31 Oct 2012 15:37:14 +0000 (16:37 +0100)]
h264: minor clean-ups.

Move DPB flush up if the current picture to decode is an IDR. Besides,
don't bother to check for IDR pictures in dpb_add() function since an
explicit DPB flush was already performed in this case.

5 years agoh264: simplify reference picture marking process.
Gwenole Beauchesne [Wed, 31 Oct 2012 13:24:09 +0000 (14:24 +0100)]
h264: simplify reference picture marking process.

... to build the short_ref[] and long_ref[] lists from the DPB, instead
of maintaining them separately. This avoids refs/unrefs while making it
possible to generate the list based on the actual picture structure.

This also ensures that the list of generated ReferenceFrames[] actually
matches what reference frames are available in the DPB. i.e. short_ref[]
and long_ref[] entries are implied from the DPB, so there is no risk of
having "dangling" references.

5 years agoh264: introduce per-field POC in GstVaapiPictureH264.
Gwenole Beauchesne [Wed, 31 Oct 2012 10:52:03 +0000 (11:52 +0100)]
h264: introduce per-field POC in GstVaapiPictureH264.

Use the POC member available in the GstVaapiPicture base class and
get rid of the dependency on the local VAPictureH264 TopFieldOrderCnt
and BottomFieldOrderCnt. Rather, use a simple field_poc[] array
initialized to INT_MAX, so that to simplify picture POC calculation
for non frame pictures.

5 years agoh264: introduce GST_VAAPI_PICTURE_{SHORT,LONG}_TERM_REFERENCE flags.
Gwenole Beauchesne [Wed, 31 Oct 2012 10:45:14 +0000 (11:45 +0100)]

Further get rid of GstVaapiPictureH264-local VAPictureH264.flags for
reference bits, thus simplifying the reference picture marking process
to only track a single set of reference flags. Also introduce a new
long_term_frame_idx member.

5 years agoh264: introduce GST_VAAPI_PICTURE_FLAG_IDR flag.
Gwenole Beauchesne [Wed, 31 Oct 2012 10:33:40 +0000 (11:33 +0100)]
h264: introduce GST_VAAPI_PICTURE_FLAG_IDR flag.

5 years agoh264: fill in GstVaapiPicture structure.
Gwenole Beauchesne [Wed, 31 Oct 2012 09:56:15 +0000 (10:56 +0100)]
h264: fill in GstVaapiPicture structure.

... and get rid of local VAPictureH264.flags fields in GstVaapiPictureH264.

5 years agoh264: add vaapi_fill_picture() helper.
Gwenole Beauchesne [Wed, 31 Oct 2012 10:07:48 +0000 (11:07 +0100)]
h264: add vaapi_fill_picture() helper.

Add vaapi_fill_picture() helper function to convert GstVaapiPictureH264
to VAPictureH264 structure. This is preparatory work to get rid of the
local VAPictureH264 member in GstVaapiPictureH264.

5 years agoh264: fix activation order of picture and sequence parameters.
Gwenole Beauchesne [Fri, 26 Oct 2012 14:12:05 +0000 (16:12 +0200)]
h264: fix activation order of picture and sequence parameters.

Delay ensure_context() until we actually need a VA context for allocating
new VA surfaces, and then GstVaapiPictures, but also when a real activation
of a new picture parameter set occurs, thus also implying an activation
of the related sequence parameter set.

The most important thing was to drop the global pps and sps pointers since
they may not have matched the currently activated picture parameter or
sequence parameter sets at the specified decode point.

Anoter positive side-effect is that this cleans up all occurrences of
decode_current_picture() to only keep those useful in decode_picture(),
before a new picture is allocated, or in decode_sequence_end() when
an end-of-stream or end-of-sequence condition occurred.

5 years agoh264: fix scaling list generation.
Gwenole Beauchesne [Fri, 26 Oct 2012 11:17:43 +0000 (13:17 +0200)]
h264: fix scaling list generation.

... aka fix regression from efaab79. In particular, ScalingList8x8[]
array was partially copied to the VAIQMatrixBufferH264. While we are
at it, also improve bounds checking and avoid copying 8x8 scaling
lists if transform_8x8_mode_flag is set to 0.

5 years agoh264: fix detection of picture boundaries.
Gwenole Beauchesne [Wed, 24 Oct 2012 16:23:09 +0000 (18:23 +0200)]
h264: fix detection of picture boundaries.

Strictly follow the standard ( to detect the first VCL NAL
unit of a primary coded picture.

5 years agoh264: optimize handling of scaling lists.
Gwenole Beauchesne [Tue, 23 Oct 2012 12:50:14 +0000 (14:50 +0200)]
h264: optimize handling of scaling lists.

Don't copy scaling lists twice to an intermediate state. Rather, directly
use the scaling lists from GstH264PPS since they would match those provided
by SPS header, if necessary. i.e. if PPS-specific scaling lists are not
available in the bitstream.

6 years agoh264: simplify code when MMCO is 5.
Gwenole Beauchesne [Tue, 23 Oct 2012 08:33:50 +0000 (10:33 +0200)]
h264: simplify code when MMCO is 5.

Remove exit_picture() and exit_picture_poc() since PicOrderCnt(CurrPic)
is now updated accordingly to the standard. Besides, MMCO = 5 specific
operations are moved up to exec_ref_pic_marking_adaptive_mmco_5().

6 years agoh264: fix MMCO-based reference picture marking process.
Gwenole Beauchesne [Mon, 22 Oct 2012 09:52:13 +0000 (11:52 +0200)]
h264: fix MMCO-based reference picture marking process.

Fix adaptive memory control decoded reference picture marking process
implementation for operations 2 to 6, thus also fixing support for
long-term reference pictures.

6 years agoh264: move MMCO handlers out of the loop (cosmetics).
Gwenole Beauchesne [Mon, 22 Oct 2012 08:50:29 +0000 (10:50 +0200)]
h264: move MMCO handlers out of the loop (cosmetics).

This change only splits each individual MMCO handler into several functions
dedicated for each operation. This is needed to perform further work later

6 years agodebian: fix make dist for packaging.
Gwenole Beauchesne [Wed, 17 Oct 2012 13:49:23 +0000 (15:49 +0200)]
debian: fix make dist for packaging.

bzip2 tarballs are now used, so update the deb.upstream dependencies
to include dist-bzip2 instead of plain old dist, and use the correct
tar extract options to handle that format.

6 years agoconfigure: generate bzip2 tarballs in ustar format by default.
Gwenole Beauchesne [Wed, 17 Oct 2012 13:42:17 +0000 (15:42 +0200)]
configure: generate bzip2 tarballs in ustar format by default.

6 years agoconfigure: bump glib required version to 2.31.2.
Gwenole Beauchesne [Wed, 17 Oct 2012 13:38:14 +0000 (15:38 +0200)]
configure: bump glib required version to 2.31.2.

Use new Thread API. In particular, g_mutex_init() and g_cond_init()
rather than g_mutex_new() and g_cond_new() respectively.

6 years agovaapidecode: adopt non-deprecrated glib locking primitive pattern.
Rob Bradford [Thu, 4 Oct 2012 16:39:53 +0000 (17:39 +0100)]
vaapidecode: adopt non-deprecrated glib locking primitive pattern.

The use of heap allocated GMutex/GCond is deprecated. Instead place them
inside the structure they are locking.

These changes switch to use g_mutex_init/g_cond_init rather than the heap
allocation functions.

Because we cannot test for a NULL pointer for the GMutex/GCond we must
initialise inside the GObject _init function and clear inside the _finalize
which is guaranteed to only be called once and after the object is no longer
in use.

6 years agovaapidecode: fix compiler warnings.
Gwenole Beauchesne [Wed, 17 Oct 2012 12:52:35 +0000 (14:52 +0200)]
vaapidecode: fix compiler warnings.

Don't care of the return value for gst_vaapi_decoder_put_buffer()
during destruction of the element. Don't print out (uninitialised)
error code when allocation of video buffer failed.

6 years agoh264: add flag to compile with strict DPB ordering mode.
Gwenole Beauchesne [Tue, 16 Oct 2012 14:52:04 +0000 (16:52 +0200)]
h264: add flag to compile with strict DPB ordering mode.

Allow build with strict DPB ordering mode whereby evicted entries
are replaced by the next entries, in order instead of optimizing
it away with the last entry in the DPB.

This is only useful for debugging purpose, against a reference SW
decoder for example.

6 years agoh264: drop extra code covered by built-in codecparsers.
Gwenole Beauchesne [Tue, 16 Oct 2012 14:46:17 +0000 (16:46 +0200)]
h264: drop extra code covered by built-in codecparsers.

GstH264SliceHdr.n_emulation_prevention_bytes is bound to exist now that
a newer version of codecparsers/ are used if the system provided one is
now recent enough to have those required extensions.

6 years agocodecparsers: fix generation of symlinks.
Gwenole Beauchesne [Tue, 16 Oct 2012 14:43:43 +0000 (16:43 +0200)]
codecparsers: fix generation of symlinks.

Try to improve dependencies while generating symlinks to externally
maintained copy of codecparsers (derived from upstream git master

6 years agovc1: use framerate information from bitstream parser.
Gwenole Beauchesne [Thu, 11 Oct 2012 13:04:12 +0000 (15:04 +0200)]
vc1: use framerate information from bitstream parser.

6 years agovc1: use pixel-aspect-ratio from bitstream parser.
Simon Farnsworth [Thu, 27 Sep 2012 17:05:46 +0000 (18:05 +0100)]
vc1: use pixel-aspect-ratio from bitstream parser.

Signed-off-by: Simon Farnsworth <>
Signed-off-by: Gwenole Beauchesne <>
6 years agompeg2: use pixel-aspec-ratio information from bitstream parser.
Simon Farnsworth [Thu, 27 Sep 2012 17:05:46 +0000 (18:05 +0100)]
mpeg2: use pixel-aspec-ratio information from bitstream parser.

Signed-off-by: Simon Farnsworth <>
Signed-off-by: Gwenole Beauchesne <>
6 years agocodecparsers: h264: use submodule sources.
Gwenole Beauchesne [Thu, 11 Oct 2012 11:49:14 +0000 (13:49 +0200)]
codecparsers: h264: use submodule sources.

Use newer sources from the codecparsers/ submodule for
- GstH264SliceHdr.n_emulation_prevention_bytes: EPBs;
- GstH264VUIParams.{par_n,par_d}: pixel-aspect-ratio.

6 years agocodecparsers: jpeg: use submodule sources.
Gwenole Beauchesne [Thu, 11 Oct 2012 11:23:02 +0000 (13:23 +0200)]
codecparsers: jpeg: use submodule sources.

6 years agoAdd codecparsers submodule.
Gwenole Beauchesne [Thu, 11 Oct 2012 08:03:14 +0000 (10:03 +0200)]
Add codecparsers submodule.

6 years ago.gitignore: updates.
Gwenole Beauchesne [Thu, 11 Oct 2012 12:17:12 +0000 (14:17 +0200)]
.gitignore: updates.

6 years agoautogen: fix check for gtkdocize and autoreconf.
Gwenole Beauchesne [Thu, 11 Oct 2012 11:40:37 +0000 (13:40 +0200)]
autogen: fix check for gtkdocize and autoreconf.

If gtkdocize or autoreconf programs were not found, then the
script would fail to report that correctly because test -z was not passed
any argument (empty string "" in this case).

6 years agoh264: use pixel-aspect-ratio from SPS header.
Simon Farnsworth [Thu, 27 Sep 2012 17:05:46 +0000 (18:05 +0100)]
h264: use pixel-aspect-ratio from SPS header.

Propagate pixel-aspect-ratio determined by the GStreamer codecparser
from the sequence headers.

Signed-off-by: Simon Farnsworth <>
Signed-off-by: Gwenole Beauchesne <>
6 years agoh264: add decode_nalu() helper function.
Gwenole Beauchesne [Wed, 10 Oct 2012 08:35:20 +0000 (10:35 +0200)]
h264: add decode_nalu() helper function.

Split decode_buffer() into the core infrastructure that determines
the NAL units contained in the adapter and the actual function that
decodes the NAL unit.

6 years agoh264: fix end-of-stream conditions (flush).
Gwenole Beauchesne [Wed, 10 Oct 2012 08:31:39 +0000 (10:31 +0200)]
h264: fix end-of-stream conditions (flush).

Decode pending data in the adapter prior to processing the actual
code for end-of-stream.

6 years agompeg2: add decode_packet() helper function.
Gwenole Beauchesne [Wed, 10 Oct 2012 07:45:03 +0000 (09:45 +0200)]
mpeg2: add decode_packet() helper function.

Split decode_buffer() into the core infrastructure that determines
the packets contained in the adapter and the actual function that
decodes the packet data.

6 years agompeg2: fix end-of-stream conditions (flush).
Gwenole Beauchesne [Tue, 9 Oct 2012 13:34:18 +0000 (15:34 +0200)]
mpeg2: fix end-of-stream conditions (flush).

Decode pending data in the adapter prior to processing the actual
code for end-of-stream. Initial code from Feng Yuan.

6 years agompeg2: fix memory leak of empty packets.
Gwenole Beauchesne [Tue, 9 Oct 2012 13:40:49 +0000 (15:40 +0200)]
mpeg2: fix memory leak of empty packets.

Fix memory leakage of empty packets, i.e. packets that only contain
the start code prefix. In particular, free empty user-data packets.

Besides, the codec parser will already fail gracefully if the packet
to parse does not have the minimum required size. So, we can also
completely drop the block of code that used to handle packets of size 4
(including the start code).

6 years agompeg2: fix return value for "no-data" conditions.
Gwenole Beauchesne [Tue, 9 Oct 2012 13:01:38 +0000 (15:01 +0200)]
mpeg2: fix return value for "no-data" conditions.

Fix return value when the second scan for start code fails. This means
there is not enough data to determine the full extents of the current
packet and the function shall return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA
in this case, instead of GST_VAAPI_DECODER_STATUS_SUCCESS.

6 years agodecoder: refine semantics of gst_vaapi_decoder_put_buffer().
Gwenole Beauchesne [Tue, 9 Oct 2012 12:48:00 +0000 (14:48 +0200)]
decoder: refine semantics of gst_vaapi_decoder_put_buffer().

Improve the semantics for gst_vaapi_decoder_put_buffer() when an empty
buffer is passed on. An empty buffer is a buffer with a NULL data pointer
or with a size equals to zero. In this case, that buffer is simply
skipped and the function returns TRUE. A NULL buffer argument still
marks the end-of-stream.

6 years agodecoder: drop unused functions.
Gwenole Beauchesne [Tue, 9 Oct 2012 12:40:00 +0000 (14:40 +0200)]
decoder: drop unused functions.

6 years agovaapidecode: flush buffers when receiving EOS.
Wind Yuan [Mon, 27 Aug 2012 02:29:04 +0000 (22:29 -0400)]
vaapidecode: flush buffers when receiving EOS.

Signed-off-by: Gwenole Beauchesne <>
6 years agodebian: fix make dist for packaging.
Gwenole Beauchesne [Fri, 5 Oct 2012 11:36:27 +0000 (13:36 +0200)]
debian: fix make dist for packaging.

6 years agowayland: cosmetics (remove tabs).
Gwenole Beauchesne [Fri, 5 Oct 2012 10:06:27 +0000 (12:06 +0200)]
wayland: cosmetics (remove tabs).

6 years agowayland: add support for windowed mode.
Rob Bradford [Thu, 4 Oct 2012 16:39:52 +0000 (17:39 +0100)]
wayland: add support for windowed mode.

Rather than always making the surface fullscreen instead implement the
set_fullscreen vfunc on GstVaapiWindow and then set the shell surface
fullscreen on not depending on that.

Reviewed-by: Joe Konno <>
Signed-off-by: Gwenole Beauchesne <>
6 years agoBump version for development.
Gwenole Beauchesne [Mon, 1 Oct 2012 07:21:03 +0000 (09:21 +0200)]
Bump version for development.

6 years agoFix and document build dependencies better.
Gwenole Beauchesne [Fri, 28 Sep 2012 15:54:03 +0000 (17:54 +0200)]
Fix and document build dependencies better.

6 years agodebian: fix GStreamer build dependencies.
Gwenole Beauchesne [Fri, 28 Sep 2012 15:41:42 +0000 (17:41 +0200)]
debian: fix GStreamer build dependencies.

6 years agodebian: fix Wayland build dependencies.
Gwenole Beauchesne [Fri, 28 Sep 2012 15:39:43 +0000 (17:39 +0200)]
debian: fix Wayland build dependencies.

6 years agodebian: fix conditional build of packages.
Gwenole Beauchesne [Fri, 28 Sep 2012 15:38:17 +0000 (17:38 +0200)]
debian: fix conditional build of packages.

Make it still possible to build package even if one of the build dependencies
for a specific video backend is not available.

6 years agoutils: drop unused GLX helpers.
Gwenole Beauchesne [Thu, 27 Sep 2012 09:08:58 +0000 (11:08 +0200)]
utils: drop unused GLX helpers.

Remove helpers for GL_ARB_fragment_program and GL_ARB_multitexture
extensions since they are not used throughout gstreamer-vaapi.

6 years agoutils: fix build with <GL/glext.h> version >= 85.
Gwenole Beauchesne [Thu, 27 Sep 2012 09:04:24 +0000 (11:04 +0200)]
utils: fix build with <GL/glext.h> version >= 85.

Mesa recently updated the <GL/glext.h> header version to Khronos version 85.
This caused the PFNGLMULTITEXCOORD2FPROC definition to be moved out of the
GL_VERSION_1_3_DEPRECATED block. However, since <GL/gl.h> also defines
GL_VERSION_1_3 to 1, the definitions in <GL/glext.h> are then not enabled,
thus leaving PFNGLMULTITEXCOORD2FPROC undefined as well.

Provide a PFNGLMULTITEXCOORD2FPROC replacement as an interim solution for
newer versions of the <GL/glext.h> header.

6 years agoconfigure: update VA-API version requirements.
Gwenole Beauchesne [Wed, 26 Sep 2012 14:33:16 +0000 (16:33 +0200)]
configure: update VA-API version requirements.

VA/DRM and VA/Wayland API are now promoted to VA-API 0.33.0 (libva 1.1.0).

6 years agoh264: review and report errors accordingly.
Gwenole Beauchesne [Fri, 21 Sep 2012 14:43:38 +0000 (16:43 +0200)]
h264: review and report errors accordingly.

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

6 years agoh264: exclusively use GstAdapter, drop sub-buffer hack.
Gwenole Beauchesne [Thu, 20 Sep 2012 15:58:21 +0000 (17:58 +0200)]
h264: exclusively use GstAdapter, drop sub-buffer hack.

Maintaining the sub-buffer is rather suboptimal especially since we
were also maintaining a GstAdapter. Now, we only use the GstAdapter
thus requiring minor extra parsing when receiving avcC buffers.

6 years agoREADME: updates.
Gwenole Beauchesne [Thu, 20 Sep 2012 14:18:27 +0000 (16:18 +0200)]
README: updates.

6 years agoNEWS: updates.
Gwenole Beauchesne [Thu, 20 Sep 2012 14:02:39 +0000 (16:02 +0200)]
NEWS: updates.

6 years agodebian: fix packaging on recent Ubuntu platforms.
Gwenole Beauchesne [Thu, 20 Sep 2012 12:38:15 +0000 (14:38 +0200)]
debian: fix packaging on recent Ubuntu platforms.

Use explicit GStreamer plugins path.

6 years agodocs: fix build for make dist.
Gwenole Beauchesne [Mon, 17 Sep 2012 15:55:43 +0000 (17:55 +0200)]
docs: fix build for make dist.

6 years agowayland: set opaque region for YUV surface.
Kristian Høgsberg [Fri, 14 Sep 2012 14:30:35 +0000 (10:30 -0400)]
wayland: set opaque region for YUV surface.

This allows the compositor to optimize redraws and cull away changes
obscured by the video surface.

Signed-off-by: Gwenole Beauchesne <>
6 years agoconfigure: fix check for libva-glx and libva-drm.
Gwenole Beauchesne [Fri, 14 Sep 2012 15:30:19 +0000 (17:30 +0200)]
configure: fix check for libva-glx and libva-drm.

6 years agoglibcompat: add replacement for g_cond_wait_until().
Gwenole Beauchesne [Wed, 12 Sep 2012 11:42:49 +0000 (13:42 +0200)]
glibcompat: add replacement for g_cond_wait_until().

6 years agoplugins: include "sysdeps.h" instead of "config.h".
Gwenole Beauchesne [Wed, 12 Sep 2012 11:41:47 +0000 (13:41 +0200)]
plugins: include "sysdeps.h" instead of "config.h".

6 years agocodecparsers: jpeg: add missing includes.
Gwenole Beauchesne [Wed, 12 Sep 2012 08:40:06 +0000 (10:40 +0200)]
codecparsers: jpeg: add missing includes.

6 years agovaapidecode: don't reset decoder if codec type is the same.
Gwenole Beauchesne [Tue, 11 Sep 2012 15:03:33 +0000 (17:03 +0200)]
vaapidecode: don't reset decoder if codec type is the same.

Reset, i.e. destroy then create, the decoder in _setcaps() handler only
if the underlying codec type actually changed. This makes it possible
to be more tolerant with certain MPEG-2 streams that get parsed to
form caps that are compatible with the previous state but minor changes
to "codec-data".

6 years agovaapidecode: simplify codec lookup from caps.
Gwenole Beauchesne [Tue, 11 Sep 2012 14:41:32 +0000 (16:41 +0200)]
vaapidecode: simplify codec lookup from caps.

Add new gst_vaapi_codec_from_caps() helper to determine codec type from
the specified caps. Don't globally expose this function since this is
really trivial and only used in the vaapidecode element.

6 years agovaapidecode: improve "no free surface" conditions.
Gwenole Beauchesne [Tue, 11 Sep 2012 13:54:20 +0000 (15:54 +0200)]
vaapidecode: improve "no free surface" conditions.

Previously, vaapidecode would wait up to one second until a free surface
is available, or it aborts decoding. Now, vaapidecode waits until the
last decoded surface was to be presented, plus one second. Besides, end
times are now expressed relative to the monotonic clock.

6 years agodecoder: propagate buffer duration downstream.
Gwenole Beauchesne [Tue, 11 Sep 2012 08:59:33 +0000 (10:59 +0200)]
decoder: propagate buffer duration downstream.

6 years agosurfaceproxy: add "duration" property.
Gwenole Beauchesne [Tue, 11 Sep 2012 08:59:10 +0000 (10:59 +0200)]
surfaceproxy: add "duration" property.

6 years agodecoder: cope with new GstVaapiContextInfo based API.
Gwenole Beauchesne [Mon, 10 Sep 2012 16:26:51 +0000 (18:26 +0200)]
decoder: cope with new GstVaapiContextInfo based API.

Update decoders to report the maximum number of reference frames to use.

6 years agocontext: JPEG codec does not need any reference frame.
Gwenole Beauchesne [Mon, 10 Sep 2012 16:17:10 +0000 (18:17 +0200)]
context: JPEG codec does not need any reference frame.

6 years agocontext: allow number of reference frames to be set.
Gwenole Beauchesne [Mon, 10 Sep 2012 16:15:02 +0000 (18:15 +0200)]
context: allow number of reference frames to be set.

Make it possible to specify the maximum number of references to use within
a single VA context. This helps reducing GPU memory allocations to the useful
number of references to be used.

6 years agovaapipostproc: fix deinterlace-{mode,method} types definition.
Gwenole Beauchesne [Fri, 7 Sep 2012 14:41:16 +0000 (16:41 +0200)]
vaapipostproc: fix deinterlace-{mode,method} types definition.

6 years agompeg4: fix debug info for unsupported profile.
Gwenole Beauchesne [Fri, 7 Sep 2012 14:15:40 +0000 (16:15 +0200)]
mpeg4: fix debug info for unsupported profile.

6 years agolibs: fix build in strict ISO C mode.
Gwenole Beauchesne [Fri, 7 Sep 2012 14:14:11 +0000 (16:14 +0200)]
libs: fix build in strict ISO C mode.

6 years agoplugins: fix build in strict ISO C mode.
Gwenole Beauchesne [Fri, 7 Sep 2012 14:11:12 +0000 (16:11 +0200)]
plugins: fix build in strict ISO C mode.

6 years agopkgconfig: fix dependencies and slightly improve description.
Gwenole Beauchesne [Fri, 7 Sep 2012 13:31:09 +0000 (15:31 +0200)]
pkgconfig: fix dependencies and slightly improve description.

Drop @LIBVA_EXTRA_{CFLAGS,LIBS}@ substitutions and slightly improve
descriptions with clearer renderer names.

6 years agovaapidecode: acquire lock only if the mutex exists.
Philip Lorenz [Tue, 4 Sep 2012 11:54:19 +0000 (13:54 +0200)]
vaapidecode: acquire lock only if the mutex exists.

When playback stops the GstVaapiDecode object is reset into a clean
state. However, surfaces may still be referenced by library users and
unreferencing them after the reset triggers an access to an unset mutex.

Signed-off-by: Gwenole Beauchesne <>
6 years agodecoder: drop extraneous return for void function.
Gwenole Beauchesne [Fri, 7 Sep 2012 09:58:53 +0000 (11:58 +0200)]
decoder: drop extraneous return for void function.

6 years agoimage: don't use (void *) pointer arithmetic.
Gwenole Beauchesne [Fri, 7 Sep 2012 09:57:59 +0000 (11:57 +0200)]
image: don't use (void *) pointer arithmetic.

6 years agoDo not forward declare enums.
Philip Lorenz [Tue, 4 Sep 2012 11:40:04 +0000 (13:40 +0200)]
Do not forward declare enums.

Forward declaring enums is not allowed by the C standard and aborts
compilation if the header file is included in a C++ project.

Signed-off-by: Gwenole Beauchesne <>
6 years agoconfigure: fix check for VA/DRM API.
Gwenole Beauchesne [Fri, 7 Sep 2012 09:44:44 +0000 (11:44 +0200)]
configure: fix check for VA/DRM API.

6 years agovaapisink: fix calculation of window size.
Gwenole Beauchesne [Tue, 4 Sep 2012 09:53:18 +0000 (11:53 +0200)]
vaapisink: fix calculation of window size.

If either dimension is out-of-bounds, then scale window to fit the
display size, even if the output is to be rotated. Use the standard
gst_video_sink_center_rect() function to center and scale the window
wrt. the outer (display) bounds.

6 years agovaapisink: add video rotation support.
Wind Yuan [Tue, 28 Aug 2012 06:45:22 +0000 (02:45 -0400)]
vaapisink: add video rotation support.

Signed-off-by: Gwenole Beauchesne <>
6 years agopluginutils: add G_PRIMITIVE_SWAP() helper macro.
Gwenole Beauchesne [Thu, 6 Sep 2012 09:47:40 +0000 (11:47 +0200)]
pluginutils: add G_PRIMITIVE_SWAP() helper macro.

This macro helps swapping variables while maintaining the correct underlying
and primitive type.

6 years agodisplay: fix display aspect ratio when display is rotated.
Gwenole Beauchesne [Thu, 6 Sep 2012 09:51:41 +0000 (11:51 +0200)]
display: fix display aspect ratio when display is rotated.

6 years agodisplay: fix physical display size when display is rotated.
Gwenole Beauchesne [Thu, 6 Sep 2012 09:50:21 +0000 (11:50 +0200)]
display: fix physical display size when display is rotated.

6 years agodisplay: fix GstVaapiRotation enumeration of values.
Gwenole Beauchesne [Thu, 30 Aug 2012 14:27:56 +0000 (16:27 +0200)]
display: fix GstVaapiRotation enumeration of values.

6 years agovaapisink: drop obsolete GstVaapiVideoSink interface.
Gwenole Beauchesne [Wed, 29 Aug 2012 11:18:05 +0000 (13:18 +0200)]
vaapisink: drop obsolete GstVaapiVideoSink interface.

This interface was deprecated since 0.3.x series when the GstVideoContext
interface was added to the main GStreamer APIs.

6 years agovaapisink: automatically detect overlay rendering mode.
Gwenole Beauchesne [Mon, 27 Aug 2012 15:34:27 +0000 (18:34 +0300)]
vaapisink: automatically detect overlay rendering mode.

Retain the VA surface until another surface is to be displayed only
if VA display rendering mode is determined to be "overlay" mode.

6 years agovaapisink: retain VA surface until another one is displayed.
Gwenole Beauchesne [Fri, 24 Aug 2012 13:30:33 +0000 (16:30 +0300)]
vaapisink: retain VA surface until another one is displayed.

Keep VA surface proxy associated with the surface that is currently
being displayed. This makes sure that surface is not released back
to the pool of surfaces free to use for decoding. This is necessary
with VA driver implementations that support rendering to an overlay
pipe. Otherwise, there could be cases where we are decoding into a
surface that is being displayed, hence some flickering.

6 years agovaapisink: fix build with older toolchains.
Gwenole Beauchesne [Fri, 24 Aug 2012 11:54:16 +0000 (14:54 +0300)]
vaapisink: fix build with older toolchains.

Don't re-declare GstVaapiTexture if USE_GLX mode is set.