[gst-devel] How to Set Buffer Size Within Plugin

Greg Wunder gwunder at eoir.com
Mon Oct 18 13:40:52 CEST 2010


Tracing the pipeline debug messages (noted below) showed that during the first fixate_caps() call, the input/output video sizes have been fixated already.
Before that in the transform_caps() calls, the video sizes range [1, 32767], until the output video size is fixated into the input video size 320x240 & then fixate_caps() is called.
I couldn't know the input video size, before the output video size has been set by the pipeline application.

Using GstBaseTransform, the two functions called before setcap() are:

1) trans_class->transform_caps = GST_DEBUG_FUNCPTR (gst_mosaick_transform_caps);
2) trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_mosaick_fixate_caps);


=====
...
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
0:00:01.046875000   888   02133EC0 WARN           basetransform gstbasetransform.c:1075:gst_base_transform_acceptcaps_default:<mosaick0> transform could not transform 02137920 in anything we support
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
gst_mosaick_transform_caps,direction=1
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/
1, 2147483647/1 ]
gst_mosaick_transform_caps,direction=2
caps=video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)320, height=(int)240, framerate=(fraction)15/1
gst_mosaick_fixate_caps
GST_PAD_SINK 2
dimensions already set to 320x240, not fixating
0:00:01.078125000   888   02133EC0 INFO         GST_PERFORMANCE imgconvert.c:3367:img_convert: no direct path to convert colorspace from bgr24 -> bgrx32






-----Original Message-----
From: Tim-Philipp Müller [mailto:t.i.m at zen.co.uk]
Sent: Fri 10/15/2010 4:09 PM
To: gstreamer-devel at lists.sourceforge.net
Subject: Re: [gst-devel] How to Set Buffer Size Within Plugin
 
On Fri, 2010-10-15 at 15:51 -0400, Greg Wunder wrote:

> Following up with one more question:
> 
> Let be more specific, on the set_cap function:
> The trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_mosaick_set_caps);

Ah, so your element is based on GstBaseTransform/GstVideoFilter - that's
useful to know.


> static gboolean
> gst_mosaick_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps
> * out)
> {
>   GstMosaick *mosaick = GST_MOSAICK (trans);
>   gboolean ret;
> 
>   ret = gst_video_format_parse_caps (in, &mosaick->format,
> &mosaick->from_width, &mosaick->from_height);
>   ret &= gst_video_format_parse_caps (out, NULL, &mosaick->to_width,
> &mosaick->to_height);
> 
> ...
> }
> 
> In the above function I can get the input video size, but the output
> is also being fixed.
> Where could you to change the output video size?

Maybe you're looking for the transform_caps virtual method?

Cheers
 -Tim




------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20101018/eb415599/attachment.htm>


More information about the gstreamer-devel mailing list