platform/upstream/gstreamer.git
9 years agovaapidecode: don't print an error message for GST_FLOW_FLUSHING
Michael Olbrich [Tue, 27 Jan 2015 12:50:12 +0000 (14:50 +0200)]
vaapidecode: don't print an error message for GST_FLOW_FLUSHING

9 years agogstvaapiencoder: Fix the negotiation issue with _ENCODED format handling
Sreerenj Balachandran [Tue, 27 Jan 2015 10:38:45 +0000 (12:38 +0200)]
gstvaapiencoder: Fix the negotiation issue with _ENCODED format handling

Don't error out for the video format GST_VIDEO_FORMAT_ENCODED with in gstvaapiencoder,
since the vaaapi context creation (gstvaapicontext.c) can still use the
default chroma type which is YUV420.

https://bugzilla.gnome.org/show_bug.cgi?id=743567
https://bugzilla.gnome.org/show_bug.cgi?id=743035

9 years agoh264parse: drop patches merged upstream.
Sreerenj Balachandran [Wed, 21 Jan 2015 16:31:22 +0000 (18:31 +0200)]
h264parse: drop patches merged upstream.

0003-h264parse-add-initial-support-for-MVC-NAL-units.patch

9 years agocodecparsers: update to gst-vaapi-branch commit d3b5c1b
Sreerenj Balachandran [Wed, 21 Jan 2015 16:26:12 +0000 (18:26 +0200)]
codecparsers: update to gst-vaapi-branch commit d3b5c1b

8194cac: h264parse: parse SPS subset
64b7f52: h264parse: expose stereo-high profile
774360a: h264parse: add initial support for MVC NAL units
258478f: h264parser: fix stack smashing

9 years agoFix compilation error if there is no GL/gl.h header file installed
Sreerenj Balachandran [Mon, 19 Jan 2015 09:30:12 +0000 (11:30 +0200)]
Fix compilation error if there is no GL/gl.h header file installed

9 years agovaapidecode: commit updated srcpad caps to base plugin.
Gwenole Beauchesne [Thu, 15 Jan 2015 15:23:24 +0000 (16:23 +0100)]
vaapidecode: commit updated srcpad caps to base plugin.

Make sure that the GstVaapiPluginBase instance receives the new src
pad caps whenever they get updated from within the GstVaapiDecoder
decode routines.

This also ensures that downstream elements receive correctly sized
SW decoded buffers if needed.

https://bugs.tizen.org/jira/browse/TC-114

9 years agovaapidecode: always reset decoder on ::set_format().
Gwenole Beauchesne [Thu, 15 Jan 2015 15:19:59 +0000 (16:19 +0100)]
vaapidecode: always reset decoder on ::set_format().

Split GstVideoDecoder::set_format() handler to first update the sink
pad caps and reset the active VA decoder instance based on those, and
then update the src pad caps whenever possible, e.g. when the caps
specify a valid video resolution.

9 years agovaapivideomemory: don't crash when trying to allocate 0x0 images.
Gwenole Beauchesne [Thu, 15 Jan 2015 15:14:13 +0000 (16:14 +0100)]
vaapivideomemory: don't crash when trying to allocate 0x0 images.

In some occasions, a buffer pool is created for pre-initialization
purposes regardless of whether a valid image size is available or
not. However, during actual decode stage, the vaapidecode element
is expected to update the srcpad caps with the new dimensions, thus
also triggering a reset of the underlying bufferpool.

9 years agocodecparsers: update to gst-vaapi-branch commit 191cb2f
Sreerenj Balachandran [Wed, 14 Jan 2015 22:00:16 +0000 (00:00 +0200)]
codecparsers: update to gst-vaapi-branch commit 191cb2f

347605a: h264parse: expose compatible profiles to downstream
d1ea97e: h264parse: Fix periodic SPS/PPS sending work after a seek
24a3126: Revert "h264parse: expose compatible profiles to downstream"
8661740: h264parse: expose compatible profiles to downstream
8b7ef3f: codecparsers: fix some compiler warnings

9 years agoencoder: h264: Fix the period between I/P frames
Sreerenj Balachandran [Thu, 27 Nov 2014 10:11:03 +0000 (12:11 +0200)]
encoder: h264: Fix the period between I/P frames

If the key-frame period is set as one, then ip_period shuld be zero

https://bugzilla.gnome.org/show_bug.cgi?id=734992

9 years agoencoder: h264: Provide intra_idr_period value for VAEncSequenceParameterBufferH264
Sreerenj Balachandran [Thu, 27 Nov 2014 09:21:03 +0000 (11:21 +0200)]
encoder: h264: Provide intra_idr_period value for VAEncSequenceParameterBufferH264

https://bugzilla.gnome.org/show_bug.cgi?id=734993

9 years agovaapisink: Protect the X11 API invokations with proper locking
Sreerenj Balachandran [Thu, 27 Nov 2014 09:14:50 +0000 (11:14 +0200)]
vaapisink: Protect the X11 API invokations with proper locking

https://bugzilla.gnome.org/show_bug.cgi?id=739808

9 years agoencoder: h264: fix pixel-aspect-ratio in encoded stream.
Gwenole Beauchesne [Thu, 27 Nov 2014 09:13:20 +0000 (11:13 +0200)]
encoder: h264: fix pixel-aspect-ratio in encoded stream.

