[gst-devel] Getting width and height before sink instanciation
Ronald S. Bultje
rbultje at ronald.bitfreak.net
Mon Jul 18 23:54:39 CEST 2005
Hi Loic,
On Mon, 2005-07-18 at 18:15, Loïc Molinari wrote:
> I am writing a little piece of software aimed to display video streams
> on OpenGL textures. Like the GStreamer manual advices, I choose to
> write my own sink element instead of using the fakesink way. My
> class_init takes two readable properties, the width and the height.
> OpenGL needs pow2 values, so I put width and height to the pow2 upper
> values in the sink.
>
> Here is my pipeline :
> gnomevfssrc <-> decodebin <-> ffmpegcolorspace <-> videoscale <-> mysink
>
> The problem is that I need to know width and height of the stream
> before the instanciation of the sink
Why? We have a negotiation phase to decide on this whole thing.
> I tried to get caps of the elements of the decodebin element when
> the new-decoded-pad signal fired, but I could not.
Read up on how negotiation works (or could've worked :) ) in the
documentation on our website.
> Is adding a new property telling width and height destination values
> in the videoscale element a good idea ?
No. Read up on filtered caps while you're at it, too. It'll do what you
want. See e.g. gst_element_link_pads_filtered(),
gst_element_link_filtered() or gst_pad_link_filtered().
Ronald
--
Ronald S. Bultje <rbultje at ronald.bitfreak.net>
More information about the gstreamer-devel
mailing list