[gst-devel] XOverlay and videoscale element

Corentin BARON corentin.baron at inrialpes.fr
Wed May 31 02:18:21 CEST 2006


Hello,

I'm trying to resize a video displayed in a GtdDrawingArea using the  
GstXOverlay interface (sdlvideosink) and the videoscale element. I'm  
trying to setup the caps in the configure event callback. The caps  
are correctly set, but the video output keeps at the same size (it  
seems that the sdlvideosink doesn't want to resize). I'm working with  
GStreamer 0.8.10 (FC4 and Nokia 770). Here's the callback function:

> static gboolean configure_event_callback(GtkWidget *widget,
> 		GdkEventConfigure *event,
> 		gpointer data) {
> 	VideoPane *vp = (VideoPane *) data;
> 	GstPad *sdlsinkpad, *scalesrcpad;
> 	GstCaps *oldcaps, *newcaps;
> 	GstStructure *structure;
> 	gint w,h;
> 	
> 	sdlsinkpad = gst_element_get_pad(vp->sdlsink, "sink");
> 	scalesrcpad = gst_element_get_pad(vp->videoscale, "src");
> 	
> 	oldcaps = gst_pad_get_negotiated_caps(sdlsinkpad);
> 	structure = gst_structure_copy(gst_caps_get_structure(oldcaps, 0));
> 	
> 	if (!gst_structure_get_int(structure, "width", &w)
> 		|| !gst_structure_get_int(structure, "height", &h)) {
> 		g_print("Could not get width/height information for pad %s\n",
> 			gst_pad_get_name(sdlsinkpad));
> 		return FALSE;
> 	}
> 	
> 	gst_structure_set(structure,
> 		"width", G_TYPE_INT, event->width, NULL);
> 	gst_structure_set(structure,
> 		"height", G_TYPE_INT, event->height, NULL);
> 	
> 	newcaps = gst_caps_new_empty();
> 	gst_caps_append_structure(newcaps, structure);
> 	
> 	gst_element_unlink(vp->videoscale, vp->sdlsink);
> 	if (gst_element_link_filtered(vp->videoscale, vp->sdlsink,  
> newcaps)) {
> 		g_print("Did link pads\n");
> 		return TRUE;
> 	} else {
> 		g_print("Can't link pads\n");
> 		return FALSE;
> 	}
> }

Is it a bug of sdlvideosink ?
-------------- 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/20060531/a12a7239/attachment.pgp>


More information about the gstreamer-devel mailing list