Really report sample aspect ratio (SAR) as present, and make it match
what we have obtained from the user as pixel-aspect-ratio (PAR). i.e.
really make sure VUI parameter aspect_ratio_info_present_flag is set
to TRUE and that the indication from aspect_ratio_idc is Extended_SAR.

This is a leftover from git commit a12662f.

https://bugzilla.gnome.org/show_bug.cgi?id=740360

9 years agodecoder: mpeg4: fix uninitialized variables.
Gwenole Beauchesne [Tue, 25 Nov 2014 10:46:12 +0000 (11:46 +0100)]
decoder: mpeg4: fix uninitialized variables.

Fix gst_vaapi_decoder_mpeg4_parse() to initialize the packet type to
GST_MPEG4_USER_DATA so that a parse error would result in skipping
that packet. Also fix gst_vaapi_decoder_mpeg4_decode_codec_data() to
initialize status to GST_VAAPI_DECODER_STATUS_SUCCESS.

9 years agoencoder: h264: fix profile limits.
Gwenole Beauchesne [Tue, 25 Nov 2014 10:41:49 +0000 (11:41 +0100)]
encoder: h264: fix profile limits.

Fix ensure_profile_limits() to lower profile to the desired limits,
only if the latter are actually known and the profile needed to be
changed to fit.

9 years agovaapipostproc: fix out caps for GLMemory.
Gwenole Beauchesne [Mon, 24 Nov 2014 14:14:37 +0000 (15:14 +0100)]
vaapipostproc: fix out caps for GLMemory.

If the best downstream capsfeature turns out to be GLMemory, then make
sure to propagate RGBA video format in caps to that element. This fixes
the following pipeline: ... ! vaapipostproc ! glimagesink.

9 years agovaapipostproc: fix check for compatible src pad capsfilters.
Gwenole Beauchesne [Mon, 24 Nov 2014 13:25:33 +0000 (14:25 +0100)]
vaapipostproc: fix check for compatible src pad capsfilters.

When an explicit output video format is selected, from an src pad
capsfilter, make sure that the downstream element actually supports
that format. In particular, fix crash with the following pipelines:
... ! vaapipostproc ! video/x-raw,format=XXX ! xvimagesink ; where
XXX is a format not supported by xvimagesink.

While doing so, also reduce the set of src pad filter caps to the
actual set of allowed src pad caps.

9 years agoplugins: re-indent all video processing related source code.
Gwenole Beauchesne [Mon, 24 Nov 2014 13:10:11 +0000 (14:10 +0100)]
plugins: re-indent all video processing related source code.

9 years agoplugins: further fixes to the new "current" storage tracker.
Gwenole Beauchesne [Mon, 24 Nov 2014 12:20:33 +0000 (13:20 +0100)]
plugins: further fixes to the new "current" storage tracker.

The ensure_surface() and ensure_image() functions shall only relate
to the underlying backing store. The actual current flags are to be
updated only through ensure_{surface,image}_is_current() or very other
particular cases in GstMemory hooks.

9 years agoplugins: fix "current" video memory flags.
Gwenole Beauchesne [Fri, 21 Nov 2014 14:43:35 +0000 (15:43 +0100)]
plugins: fix "current" video memory flags.

If the surface proxy is updated into the GstVaapiVideoMemory, then
it is assumed it is the most current representation of the current
video frame. Likewise, make a few more arrangements to have the
"current " flags set more consistently.

9 years agoplugins: ensure VA surface is current prior to using it.
Gwenole Beauchesne [Fri, 21 Nov 2014 14:23:13 +0000 (15:23 +0100)]
plugins: ensure VA surface is current prior to using it.

When interacting with SW elements, the buffers and underlying video
memory could be mapped as read/write. However, we need to use those
buffers again as plain VA surfaces, we have to make sure the VA image
is thus committed back to VA surface memory.

This fixes pipelines involving avdec_* and vaapi{postproc,sink}.

9 years agoplugins: enable memory maps for read & write.
Víctor Manuel Jáquez Leal [Fri, 12 Jul 2013 10:34:15 +0000 (06:34 -0400)]
plugins: enable memory maps for read & write.

Hence vaapisink can display buffers decoded by gst-libav, or HW decoded
buffers can be further processed in-place, e.g. with a textoverlay.

https://bugzilla.gnome.org/show_bug.cgi?id=704078

[ported to current git master branch, amended commit message]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoplugins: preserve framerate when updating src caps video format.
Gwenole Beauchesne [Tue, 18 Nov 2014 13:57:02 +0000 (14:57 +0100)]
plugins: preserve framerate when updating src caps video format.

In the current implementation, gst_video_info_set_format() would reset
the whole GstVideoInfo structure first, prior to setting video format
and size. So, coleteral information like framerate or pixel-aspect-
ratio are lost.

Provide and use a unique gst_video_info_change_format() for overcome
this issue, i.e. only have it change the format and video size, and
copy over the rest of the fields.

https://bugzilla.gnome.org/show_bug.cgi?id=734665

9 years agovaapidecode: increase the rank to GST_RANK_PRIMARY + 1
Sreerenj Balachandran [Tue, 18 Nov 2014 12:07:57 +0000 (14:07 +0200)]
vaapidecode: increase the rank to GST_RANK_PRIMARY + 1

This is for helping decodebin to autoplug the vaapidecode element.

Decodebin is selecting decoder elements only based on rank and caps.
Without overriding the autoplug-* signals there is no way to autoplug
HW decoders inside decodebin. An easier soulution is to raise the
rank of vaapidecode, so that it gets selected first.

