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"><<a href="mailto:soumendra.satapathy@gmail.com">soumendra.satapathy@gmail.com</a>></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 <gst/gst.h></div>
<div>#include <stdbool.h></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 ("pipeline");</div>
<div><span style="white-space:pre-wrap">        </span>videoscale = gst_element_factory_make ("videoscale", NULL);</div><div class="im"><div><br></div><div><span style="white-space:pre-wrap">        </span>playbin = gst_element_factory_make("playbin", "player");</div>
<div><br></div><div><br></div></div><div><span style="white-space:pre-wrap">        </span>filter = gst_element_factory_make ("capsfilter", "filter");</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>caps = gst_caps_from_string("video/x-raw-yuv, format=I420, width=200, height=100");</div>
<div><br></div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>g_object_set ((GObject*) filter, "caps", 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), "width", SCALE_WIDTH, NULL);</div><div>//<span style="white-space:pre-wrap">        </span>g_object_set (G_OBJECT (videoscale), "height", 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), "uri", 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(&argc, &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"><<a href="mailto:soumendra.satapathy@gmail.com" target="_blank">soumendra.satapathy@gmail.com</a>></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 "playbin" 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 "videoscale".</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 <gst/gst.h></span></div>
<div><span style="background-color:rgb(204, 204, 204)">#include <stdbool.h></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("playbin", "player");</span></div><div><span style="background-color:rgb(204, 204, 204)"> videosink = gst_element_factory_make ("xvimagesink", "video-sink");</span></div>
<div><span style="background-color:rgb(204, 204, 204)"> audiosink = gst_element_factory_make ("alsasink", "audio-sink");</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),"force-aspect-ratio",FALSE,NULL);</span></div><div><span style="background-color:rgb(204, 204, 204)"> g_object_set(G_OBJECT(playbin), "uri", uri,"audio-sink",audiosink,"video-sink", 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(&argc, &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>