Ur playbin is full in its respect, i.e. it gives u full pipe from src to sink.<div><br></div><div>How could you fit in the videoscale in that.? Just adding to the pipeline will not help.</div><div><br></div><div>Your pipe will not be going to PLAY state it self.</div>
<div><br></div><div>You have to use individual elements and add them to bin and link. Then there u can use ur scale element before the videosink.</div><div><br></div><div>--Ashwini<br><br><div class="gmail_quote">On Mon, Oct 10, 2011 at 3:11 PM, soumendra satapathy <span dir="ltr">&lt;<a href="mailto:soumendra.satapathy@gmail.com">soumendra.satapathy@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">OK i learnt that i have to use the videoscale element and then add the caps filter after that to specify the size but still i am facing issue :( ... It is not resizing as per the value ... <div>
<br></div><div><div class="im"><div>#include &lt;gst/gst.h&gt;</div>

<div>#include &lt;stdbool.h&gt;</div><div><br></div><div>static GMainLoop *loop;</div><div> </div><div>static void player(const char *uri)</div><div>{</div></div><div><span style="white-space:pre-wrap">        </span>GstElement *playbin,*filter,*pipeline,*videoscale;</div>


<div><span style="white-space:pre-wrap">        </span>GstCaps *caps; </div><div><span style="white-space:pre-wrap">        </span>loop = g_main_loop_new(NULL, FALSE);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>pipeline = gst_pipeline_new (&quot;pipeline&quot;);</div>


<div><span style="white-space:pre-wrap">        </span>videoscale = gst_element_factory_make (&quot;videoscale&quot;, NULL);</div><div class="im"><div><br></div><div><span style="white-space:pre-wrap">        </span>playbin = gst_element_factory_make(&quot;playbin&quot;, &quot;player&quot;);</div>


<div><br></div><div><br></div></div><div><span style="white-space:pre-wrap">        </span>filter = gst_element_factory_make (&quot;capsfilter&quot;, &quot;filter&quot;);</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>caps = gst_caps_from_string(&quot;video/x-raw-yuv, format=I420, width=200, height=100&quot;);</div>


<div><br></div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>g_object_set ((GObject*) filter, &quot;caps&quot;, caps, NULL);</div><div><span style="white-space:pre-wrap">        </span></div>

<div>//<span style="white-space:pre-wrap">        </span>g_object_set (G_OBJECT (videoscale), &quot;width&quot;, SCALE_WIDTH, NULL);</div><div>//<span style="white-space:pre-wrap">        </span>g_object_set (G_OBJECT (videoscale), &quot;height&quot;, SCALE_HEIGHT, NULL);</div>


<div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (uri)</div><div><span style="white-space:pre-wrap">                </span>g_object_set(G_OBJECT(playbin), &quot;uri&quot;, uri,NULL);</div>

<div><span style="white-space:pre-wrap">                </span></div><div><br></div><div><span style="white-space:pre-wrap">        </span>gst_bin_add_many(GST_BIN (pipeline),playbin,videoscale,filter,NULL);</div>

<div><span style="white-space:pre-wrap">        </span>gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);</div><div> </div><div><span style="white-space:pre-wrap">        </span>g_main_loop_run(loop);</div>

<div> </div><div><span style="white-space:pre-wrap">        </span>gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);</div><div><span style="white-space:pre-wrap">        </span>gst_object_unref(GST_OBJECT(caps));</div>

<div><span style="white-space:pre-wrap">        </span>gst_object_unref(GST_OBJECT(pipeline));</div><div class="im"><div>}</div><div> </div><div>int main(int argc, char *argv[])</div><div>{</div><div><span style="white-space:pre-wrap">        </span>gst_init(&amp;argc, &amp;argv);</div>


<div><span style="white-space:pre-wrap">        </span>player(argv[1]);</div><div><span style="white-space:pre-wrap">        </span>return 0;</div><div>}</div><div><br></div></div><div>Any help is highly appreciated .. </div>