https://bugzilla.gnome.org/show_bug.cgi?id=739332

9 years agovaapidecode: only expose supported profiles when needed.
Gwenole Beauchesne [Wed, 12 Nov 2014 06:46:53 +0000 (07:46 +0100)]
vaapidecode: only expose supported profiles when needed.

JPEG and VP8 codecs do not really support the concept of "profile". So,
don't try to expose any set that wouldn't be supported by jpegparse, or
ivfparse for instance.

https://bugzilla.gnome.org/show_bug.cgi?id=739713
https://bugzilla.gnome.org/show_bug.cgi?id=739714

9 years agodecoder: h264: add initial support for repeat-first-field (RFF) flag.
Gwenole Beauchesne [Thu, 13 Nov 2014 14:13:24 +0000 (15:13 +0100)]
decoder: h264: add initial support for repeat-first-field (RFF) flag.

Use the SEI pic_timing() message to track and propagate down the repeat
first field (RFF) flag. This is only initial support as there is one
other condition that could induce the RFF flag, which is not handled
yet.

9 years agodecoder: h264: fix picture ordering count type 0 with previous MMCO5.
Gwenole Beauchesne [Thu, 13 Nov 2014 14:05:19 +0000 (15:05 +0100)]
decoder: h264: fix picture ordering count type 0 with previous MMCO5.

Fix the decoding process for picture order count type 0 when the previous
picture had a memory_management_control_operation = 5. In particular, fix
the actual variable type for prev_pic_structure to hold the full bits of
the picture structure.

In practice, this used to work though, due to the underlying type used to
express a gboolean.

9 years agodecoder: h264: fix detection of top-field-first (TFF) flag.
Gwenole Beauchesne [Thu, 13 Nov 2014 14:00:21 +0000 (15:00 +0100)]
decoder: h264: fix detection of top-field-first (TFF) flag.

Use the SEI pic_timing() message to track the pic_struct variable when
present, or infer it from the regular slice header flags field_pic_flag
and bottom_field_flag. This fixes temporal sequence ordering when the
output pictures are to be displayed.

https://bugzilla.gnome.org/show_bug.cgi?id=739291

9 years agocodecparsers: update to gst-vaapi-branch commit 3d05d9f.
Gwenole Beauchesne [Fri, 14 Nov 2014 08:54:02 +0000 (09:54 +0100)]
codecparsers: update to gst-vaapi-branch commit 3d05d9f.

1241840 h264: fix derivation of MaxPicNum variable
3bd718e h264: fix GstH264ParserResult documentation typo
b021609 h264parse: set the HEADER flag on buffers containing SPS or PPS
b08e4be h264parse: don't unnecesarily set src_caps

9 years agovaapipostproc: Add string representation of VPP functions to ElementFactoy Klass
Sreerenj Balachandran [Mon, 3 Nov 2014 17:20:43 +0000 (19:20 +0200)]
vaapipostproc: Add string representation of VPP functions to ElementFactoy Klass

Added the same Klass specifications used in other upstream
video postprocessing elements like videoconvert, videoscale,
videobalance and deinterlace.
An example use case is for this is to help the playsink
to autoplug the hardware accelerated deinterlacer.

9 years agovaapipostproc: Tweak the output video format setting to enable the autoplugging
Sreerenj Balachandran [Mon, 3 Nov 2014 17:19:20 +0000 (19:19 +0200)]
vaapipostproc: Tweak the output video format setting to enable the autoplugging

This is a workaround until auto-plugging is fixed when
format=ENCODED + memory:VASurface caps feature are provided.

Use the downstream negotiated video format as the output video format
if the user didn't ask for the colorspace conversion explicitly.
Usecase: This will help to connect elements like videoscale, videorate etc
to vaapipostproc.

https://bugzilla.gnome.org/show_bug.cgi?id=739443

9 years agovaapipostproc: allow user defined scaling mode.
Gwenole Beauchesne [Wed, 29 Oct 2014 16:30:30 +0000 (17:30 +0100)]
vaapipostproc: allow user defined scaling mode.

Add new "scale-method" property to expose the scaling mode to use during
video processing. Note that this is only a hint, and the actual behaviour
may differ from implementation (VA driver) to implementation.

9 years agofilter: add initial support for high quality scaling.
Gwenole Beauchesne [Wed, 29 Oct 2014 15:57:12 +0000 (16:57 +0100)]
filter: add initial support for high quality scaling.

Add support for video scaling options in VPP pipelines. Only the
DEFAULT mode is bound to exist. Others might be folded into that
mode.

9 years agofilter: re-indent all GstVaapiFilter related source code.
Gwenole Beauchesne [Wed, 29 Oct 2014 15:35:46 +0000 (16:35 +0100)]
filter: re-indent all GstVaapiFilter related source code.

9 years agocodecparsers: update to gst-vaapi-branch commit f9d3bde.
Gwenole Beauchesne [Wed, 29 Oct 2014 14:45:50 +0000 (15:45 +0100)]
codecparsers: update to gst-vaapi-branch commit f9d3bde.

2218b02 h264parse: expose parsed profile and level to downstream
3dbfab4 h264parse: return flushing if we get chained while being set to READY
d40fa8b h264: fix frame packing SEI parsing
32d40be h264: Use proper bit_reader api while parsing buffering_period SEI
b3e022e h264: initialize some fields of pic_timing structure
a70661d vc1: fix expected level in sequence-layer parsing unit test
6cee88d vc1: fix level values for simple/main profile
356c189 vc1: add unit test for sequence-layer parsing
ab9f641 vc1: take care of endianness when parsing sequence-layer
8dc8e35 mpeg4: fix vlc table used for sprite trajectory

