I made a mistake in identifying the situation when set_caps is called and not called.  In my original test case I'm using filesrc:<br><br>    gst-launch -m filesrc location=/usr/assets/shortie.ts ! xxxsink videowindow=0.5,0.5,1.0,1.0<br>
<br>In the above situation set_caps does not fire.  Presumably because the caps from filesrc is ANY.  If I apply a filter:<br><br>    gst-launch -m filesrc location=/usr/assets/shortie.ts ! video/mpegts ! xxxsink videowindow=0.5,0.5,1.0,1.0<br>
<br>Then set_caps fires. <br><br><br>Is it expected behaviour that feeding an element with "ANY" data bypasses set_caps irrespective of the sink pad capabilities?<br><br><br><br><div class="gmail_quote">On 25 September 2012 16:59, Atish Nazir <span dir="ltr"><<a href="mailto:gstreamer@littleworld.co.uk" target="_blank">gstreamer@littleworld.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>I'm having difficulty getting cap negotiations to work in my hardware accelerated video sink.  All my code is using GStreamer 0.10.  The sink is derived from GstBaseSink and my element can handle both video/mpegts and video/x-h264:<br>

<br>GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",<br>        GST_PAD_SINK,<br>        GST_PAD_ALWAYS,<br>        GST_STATIC_CAPS ( "video/mpegts; video/x-h264" ) );<br><br>The default mode of operation is "video/mpegts" and that works fine.  I wanted to use set_caps to determine how to set up my hardware decoder (just need to flick two flags to flip between elementary stream and transport stream) however found set_caps was never called.  Here's how it's registered:<br>

<br>static void gst_xxx_sink_class_init( GstXxxSinkClass * klass )<br>{<br>    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);<br>    GstBaseSinkClass *gstbasesink_class = GST_BASE_SINK_CLASS (klass);<br><br>    gobject_class->set_property = gst_xxx_sink_set_property;<br>

    gobject_class->get_property = gst_xxx_sink_get_property;<br>    // register dispose function to clean<br>    gobject_class->dispose = gst_xxx_sink_dispose;<br><br>    gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_xxx_sink_start);<br>

    gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_xxx_sink_stop);<br>    gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_xxx_sink_render);<br>    gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xxx_set_caps);<br>

<br>... install pad properties<br><br>    GstElementClass* gstelement_class = (GstElementClass *) klass;<br>    gst_element_class_add_pad_template( gstelement_class, gst_static_pad_template_get( &sinktemplate ) );<br>

}<br><br><br>If I change my pad template to the following:<br><br>GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",<br>        GST_PAD_SINK,<br>        GST_PAD_ALWAYS,<br>        GST_STATIC_CAPS ( "ANY" ) );<br>

<br><br>Then my set_caps fires correctly.<br><br>As a work around that's fine, but I would like to gst-inspect-0.10 to report that this is a video sink with mpegts, x-h264 capabilities rather than reporting ANY.  I'm concerned that I'm missing something fundamental in caps negotiation.<br>

<br>Thanks in advance.<br><br><br><br>
</blockquote></div><br>