<div><br></div>Rgds, </div><div>Som<div><div></div><div class="h5"><br><div class="gmail_quote">On Mon, Oct 10, 2011 at 12:36 PM, soumendra satapathy <span dir="ltr">&lt;<a href="mailto:soumendra.satapathy@gmail.com" target="_blank">soumendra.satapathy@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, <div><br></div><div><br></div><div>I have a small issue I am using the &quot;playbin&quot; element in my media-player app.</div>


<div><br></div><div>No w i wish to have control over the scale of my video, basically achieve the same funcationality as &quot;videoscale&quot;.</div>
<div><br></div><div>How do i do it ?? </div><div><br></div><div><br></div><div>Please find the code below:</div><div><br></div><div><div><span style="background-color:rgb(204, 204, 204)">#include &lt;gst/gst.h&gt;</span></div>



<div><span style="background-color:rgb(204, 204, 204)">#include &lt;stdbool.h&gt;</span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div>
<span style="background-color:rgb(204, 204, 204)">static GMainLoop *loop;</span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)">static void player(const char *uri)</span></div>



<div><span style="background-color:rgb(204, 204, 204)">{</span></div><div><span style="background-color:rgb(204, 204, 204)">        GstElement *playbin,*videosink, *audiosink,*flt;</span></div>
<div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)">        loop = g_main_loop_new(NULL, FALSE);</span></div>
<div><span style="background-color:rgb(204, 204, 204)">        playbin = gst_element_factory_make(&quot;playbin&quot;, &quot;player&quot;);</span></div><div><span style="background-color:rgb(204, 204, 204)">        videosink = gst_element_factory_make (&quot;xvimagesink&quot;, &quot;video-sink&quot;);</span></div>



<div><span style="background-color:rgb(204, 204, 204)">        audiosink = gst_element_factory_make (&quot;alsasink&quot;, &quot;audio-sink&quot;);</span></div><div><span style="background-color:rgb(204, 204, 204)"><br>
</span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)">        if (uri){</span></div>
<div><span style="background-color:rgb(204, 204, 204)">                   g_object_set(G_OBJECT(videosink),&quot;force-aspect-ratio&quot;,FALSE,NULL);</span></div><div><span style="background-color:rgb(204, 204, 204)">                   g_object_set(G_OBJECT(playbin), &quot;uri&quot;, uri,&quot;audio-sink&quot;,audiosink,&quot;video-sink&quot;, videosink,NULL);</span></div>



<div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)">                }</span></div><div><span style="background-color:rgb(204, 204, 204)"><br>
</span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)"><br>
</span></div><div><span style="background-color:rgb(204, 204, 204)">        gst_element_set_state(GST_ELEMENT(playbin), GST_STATE_PLAYING);</span></div><div><span style="background-color:rgb(204, 204, 204)"><br>
</span></div><div><span style="background-color:rgb(204, 204, 204)">        g_main_loop_run(loop);</span></div><div><span style="background-color:rgb(204, 204, 204)"><br>
</span></div><div><span style="background-color:rgb(204, 204, 204)">        gst_element_set_state(GST_ELEMENT(playbin), GST_STATE_NULL);</span></div><div><span style="background-color:rgb(204, 204, 204)">        gst_object_unref(GST_OBJECT(playbin));</span></div>



<div><span style="background-color:rgb(204, 204, 204)">}</span></div><div><span style="background-color:rgb(204, 204, 204)"><br></span></div><div><span style="background-color:rgb(204, 204, 204)">int main(int argc, char *argv[])</span></div>



<div><span style="background-color:rgb(204, 204, 204)">{</span></div><div><span style="background-color:rgb(204, 204, 204)">        gst_init(&amp;argc, &amp;argv);</span></div>
<div><span style="background-color:rgb(204, 204, 204)">        player(argv[1]);</span></div><div><span style="background-color:rgb(204, 204, 204)">        return 0;</span></div>
<div><span style="background-color:rgb(204, 204, 204)">}</span></div><div><br></div><div><br></div><div><br></div><div>I am kinda stuck .. any insight will be of real help.</div><div>Regards</div>
<div><br></div><font color="#888888">-- <br>follow me @ <a href="http://twitter.com/soum1" target="_blank">http://twitter.com/soum1</a><br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>follow me @ <a href="http://twitter.com/soum1" target="_blank">http://twitter.com/soum1</a><br>
</div></div></div>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>