9 years agovaapidecode: Expose the supported profiles as caps to upstream
Sreerenj Balachandran [Wed, 29 Oct 2014 13:46:47 +0000 (15:46 +0200)]
vaapidecode: Expose the supported profiles as caps to upstream

This will allows the playbin to fallback to Software Decoder
if the Hardware Decoder does not support a particular profile.

https://bugzilla.gnome.org/show_bug.cgi?id=730997

9 years agoencode: Attach the codec-data to out caps only based on negotiated caps
Sreerenj Balachandran [Wed, 29 Oct 2014 13:46:12 +0000 (15:46 +0200)]
encode: Attach the codec-data to out caps only based on negotiated caps

Attach the codec_data to out_caps only if downstream needed.
For eg: h264 encoder doesn't need to stuff codec_data to the
src caps if the negotiated caps has a stream format of byte-stream.

https://bugzilla.gnome.org/show_bug.cgi?id=734902

9 years agoconfigure: echoing installation prefix path
Sreerenj Balachandran [Wed, 29 Oct 2014 13:45:44 +0000 (15:45 +0200)]
configure: echoing installation prefix path

9 years agodisplay: add support for DRM Render-Nodes.
Gwenole Beauchesne [Wed, 24 Sep 2014 08:14:24 +0000 (10:14 +0200)]
display: add support for DRM Render-Nodes.

Add support for DRM Render-Nodes. This is a new feature that appeared
in kernel 3.12 for experimentation purposes, but was later declared
stable enough in kernel 3.15 for getting enabled by default.

This allows headless usages without authentication at all, i.e. usages
through plain ssh connections is possible.

9 years agovaapisink: clean-ups (indentation, drop unused variables).
Gwenole Beauchesne [Wed, 24 Sep 2014 11:44:43 +0000 (13:44 +0200)]
vaapisink: clean-ups (indentation, drop unused variables).

9 years agovaapisink: fix GstNavigation "key-press" / "key-release" events.
Gwenole Beauchesne [Wed, 24 Sep 2014 11:39:55 +0000 (13:39 +0200)]
vaapisink: fix GstNavigation "key-press" / "key-release" events.

Fix arguments to XkbKeycodeToKeysym() for converting an X11 keycode
to a KeySym. In particular, there is no such Window argument. Also
make sure to check for, and use, the correct <X11/XKBlib.h> header
where that new function is defined. Otherwise, default to the older
XKeycodeToKeysym() function.

9 years agovaapisink: fix GstNavigation "mouse-move" event.
Gwenole Beauchesne [Wed, 24 Sep 2014 11:23:17 +0000 (13:23 +0200)]
vaapisink: fix GstNavigation "mouse-move" event.

Really use the motion event coordinates to propagate the "mouse-move"
event to upper layer, instead of those from a button event. Those are
technically the same though.

9 years agovaapisink: implement the GstNavigation interface
Sreerenj Balachandran [Tue, 16 Sep 2014 11:25:40 +0000 (14:25 +0300)]
vaapisink: implement the GstNavigation interface

This is useful for things like DVD menus, where key/mouse events
would need to be forwarded from the upstream sink element.

https://bugzilla.gnome.org/show_bug.cgi?id=711479

9 years agovaapipostproc: fix deinterlacing from non VA memory buffers.
Simon Farnsworth [Thu, 13 Mar 2014 18:38:33 +0000 (18:38 +0000)]
vaapipostproc: fix deinterlacing from non VA memory buffers.

When we copy a buffer because we're moving it into VA-API memory, we
need to copy flags. Otherwise, interlaced YUV buffers from a capture
source (e.g. V4L2) don't get flagged as interlaced.

https://bugzilla.gnome.org/show_bug.cgi?id=726270

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
[reversed order of gst_buffer_copy_into() flags to match <1.0 code]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapipostproc: add support for GLTextureUploadMeta output.
Gwenole Beauchesne [Fri, 22 Aug 2014 13:22:32 +0000 (15:22 +0200)]
vaapipostproc: add support for GLTextureUploadMeta output.

This allows for vaapipostproc to be chained to the glimagesink element
for instance.

https://bugzilla.gnome.org/show_bug.cgi?id=735231

9 years agovaapipostproc: add support for "download" capability.
Gwenole Beauchesne [Fri, 22 Aug 2014 13:22:32 +0000 (15:22 +0200)]
vaapipostproc: add support for "download" capability.

Allow implicit conversions to raw video formats, while still keeping
VA surfaces underneath. This allows for chaining the vaapipostproc
element to a software-only element that takes care of maps/unmaps.
e.g. xvimagesink.

https://bugzilla.gnome.org/show_bug.cgi?id=720174

9 years agovaapipostproc: use pooled vaapi video meta.
Gwenole Beauchesne [Fri, 22 Aug 2014 16:10:54 +0000 (18:10 +0200)]
vaapipostproc: use pooled vaapi video meta.

Use pooled GstVaapiVideoMeta information, i.e. always allocate that on
video buffer allocation. Also optimize copy of additional metadata info
into the resulting video buffer: only copy the video cropping info and
the source surface proxy.

https://bugzilla.gnome.org/show_bug.cgi?id=720311

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
[fixed proxy leak, fixed double free on error, optimized meta copy]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapipostproc: fix passthrough mode.
Gwenole Beauchesne [Fri, 22 Aug 2014 13:17:29 +0000 (15:17 +0200)]
vaapipostproc: fix passthrough mode.

