[gst-devel] What's wrong with my getcaps() function?

Corentin BARON corentin.baron at inrialpes.fr
Wed Jun 7 11:42:27 CEST 2006


I should add that my plugins works fine in YUV, but I realy need to  
output RGB.

Le 7 juin 06 à 11:30, Corentin BARON a écrit :

> Hello,
>
> I'm building a video plugin and have problems with rgb output, it  
> seems there's a problem with my getcaps() function but I can't  
> figure it out. Here's my function:
>
>> static GstCaps *
>> gst_blinkysrc_getcaps(GstPad *pad)
>> {
>> 	GstCaps *capslist;
>> 	GstBlinkySrc *filter = GST_BLINKYSRC(gst_pad_get_parent(pad));
>> 	
>> 	g_print("getcaps()\n");
>> 	
>> 	capslist = gst_caps_new_empty();
>> 	
>> 	// Are we connected to a device ?
>> 	if (filter->handler != NULL && filter->buffer.image != NULL) {
>> 		// In this case we know the width/height of our video
>> 		gst_caps_append_structure(capslist,
>> 			gst_structure_new("video/x-raw-rgb",
>> 			"depth", G_TYPE_INT, 16,
>> 			"bpp", G_TYPE_INT, 16,
>> 			"endianness", G_TYPE_INT, G_BIG_ENDIAN,
>> 			"red_mask", G_TYPE_INT, 63488,
>> 			"green_mask", G_TYPE_INT, 2016,
>> 			"blue_mask", G_TYPE_INT, 31,
>> 			"width", G_TYPE_INT, filter->buffer.header.width,
>> 			"height", G_TYPE_INT, filter->buffer.header.height,
>> 			"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 			NULL));
>> 		
>> 		gst_caps_append_structure(capslist,
>> 			gst_structure_new("video/x-raw-rgb",
>> 			"depth", G_TYPE_INT, 24,
>> 			"bpp", G_TYPE_INT, 24,
>> 			"endianness", G_TYPE_INT, G_BIG_ENDIAN,
>> 			"red_mask", G_TYPE_INT, 0xff0000,
>> 			"green_mask", G_TYPE_INT, 0x00ff00,
>> 			"blue_mask", G_TYPE_INT, 0x0000ff,
>> 			"width", G_TYPE_INT, filter->buffer.header.width,
>> 			"height", G_TYPE_INT, filter->buffer.header.height,
>> 			"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 			NULL));
>> 		
>> 		gst_caps_append_structure(capslist,
>> 			gst_structure_new("video/x-raw-rgb",
>> 			"depth", G_TYPE_INT, 16,
>> 			"bpp", G_TYPE_INT, 16,
>> 			"endianness", G_TYPE_INT, G_BYTE_ORDER,
>> 			"red_mask", G_TYPE_INT, 63488,
>> 			"green_mask", G_TYPE_INT, 2016,
>> 			"blue_mask", G_TYPE_INT, 31,
>> 			"width", G_TYPE_INT, filter->buffer.header.width,
>> 			"height", G_TYPE_INT, filter->buffer.header.height,
>> 			"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 			NULL));
>> 		
>> 		gst_caps_append_structure(capslist,
>> 			gst_structure_new("video/x-raw-rgb",
>> 			"depth", G_TYPE_INT, 24,
>> 			"bpp", G_TYPE_INT, 24,
>> 			"endianness", G_TYPE_INT, G_BYTE_ORDER,
>> 			"red_mask", G_TYPE_INT, 0xff0000,
>> 			"green_mask", G_TYPE_INT, 0x00ff00,
>> 			"blue_mask", G_TYPE_INT, 0x0000ff,
>> 			"width", G_TYPE_INT, filter->buffer.header.width,
>> 			"height", G_TYPE_INT, filter->buffer.header.height,
>> 			"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 			NULL));
>> 		
>> 		gst_caps_append_structure(capslist,
>> 			gst_structure_new("video/x-raw-yuv",
>> 			"format", GST_TYPE_FOURCC, formats[FORMAT_YUV],
>> 			"width", G_TYPE_INT, filter->buffer.header.width,
>> 			"height", G_TYPE_INT, filter->buffer.header.height,
>> 			"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 			NULL));
>> 		
>> 		g_print("| given caps:\n%s\n", gst_caps_to_string(capslist));
>> 		
>> 		return capslist;
>> 	}
>> 	
>> 	gst_caps_append_structure(capslist,
>> 		gst_structure_new("video/x-raw-rgb",
>> 		"depth", G_TYPE_INT, 16,
>> 		"bpp", G_TYPE_INT, 16,
>> 		"endianess", G_TYPE_INT, G_BIG_ENDIAN,
>> 		"red_mask", G_TYPE_INT, 63488,
>> 		"green_mask", G_TYPE_INT, 2016,
>> 		"blue_mask", G_TYPE_INT, 31,
>> 		"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 		NULL));
>> 	
>> 	gst_caps_append_structure(capslist,
>> 		gst_structure_new("video/x-raw-rgb",
>> 		"depth", G_TYPE_INT, 16,
>> 		"bpp", G_TYPE_INT, 16,
>> 		"endianess", G_TYPE_INT, G_BYTE_ORDER,
>> 		"red_mask", G_TYPE_INT, 63488,
>> 		"green_mask", G_TYPE_INT, 2016,
>> 		"blue_mask", G_TYPE_INT, 31,
>> 		"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 		NULL));
>> 	
>> 	gst_caps_append_structure(capslist,
>> 		gst_structure_new("video/x-raw-yuv",
>> 		"format", GST_TYPE_FOURCC, formats[FORMAT_YUV],
>> 		"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 		NULL));
>> 	
>> 	gst_caps_append_structure(capslist,
>> 		gst_structure_new("video/x-raw-rgb",
>> 		"depth", G_TYPE_INT, 24,
>> 		"bpp", G_TYPE_INT, 24,
>> 		"endianess", G_TYPE_INT, G_BIG_ENDIAN,
>> 		"red_mask", G_TYPE_INT, 16711680,
>> 		"green_mask", G_TYPE_INT, 65280,
>> 		"blue_mask", G_TYPE_INT, 255,
>> 		"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 		NULL));
>> 	
>> 	gst_caps_append_structure(capslist,
>> 		gst_structure_new("video/x-raw-rgb",
>> 		"depth", G_TYPE_INT, 24,
>> 		"bpp", G_TYPE_INT, 24,
>> 		"endianess", G_TYPE_INT, G_BYTE_ORDER,
>> 		"red_mask", G_TYPE_INT, 16711680,
>> 		"green_mask", G_TYPE_INT, 65280,
>> 		"blue_mask", G_TYPE_INT, 255,
>> 		"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
>> 		"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0,
>> 		NULL));
>> 		
>> 	g_print("| given caps:\n%s\n", gst_caps_to_string(capslist));
>> 	
>> 	return capslist;
>> }
>
> I'm working on GStreamer 0.8.10 on Fedora Core 4 and Maemo (Nokia  
> 770 tablet).
> Thx for yourt help,
> Corentin.
>
> <corentinbaron.gpgkey>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: corentinbaron.gpgkey
Type: application/octet-stream
Size: 916 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060607/d33e5348/attachment.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060607/d33e5348/attachment.pgp>


More information about the gstreamer-devel mailing list