[gst-devel] Cannot set caps.

Edward Hervey bilboed at gmail.com
Tue Sep 7 11:56:43 CEST 2010


On Mon, 2010-09-06 at 06:52 -0700, wl2776 wrote:
> Hi all. 
> I am writing a small function, making screenshots. 
> I have studied several examples already, and now I'm trying to copy them to
> my application.
> 
> My function gets the last displayed buffer from the videosink, then builds
> the pipeline:
> appsrc -> ffmpegcolorspace -> videoscale -> encoder -> filesink
> 
> I have to save the screenshot to one of several formats, so I use one of
> several encoders: jpegenc, ffenc_bmp, pngenc, ffenc_tiff.
> All elements are created and added to the pipeline.
> 
> The problem is that my function cannot set caps on the encoder's sink pad.
> Even following simple statements return false:
> caps=gst_caps_from_string("video/x-raw-rgb"
>   			    ",bpp=24,depth=24"
> 			 );
> pad=gst_element_get_static_pad(enc,"sink");
> rb=gst_pad_set_caps(pad,caps);

  gst_pad_set_caps() must not be used from applications.

  If you wish to restrict/specify the caps flowing between two elements,
insert a capsfilter element.

    Edward

> 
> rb is always 0 (FALSE)
> 
> However, I need this, because my function also has to scale the screenshot,
> if new width and height are given.






More information about the gstreamer-devel mailing list