If no explicit output surface format is supplied try to keep the one
supplied through the sink pad caps. This avoids a useless copy, even
if things are kept in GPU memory.

This is a performance regression from git commit dfa70b9.

9 years agovaapipostproc: fix output buffer to have a GstVaapiVideoMemory.
Sreerenj Balachandran [Sat, 5 Jul 2014 18:00:34 +0000 (21:00 +0300)]
vaapipostproc: fix output buffer to have a GstVaapiVideoMemory.

https://bugzilla.gnome.org/show_bug.cgi?id=720311

[used new infrastructure through base decide_allocation() impl]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapipostproc: enable advanced deinterlacing with same format.
Gwenole Beauchesne [Fri, 22 Aug 2014 09:13:36 +0000 (11:13 +0200)]
vaapipostproc: enable advanced deinterlacing with same format.

If only advanced deinterlacing is requested, i.e. deinterlacing is
the only active algorithm to apply with source and output surface
formats being the same, then make sure to enable VPP processing.

Otherwise, allow fallback to bob-deinterlacing with simple rendering
flags alteration.

9 years agovaapivideomemory: avoid NULL pointer unref if GstVaapiImage creation failed.
Sreerenj Balachandran [Thu, 21 Aug 2014 12:04:20 +0000 (15:04 +0300)]
vaapivideomemory: avoid NULL pointer unref if GstVaapiImage creation failed.

https://bugzilla.gnome.org/show_bug.cgi?id=735156

9 years agoplugins: fix memory leaks.
Gwenole Beauchesne [Fri, 22 Aug 2014 11:25:03 +0000 (13:25 +0200)]
plugins: fix memory leaks.

9 years agoplugins: factor out decide_allocation() hook.
Gwenole Beauchesne [Thu, 21 Aug 2014 12:10:36 +0000 (14:10 +0200)]
plugins: factor out decide_allocation() hook.

Add a default decide_allocation() hook to GstVaapiPluginBase. The caps
feature argument can be used to force a bufferpool with a specific kind
of memory.

9 years agoplugins: allow bufferpool to not allocate vaapi video meta.
Gwenole Beauchesne [Thu, 21 Aug 2014 09:12:39 +0000 (11:12 +0200)]
plugins: allow bufferpool to not allocate vaapi video meta.

Add GST_VAAPI_VIDEO_BUFFER_POOL_ACQUIRE_FLAG_NO_ALLOC params flag that
can be used to disable early allocations of vaapi video metas on buffers,
thus delagating that to the bufferpool user.

9 years agoplugins: re-indent all GstVaapiVideo* related source code.
Gwenole Beauchesne [Thu, 21 Aug 2014 08:45:31 +0000 (10:45 +0200)]
plugins: re-indent all GstVaapiVideo* related source code.

9 years agosurfaceproxy: fix copy to propagate view_id.
Gwenole Beauchesne [Fri, 22 Aug 2014 13:12:46 +0000 (15:12 +0200)]
surfaceproxy: fix copy to propagate view_id.

Fix gst_vaapi_surface_proxy_copy() to copy the view-id element, thus
fixing random frames skipped when vaapipostproc element is used in
passthrough mode. In that mode, GstMemory is copied, thus including
the underlying GstVaapiVideoMeta and associated GstVaapiSurfaceProxy.

9 years agovaapipostproc: fix detection of output surface format changes.
Gwenole Beauchesne [Wed, 20 Aug 2014 14:38:45 +0000 (16:38 +0200)]
vaapipostproc: fix detection of output surface format changes.

Default to I420 format for output surfaces so that to match the usual
GStreamer pipelines. Though, internally, we could still opt for NV12
surface formats, i.e. default format=ENCODED is a hint for that, thus
delegating the decision to the VA driver.

9 years agovaapipostproc: fix construction of allowed sink pad caps.
Gwenole Beauchesne [Wed, 20 Aug 2014 08:59:53 +0000 (10:59 +0200)]
vaapipostproc: fix construction of allowed sink pad caps.

Fix construction of the set of caps allowed on the sink pad to filter
out unsupported raw video caps with GStreamer >= 1.2.

9 years agovaapipostproc: improve heuristics for detecting native VA surfaces.
Gwenole Beauchesne [Wed, 20 Aug 2014 08:37:02 +0000 (10:37 +0200)]
vaapipostproc: improve heuristics for detecting native VA surfaces.

Use the new gst_caps_has_vaapi_surface() helper function to detect
whether the sink pad caps contain native VA surfaces, or not, i.e.
no raw video caps.

Also rename is_raw_yuv to get_va_surfaces to make the variable more
explicit as we just want a way to differentiate raw video caps from
VA surfaces actually.

9 years agovaapipostproc: disable discontinuity detection code.
Gwenole Beauchesne [Tue, 12 Aug 2014 16:33:25 +0000 (18:33 +0200)]
vaapipostproc: disable discontinuity detection code.

The "discontinuity" tracking code, whereby lost frames are tentatively
detected, is inoperant if the sink pad buffer timestamps are not right
to begin with.

This is a temporary workaround until the following bug is fixed:
https://bugzilla.gnome.org/show_bug.cgi?id=734386

9 years agovaapipostproc: fix heuristic for detecting discontinuity.
Gwenole Beauchesne [Thu, 7 Aug 2014 12:57:26 +0000 (14:57 +0200)]
vaapipostproc: fix heuristic for detecting discontinuity.

