mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
applemedia: vtdec: fix negotiation more
Year 12: I still don't understand how negotiation works. Apparently gst_pad_query_caps doesn't do what I thought it did. To get the actual caps that can flow through vtdec:src we must call gst_pad_peer_query_caps with the template caps as filter. Fixes negotiation with stuff that doesn't understand GLMemory (hello videoscale).
This commit is contained in:
parent
94cd5316f3
commit
3d5a1ccbf4
1 changed files with 6 additions and 3 deletions
|
@ -267,7 +267,7 @@ static gboolean
|
||||||
gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstVideoCodecState *output_state = NULL;
|
GstVideoCodecState *output_state = NULL;
|
||||||
GstCaps *caps = NULL, *prevcaps = NULL;
|
GstCaps *caps = NULL, *templcaps = NULL, *prevcaps = NULL;
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const gchar *s;
|
const gchar *s;
|
||||||
|
@ -276,9 +276,12 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
vtdec = GST_VTDEC (decoder);
|
vtdec = GST_VTDEC (decoder);
|
||||||
|
templcaps =
|
||||||
|
gst_pad_get_pad_template_caps (GST_VIDEO_DECODER_SRC_PAD (decoder));
|
||||||
caps =
|
caps =
|
||||||
gst_caps_make_writable (gst_pad_query_caps (GST_VIDEO_DECODER_SRC_PAD
|
gst_caps_make_writable (gst_pad_peer_query_caps (GST_VIDEO_DECODER_SRC_PAD
|
||||||
(vtdec), NULL));
|
(vtdec), templcaps));
|
||||||
|
gst_caps_unref (templcaps);
|
||||||
context = query_gl_context (vtdec);
|
context = query_gl_context (vtdec);
|
||||||
if (!context)
|
if (!context)
|
||||||
gst_caps_filter_and_map_in_place (caps, caps_filter_out_gl_memory, NULL);
|
gst_caps_filter_and_map_in_place (caps, caps_filter_out_gl_memory, NULL);
|
||||||
|
|
Loading…
Reference in a new issue