gstreamer/gst/vaapi
Víctor Manuel Jáquez Leal 9799875df4 vaapidecode: delayed src caps negotiation
Currently the src caps are set immediately after the sink caps are set, but in
that moment the pipeline might not fully constructed and the video sink has
not negotiated its supported caps and features. As a consequence, in many cases
of playback, the least optimized caps feature is forced. This is partially the
responsible of bug #744039.

Also, vaapidecode doesn't attend the reconfigure events from downstream,
which is a problem too, since the video sink can be changed with different
caps features.

This patch delays the src caps, setting them until the first frame arrives to
the decoder, assuming until that very moment the whole pipeline is already
negotiated. Particularly, it checks if the src pad needs to be reconfigured,
as a consequence of a reconfiguration event from downstream.

A key part of this patch is the new GstVaapiCapsFeature
GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED, which is returned when the src pad
doesn't have a peer yet. Also, for a better report of the caps allowed
through the src pad and its peer, this patch uses gst_pad_get_allowed_caps()
instead of gst_pad_peer_query_caps() when looking for the preferred feature.

v3: move the input_state unref to close(), since videodecoder resets at
some events such as navigation.

v4: a) the state_changed() callback replaces the input_state if the media
changed, so this case is also handled.
    b) since the parameter ref_state in gst_vaapidecode_update_src_caps() is
always the input_state, the parameter were removed.
    c) there were a lot of repeated code handling the input_state, so I
refactored it with the function gst_vaapi_decode_input_state_replace().

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-02-26 12:24:55 +02:00
..
gstvaapi.c plugins: Add VP8 Encoder 2015-02-13 13:45:32 +02:00
gstvaapidecode.c vaapidecode: delayed src caps negotiation 2015-02-26 12:24:55 +02:00
gstvaapidecode.h vaapidecode: delayed src caps negotiation 2015-02-26 12:24:55 +02:00
gstvaapidownload.c download: use GstVideoInfo facilities to build output caps. 2013-12-21 12:35:24 +01:00
gstvaapidownload.h plugins: add new base object, store display in there. 2013-12-18 16:38:57 +01:00
gstvaapiencode.c encode: Attach the codec-data to out caps only based on negotiated caps 2014-10-29 15:46:12 +02:00
gstvaapiencode.h encode: Attach the codec-data to out caps only based on negotiated caps 2014-10-29 15:46:12 +02:00
gstvaapiencode_h264.c encode: Attach the codec-data to out caps only based on negotiated caps 2014-10-29 15:46:12 +02:00
gstvaapiencode_h264.h legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
gstvaapiencode_jpeg.c plugins: Add JPEG encoder element 2015-02-04 11:18:29 +02:00
gstvaapiencode_jpeg.h plugins: Add JPEG encoder element 2015-02-04 11:18:29 +02:00
gstvaapiencode_mpeg2.c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
gstvaapiencode_mpeg2.h legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
gstvaapiencode_vp8.c plugins: Add VP8 Encoder 2015-02-13 13:45:32 +02:00
gstvaapiencode_vp8.h plugins: Add VP8 Encoder 2015-02-13 13:45:32 +02:00
gstvaapiparse.c plugins: add built-in video parsers as "vaapiparse" element. 2014-06-13 17:17:07 +02:00
gstvaapiparse.h plugins: add built-in video parsers as "vaapiparse" element. 2014-06-13 17:17:07 +02:00
gstvaapipluginbase.c plugins: upload meta only if feature and allocation 2015-02-24 15:28:26 +01:00
gstvaapipluginbase.h plugins: ensure VA display matches GL context expectations. 2015-02-24 15:20:03 +01:00
gstvaapipluginutil.c vaapidecode: delayed src caps negotiation 2015-02-26 12:24:55 +02:00
gstvaapipluginutil.h vaapidecode: delayed src caps negotiation 2015-02-26 12:24:55 +02:00
gstvaapipostproc.c plugins: add support for BGRA textures. 2015-02-24 15:20:03 +01:00
gstvaapipostproc.h plugins: re-indent all video processing related source code. 2014-11-24 14:11:35 +01:00
gstvaapisink.c vaapisink: Protect the X11 API invokations with proper locking 2014-11-27 11:20:10 +02:00
gstvaapisink.h vaapisink: add support for GstColorBalance interface. 2014-07-31 18:49:55 +02:00
gstvaapiupload.c plugins: factor out pad caps. 2013-12-18 16:38:57 +01:00
gstvaapiupload.h plugins: add new base object, store display in there. 2013-12-18 16:38:57 +01:00
gstvaapiuploader.c videopool: add optional flags for surface pool allocation. 2015-01-27 18:11:45 +01:00
gstvaapiuploader.h plugins: re-indent all video processing related source code. 2014-11-24 14:11:35 +01:00
gstvaapivideobuffer.c display: refine the meaning of display type. 2015-01-27 18:11:44 +01:00
gstvaapivideobuffer.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideobufferpool.c plugins: add initial support for EGL. 2015-02-24 15:20:03 +01:00
gstvaapivideobufferpool.h plugins: add support for dma_buf exports (v4l2src). 2015-01-28 17:36:21 +01:00
gstvaapivideocontext.c plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideocontext.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideoconverter_glx.c texture: move to core libgstvaapi base library. 2015-01-27 18:11:44 +01:00
gstvaapivideoconverter_glx.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideoconverter_x11.c plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideoconverter_x11.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideomemory.c Fix compiler warnings 2015-02-18 11:46:11 +02:00
gstvaapivideomemory.h plugins: drop leftover declaration. 2015-01-28 18:09:40 +01:00
gstvaapivideometa.c plugins: ensure VA surface is current prior to using it. 2014-11-21 15:29:33 +01:00
gstvaapivideometa.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
gstvaapivideometa_texture.c plugins: add support for GstVideoGLTextureOrientation. 2015-02-24 15:20:03 +01:00
gstvaapivideometa_texture.h plugins: re-indent all GstVaapiVideo* related source code. 2014-08-22 15:54:32 +02:00
Makefile.am plugins: add initial support for EGL. 2015-02-24 15:20:03 +01:00