In order to make the discontinuity detection code useful, we need to
detect the lost frames in the history as early as the previous frame.
This is because some VA implementations only support one reference
frame for advanced deinterlacing.

In practice, turn the condition for detecting new frame that is beyond
the previous frame from field_duration*2 to field_duration*3, i.e.
nothing received for the past frame and a half because of possible
rounding errors when calculating the field-duration either in this
element (vaapipostproc), or from the upstream element (parser element).

This is a regression introduced with commit faefd62.

https://bugzilla.gnome.org/show_bug.cgi?id=734135

9 years agoplugins: fix detection of raw video caps.
Gwenole Beauchesne [Wed, 20 Aug 2014 09:43:08 +0000 (11:43 +0200)]
plugins: fix detection of raw video caps.

Use the new gst_caps_has_vaapi_surface() helper function to better
detect raw video caps, and in particular those from RGB colorspace.

https://bugzilla.gnome.org/show_bug.cgi?id=734665

9 years agoplugins: add helper for detecting VA surfaces in caps.
Gwenole Beauchesne [Wed, 20 Aug 2014 09:30:41 +0000 (11:30 +0200)]
plugins: add helper for detecting VA surfaces in caps.

Introduce new gst_caps_has_vaapi_surface() helper function to detect
whether the supplied caps has VA surfaces. With GStreamer >= 1.2, this
implies a check for memory:VASurface caps features, and format=ENCODED
for earlier versions of GStreamer.

9 years agovaapidecode: start the decoder task again after finishing
Sebastian Dröge [Tue, 12 Aug 2014 10:01:57 +0000 (13:01 +0300)]
vaapidecode: start the decoder task again after finishing

This allows the element to accept data again after draining without
a hard reset or caps change happening in between.

https://bugzilla.gnome.org/show_bug.cgi?id=734616

9 years agovaapidecode: unlock condition variables before shutting down the element
Sebastian Dröge [Tue, 12 Aug 2014 10:00:03 +0000 (13:00 +0300)]
vaapidecode: unlock condition variables before shutting down the element

Otherwise threads might wait for them, causing the shutdown of the element
to deadlock on the streaming thread.

https://bugzilla.gnome.org/show_bug.cgi?id=734616

9 years agovaapidecode: reset decoder_finish variable after stopping the decoder thread
Sebastian Dröge [Mon, 11 Aug 2014 14:15:24 +0000 (17:15 +0300)]
vaapidecode: reset decoder_finish variable after stopping the decoder thread

Otherwise the element is not usable again after draining/EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=734616

9 years agovaapidecode: don't try flushing the decoder instance if we didn't create one yet
Sebastian Dröge [Mon, 11 Aug 2014 14:14:53 +0000 (17:14 +0300)]
vaapidecode: don't try flushing the decoder instance if we didn't create one yet

This otherwise results in unnecessary error messages.

https://bugzilla.gnome.org/show_bug.cgi?id=734616

9 years agobuild: fix with --no-undefined linker flags.
Gwenole Beauchesne [Fri, 1 Aug 2014 04:32:32 +0000 (06:32 +0200)]
build: fix with --no-undefined linker flags.

https://bugzilla.gnome.org/show_bug.cgi?id=729352

9 years agovaapisink: add support for GstColorBalance interface.
Changzhi Wei [Thu, 23 Jan 2014 15:44:09 +0000 (15:44 +0000)]
vaapisink: add support for GstColorBalance interface.

https://bugzilla.gnome.org/show_bug.cgi?id=722390

[fixed channel names, simplified range factor, fixed memory leak]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapisink: add support for colorbalance adjustment.
Changzhi Wei [Thu, 23 Jan 2014 15:23:00 +0000 (15:23 +0000)]
vaapisink: add support for colorbalance adjustment.

https://bugzilla.gnome.org/show_bug.cgi?id=722390

[fixed and simplified tracking of colorbalance value changes]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapisink: improve installation of properties.
Gwenole Beauchesne [Thu, 31 Jul 2014 11:18:21 +0000 (13:18 +0200)]
vaapisink: improve installation of properties.

Simplify the creation and installation process of properties, by first
accumulating them into a g_properties[] array, and next calling into
g_object_class_install_properties().

Also add missing docs and flags to some properties.

9 years agovaapisink: code clean-ups.
Gwenole Beauchesne [Thu, 31 Jul 2014 08:48:15 +0000 (10:48 +0200)]
vaapisink: code clean-ups.

Move code around in a more logical way. Introduce GST_VAAPISINK_CAST()
helper macro and use it wherever we know the object is a GstBaseSink or
any base class. Drop explicit initializers for values that have defaults
set to zero.

9 years agovaapisink: re-indent all GstVaapiSink related source code.
Gwenole Beauchesne [Thu, 31 Jul 2014 08:37:57 +0000 (10:37 +0200)]
vaapisink: re-indent all GstVaapiSink related source code.

9 years agovaapisink: introduce separate backends.
Gwenole Beauchesne [Wed, 30 Jul 2014 15:27:50 +0000 (17:27 +0200)]
vaapisink: introduce separate backends.

Introduce new backends vtable so that to have clean separation between
display dependent code and common base code. That's a "soft" separation,
we don't really need dedicated objects.

https://bugzilla.gnome.org/show_bug.cgi?id=722248

