GstVideoScale

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GstVideoScale

Igor Mironchick
Hi.

Can anybody point me up to the GstVideoScale usage example?

--
Regards,
Igor Mironchick

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GstVideoScale

wl2776
Administrator
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();
}