[gst-devel] GstVideoScale
wl2776
wl2776 at gmail.com
Thu Apr 22 10:54:24 CEST 2010
Igor Mironchick wrote:
>
> Can anybody point me up to the GstVideoScale usage example?
>
/* The following creates a new bin and all necessary elements, puts all
elements into the bin and adds it to a player pipeline (m_player).
We are in the middle of the pipeline creation, now we have a pad from an
uridecodebin, whos uri=file:///path/to/dvvideo_file.avi
*/
// create all elements
GstElement *vbin=gst_bin_new("vbin");
GstElement *vqueue=gst_element_factory_make("queue","vqueue");
GstElement *ffcsp=gst_element_factory_make("ffmpegcolorspace","ffcsp");
GstElement *vscale=gst_element_factory_make("videoscale","vscale");
if(!m_videosink){
m_videosink=gst_element_factory_make("autovideosink","video-sink");
// there is also gconfvideosink
}
// check if all created
if(vbin && vqueue && ffcsp && vscale && m_videosink){
// all created - put the stuff to the vbin
gst_bin_add_many(GST_BIN(vbin),vqueue,ffcsp,vscale,m_videosink,NULL);
if(gst_element_link_many(vqueue,ffcsp ,vscale,m_videosink,NULL)){
// all created, put to the bin and linked - add the ghost pad to the bin,
so it can be used as
// a single opaque object
GstPad *v_pad=gst_element_get_static_pad(vqueue,"sink");
gst_element_add_pad (vbin, gst_ghost_pad_new ("sink", v_pad));
gst_object_unref (GST_OBJECT (v_pad));
//ghostpad is successfully created - add the vbin to the pipeline
gst_bin_add(GST_BIN(m_player),vbin);
// and link to the already created pad.
// first - obtain the pad
v_pad=gst_element_get_static_pad(vbin,"sink");
// second - link it to the "pad"
gst_pad_link(pad,v_pad);
gst_object_unref (GST_OBJECT (v_pad));
m_video_present=1;
}else{
return_error();
}
}else{
return_error();
}
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/GstVideoScale-tp2020221p2020246.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list