9 years agovaapisink: drop unused "synchronous" mode.
Gwenole Beauchesne [Wed, 30 Jul 2014 14:47:20 +0000 (16:47 +0200)]
vaapisink: drop unused "synchronous" mode.

Support for X11 "synchronous" mode was never implemented, and was only
to be useful for debugging. Drop that altogether, that's not going to
be useful in practice.

https://bugzilla.gnome.org/show_bug.cgi?id=733985

9 years agovaapisink: drop unused variables.
Gwenole Beauchesne [Wed, 30 Jul 2014 15:32:29 +0000 (17:32 +0200)]
vaapisink: drop unused variables.

Drop obsolete, and now unused, video_buffer_pool and video_buffer_size
variables. They got merged into the GstVaapiPluginBase object.

9 years agovaapisink: drop GLX rendering and fancy effects.
Gwenole Beauchesne [Wed, 30 Jul 2014 14:35:32 +0000 (16:35 +0200)]
vaapisink: drop GLX rendering and fancy effects.

Rendering with GLX in vaapisink is kind of useless nowadays, including
OpenGL related fancy effects. Plain VA/GLX interfaces are also getting
deprecated in favor of EGL, or more direct buffer sharing with actual
GL textures.

Should testing of interop with GLX be needed, one could still be using
the modern cluttersink or glimagesink elements.

https://bugzilla.gnome.org/show_bug.cgi?id=733984

9 years agovaapisink: listen to window size changes on X11.
Holger Kaelberer [Tue, 5 Nov 2013 13:01:11 +0000 (14:01 +0100)]
vaapisink: listen to window size changes on X11.

Allow dynamic changes to the window, e.g. performed by the user, and
make sure to refresh its contents, while preserving aspect ratio.

In practice, Expose and ConfigureNotify events are tracked in X11
display mode by default. This occurs in a separte event thread, and
this is similar to what xvimagesink does. Any of those events will
trigger a reconfiguration of the window "soft" size, subsequently
the render-rect when necessary, and finally _expose() the result.

The default of handle_events=true can be changed programatically via
gst_x_overlay_handle_events().

Thanks to Fabrice Bellet for rebasing the patch.

https://bugzilla.gnome.org/show_bug.cgi?id=711478

[dropped XInitThreads(), cleaned up the code a little]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapidecode: decode and output all pending frames on normal EOS.
Gwenole Beauchesne [Tue, 29 Jul 2014 13:47:46 +0000 (15:47 +0200)]
vaapidecode: decode and output all pending frames on normal EOS.

The gst_vaapidecode_decode_loop() function is called within a separate
task to fetch and output all frames that were decoded so far. So, if
the decoder_loop_status is forcibly set to EOS when _finish() is called,
then we are bound to exist the task without submitting the pending
frames.

If the downstream element error'ed out, then the gst_pad_push() would
propagate up an error and so we will get it right for cutting off
_finish() early in that case.

This is a regression from 6003596.

https://bugzilla.gnome.org/show_bug.cgi?id=733897

9 years agoBump version for development.
Gwenole Beauchesne [Tue, 29 Jul 2014 11:24:52 +0000 (13:24 +0200)]
Bump version for development.

9 years agoAUTHORS: updates.
Gwenole Beauchesne [Tue, 29 Jul 2014 08:31:58 +0000 (10:31 +0200)]
AUTHORS: updates.

9 years agoNEWS: updates.
Gwenole Beauchesne [Tue, 29 Jul 2014 08:31:15 +0000 (10:31 +0200)]
NEWS: updates.

9 years agovaapidecode: properly return from decode loop on downstream errors.
Matthew Waters [Tue, 29 Jul 2014 06:22:01 +0000 (16:22 +1000)]
vaapidecode: properly return from decode loop on downstream errors.

Fixes a hang/race on shutdown where _decode_loop() had already completed
its execution and _finish() was waiting on a GCond for decode_loop()
to complete.  Also fixes the possible race where _finish() is called
but _decode_loop() endlessly returns before signalling completion
iff the decoder instance returns GST_FLOW_OK.

Found with: ... ! vaapidecode ! {glimagesink,cluttersink}

https://bugzilla.gnome.org/show_bug.cgi?id=733897

[factored out GST_VIDEO_DECODER_STREAM_UNLOCK() call]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years ago0.5.9.
Gwenole Beauchesne [Mon, 28 Jul 2014 16:45:49 +0000 (18:45 +0200)]
0.5.9.

9 years agovaapisink: fix GstVideoOverlay::expose() implementation.
Gwenole Beauchesne [Mon, 28 Jul 2014 16:31:09 +0000 (18:31 +0200)]
vaapisink: fix GstVideoOverlay::expose() implementation.

Now that we always track the currently active video buffer, it is
not necessary to automatically increase its reference since this is
implicitly performed in ::show_frame() through the get_input_buffer()
helper from GstVaapiPluginBase class.

This is a regression from a26df80.

9 years agovaapidecode: simplify bufferpool configuration.
Gwenole Beauchesne [Mon, 28 Jul 2014 16:00:19 +0000 (18:00 +0200)]
vaapidecode: simplify bufferpool configuration.

Rework the logics behind the configuration of an adequate bufferpool,
especially when OpenGL meta or additional capsfeatures are needed.

Besides, for GStreamer >= 1.4, the first capsfeatures that gets matched,
and that is not system memory, is now selected by default.

9 years agovaapidecode: fix auto-plugging of vaapisink element.
Gwenole Beauchesne [Mon, 28 Jul 2014 14:43:47 +0000 (16:43 +0200)]
vaapidecode: fix auto-plugging of vaapisink element.

