Cannot set caps.

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

Cannot set caps.

wl2776
Administrator
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);
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.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set caps.

Michael Joachimiak
Maybe you are not giving full caps?
What caps have you tried?

2010/9/6 wl2776 <[hidden email]>

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);

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.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Cannot-set-caps-tp2528411p2528411.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Your Sincerely
Michael Joachimiak

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set caps.

wl2776
Administrator
Michael Joachimiak wrote
Maybe you are not giving full caps?
What caps have you tried?
I tried much longer caps, anyway, return was FALSE.

I have an impression, that I shouldn't give full caps to a pad, and it fill missing values from the default.
Right?
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set caps.

Edward Hervey
Administrator
In reply to this post by wl2776
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.



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel