GNOME Bugzilla – Bug 705192
videotestsrc is not work with vaapisink
Last modified: 2013-08-26 10:57:27 UTC
gst-launch-1.0 videotestsrc ! vaapisink will data abort
Created attachment 250526 [details] [review] we need filter caps before get_caps returned we need filter the caps before get_caps returned.
Since I could not reproduce that issue, can you detail a little more the actual configuration you used? e.g. libva + libva-intel-driver versions, gstreamer-vaapi version. If this is from git master (as mentioned), then the associated shasum. Thanks.
Hi Gwenole: You can see the color bar? It's not libva or libva-intel-driver related. the root case is we did not filter the video caps before we get_caps returned. And we return first caps as GST_VAAPI_SURFACE_CAPS. So VideoTestSrc will choose surfac caps as output caps. here is more details: 1. gst_vaapisink_get_caps_impl will return surface_caps as first cap static GstCaps * gst_vaapisink_get_caps_impl(GstBaseSink *base_sink) { GstVaapiSink * const sink = GST_VAAPISINK(base_sink); GstCaps *out_caps, *yuv_caps; out_caps = gst_caps_from_string(GST_VAAPI_SURFACE_CAPS); if (!out_caps) return NULL; if (gst_vaapisink_ensure_uploader(sink)) { yuv_caps = gst_vaapi_uploader_get_caps(sink->uploader); if (yuv_caps) gst_caps_append(out_caps, gst_caps_copy(yuv_caps)); } return out_caps; } 2. gst_base_src_default_negotiate expect peer return a subset of thiscaps. but it did not happed in our case. static gboolean gst_base_src_default_negotiate (GstBaseSrc * basesrc) { GstCaps *thiscaps; GstCaps *caps = NULL; GstCaps *peercaps = NULL; gboolean result = FALSE; /* first see what is possible on our source pad */ thiscaps = gst_pad_query_caps (GST_BASE_SRC_PAD (basesrc), NULL); GST_DEBUG_OBJECT (basesrc, "caps of src: %" GST_PTR_FORMAT, thiscaps); /* nothing or anything is allowed, we're done */ if (thiscaps == NULL || gst_caps_is_any (thiscaps)) goto no_nego_needed; if (G_UNLIKELY (gst_caps_is_empty (thiscaps))) goto no_caps; /* get the peer caps */ peercaps = gst_pad_peer_query_caps (GST_BASE_SRC_PAD (basesrc), thiscaps); GST_DEBUG_OBJECT (basesrc, "caps of peer: %" GST_PTR_FORMAT, peercaps); if (peercaps) { /* The result is already a subset of our caps */ caps = peercaps; gst_caps_unref (thiscaps); } else { /* no peer, work with our own caps then */ caps = thiscaps; } 3. gst_caps_fixate will choose first cap as output cap. it's surface caps. GstCaps * gst_caps_fixate (GstCaps * caps) { GstStructure *s; g_return_val_if_fail (GST_IS_CAPS (caps), NULL); /* default fixation */ caps = gst_caps_truncate (caps); caps = gst_caps_make_writable (caps); s = gst_caps_get_structure (caps, 0); gst_structure_fixate (s); return caps; }
Hi, (In reply to comment #3) > Hi Gwenole: > You can see the color bar? > It's not libva or libva-intel-driver related. the root case is we did not > filter the video caps before we get_caps returned. And we return first caps as > GST_VAAPI_SURFACE_CAPS. So VideoTestSrc will choose surfac caps as output caps. You are right. Thanks. I was only testing with explicit caps. Sorry. :) Though, I would push the variant where the first param is the caps we got from gst_vaapisink_get_caps_impl() because I want the intersection to maintain the order of those in priority.
Fixed in git master. Thanks.
commit 92a124f3065a4f05daf06c100d699b72757983bd Author: Guangxin.Xu <Guangxin.Xu@intel.com> Date: Wed Jul 31 16:49:20 2013 +0800 vaapisink: fix get_caps() implementation for GStreamer 1.0. Fix GstBaseSink::get_caps() implementation for GStreamer 1.0.X builds by honouring the filter caps argument. More precisely, this fixes the following pipeline: gst-launch-1.0 videotestsrc ! vaapisink https://bugzilla.gnome.org/show_bug.cgi?id=705192 Signed-off-by: Guangxin.Xu <Guangxin.Xu@intel.com> Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>