Make sure to propagate memory:VASurface capsfeature to srcpad caps
only for GStreamer >= 1.5 as the plug-in elements in GStreamer 1.4
core currently miss additional patches available in 1.5-git (1.6).

This is a temporary workaround.

9 years agoconfigure: allow builds against GStreamer git (1.5.x).
Sreerenj Balachandran [Mon, 28 Jul 2014 12:54:46 +0000 (15:54 +0300)]
configure: allow builds against GStreamer git (1.5.x).

https://bugzilla.gnome.org/show_bug.cgi?id=733688

9 years agoconfigure: fix build with GStreamer 1.4.0 release.
Gwenole Beauchesne [Mon, 28 Jul 2014 12:20:33 +0000 (14:20 +0200)]
configure: fix build with GStreamer 1.4.0 release.

9 years agodebian: fix packaging for new naming scheme.
Gwenole Beauchesne [Tue, 4 Mar 2014 18:40:59 +0000 (19:40 +0100)]
debian: fix packaging for new naming scheme.

9 years agoNEWS: updates.
Gwenole Beauchesne [Mon, 28 Jul 2014 09:52:06 +0000 (11:52 +0200)]
NEWS: updates.

9 years agoconfigure: mark support for GStreamer < 1.2 as deprecated.
Gwenole Beauchesne [Mon, 28 Jul 2014 09:39:11 +0000 (11:39 +0200)]
configure: mark support for GStreamer < 1.2 as deprecated.

Supporting anything thing below GStreamer 1.2 is asking for trouble
for keeping up with the required facilities to make efficient pipelines.
Users are invited to upgrade to the very latest GStreamer 1.2.x release,
at the minimum.

9 years agoconfigure: mark support for GStreamer 0.10 as obsolete.
Gwenole Beauchesne [Mon, 28 Jul 2014 09:35:24 +0000 (11:35 +0200)]
configure: mark support for GStreamer 0.10 as obsolete.

Support for GStreamer 0.10 is obsolete. i.e. it is no longer supported
and may actually be removed altogether for a future release. There is
no real point to maintain a build for such an ancient GStreamer version
that is not even supported upstream.

9 years agovaapisink: allow a specific view component to be displayed.
Gwenole Beauchesne [Mon, 28 Jul 2014 08:25:26 +0000 (10:25 +0200)]
vaapisink: allow a specific view component to be displayed.

If a multiview stream is decoded, multiple view components are submitted
as is downstream. It is the responsibility of the sink element to display
the required view components. By default, always select the frame buffer
that matches the view-id of the very first frame to be displayed.

However, introduce a "view-id" property to allow the selection of a
specific view component of interest to display.

9 years agovaapisink: always keep the last displayed buffer around.
Gwenole Beauchesne [Mon, 28 Jul 2014 08:09:34 +0000 (10:09 +0200)]
vaapisink: always keep the last displayed buffer around.

Always record the VA surface that is currently being rendered, no matter
the fact we are using texturedblit or overlay. That's because in some
occasions, we need to refresh or resize the displayed contents based on
new events. e.g. user-resized window.

Besides, it's simpler to track the last video buffer in GstVaapiSink than
through the base sink "last-sample".

9 years agovaapisink: add support for "display-name" property.
Gwenole Beauchesne [Fri, 25 Jul 2014 09:13:29 +0000 (11:13 +0200)]
vaapisink: add support for "display-name" property.

Add a "display-name" property to vaapisink so that the end user could
select the desired output. Keep "display-name" in-line with the existing
"display" (GstVaapiDisplayXXX type).

So, for X11 or GLX, the "display-name" is the usual display name as we
know for XOpenDisplay(); for Wayland, the "display-name" is the name used
for wl_display_connect(); and for DRM, the "display-name" is actually the
DRI device name.

https://bugzilla.gnome.org/show_bug.cgi?id=722247

9 years agowindow: make gst_vaapi_window_reconfigure() thread-safe.
Gwenole Beauchesne [Fri, 25 Jul 2014 15:29:40 +0000 (17:29 +0200)]
window: make gst_vaapi_window_reconfigure() thread-safe.

Ensure the X11 implementation for GstVaapiWindow::get_geometry() is
thread-safe by default, so that upper layer users don't need to handle
that explicitly.

9 years agowindow: allow for updating size from current geometry.
Holger Kaelberer [Mon, 29 Jul 2013 07:28:28 +0000 (09:28 +0200)]
window: allow for updating size from current geometry.

Add gst_vaapi_window_reconfigure() interface to force an update of
the GstVaapiWindow "soft" size, based on the current geometry of the
underlying native window.

This can be useful for instance to synchronize the window size when
the user changed it.

Thanks to Fabrice Bellet for rebasing the patch.

[changed interface to gst_vaapi_window_reconfigure()]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agowindow: re-indent all GstVaapiWindow related source code.
Gwenole Beauchesne [Fri, 25 Jul 2014 14:53:41 +0000 (16:53 +0200)]
window: re-indent all GstVaapiWindow related source code.

9 years agodisplay: add interface to retrieve the display name.
Gwenole Beauchesne [Fri, 25 Jul 2014 09:24:39 +0000 (11:24 +0200)]
display: add interface to retrieve the display name.

Add gst_vaapi_display_get_display_name() helper function to determine
the name associated with the underlying native display. Note that for
raw DRM backends, the display name is actually the device path.