From 879b0b7ac0d82cfaccb1b1ba8c8fd61c3be1f3d0 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 20 Jan 2004 09:25:51 +0000 Subject: [PATCH] sys/ximage/ximagesink.c: Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, ... Original commit message from CVS: * sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents), (gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps), (gst_ximagesink_set_xwindow_id): Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, and neither is 100+, most likely. * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), (gst_xvimagesink_getcaps): same --- ChangeLog | 10 ++++++++++ sys/ximage/ximagesink.c | 20 ++++++++++---------- sys/xvimage/xvimagesink.c | 6 +++--- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7b59534fe..915d96e707 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-01-20 David Schleef + + * sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents), + (gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps), + (gst_ximagesink_set_xwindow_id): Change to using a framerate + of [1,100] instead of [0,MAX], since 0 isn't handled correctly, + and neither is 100+, most likely. + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), + (gst_xvimagesink_getcaps): same + 2004-01-19 Benjamin Otte * configure.ac: diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 2a31436e29..941d96b28c 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -342,15 +342,15 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad) "red_mask", G_TYPE_INT, ximagesink->xcontext->visual->red_mask, "green_mask", G_TYPE_INT, ximagesink->xcontext->visual->green_mask, "blue_mask", G_TYPE_INT, ximagesink->xcontext->visual->blue_mask, - "width", G_TYPE_INT, e.xconfigure.width & ~3, - "height", G_TYPE_INT, e.xconfigure.height & ~3, + "width", G_TYPE_INT, e.xconfigure.width, + "height", G_TYPE_INT, e.xconfigure.height, "framerate", G_TYPE_DOUBLE, ximagesink->framerate, NULL)); if ( (r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE) ) { - GST_VIDEOSINK_WIDTH (ximagesink) = e.xconfigure.width & ~3; - GST_VIDEOSINK_HEIGHT (ximagesink) = e.xconfigure.height & ~3; + GST_VIDEOSINK_WIDTH (ximagesink) = e.xconfigure.width; + GST_VIDEOSINK_HEIGHT (ximagesink) = e.xconfigure.height; if ( (ximagesink->ximage) && ( (GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->ximage->width) || @@ -521,7 +521,7 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink) "blue_mask", G_TYPE_INT, xcontext->visual->blue_mask, "width", GST_TYPE_INT_RANGE, 0, G_MAXINT, "height", GST_TYPE_INT_RANGE, 0, G_MAXINT, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, + "framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0, NULL); g_mutex_unlock (ximagesink->x_lock); @@ -587,7 +587,7 @@ gst_ximagesink_getcaps (GstPad *pad) return gst_caps_copy (ximagesink->xcontext->caps); return gst_caps_from_string ("video/x-raw-rgb, " - "framerate = (double) [ 0, MAX ], " + "framerate = (double) [ 1, 100 ], " "width = (int) [ 0, MAX ], " "height = (int) [ 0, MAX ]"); } @@ -1013,16 +1013,16 @@ gst_ximagesink_set_xwindow_id (GstXOverlay *overlay, XID xwindow_id) "red_mask", G_TYPE_INT, ximagesink->xcontext->visual->red_mask, "green_mask", G_TYPE_INT, ximagesink->xcontext->visual->green_mask, "blue_mask", G_TYPE_INT, ximagesink->xcontext->visual->blue_mask, - "width", G_TYPE_INT, xwindow->width & ~3, - "height", G_TYPE_INT, xwindow->height & ~3, + "width", G_TYPE_INT, xwindow->width, + "height", G_TYPE_INT, xwindow->height, "framerate", G_TYPE_DOUBLE, ximagesink->framerate, NULL)); /* If caps nego succeded updating our size */ if ( (r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE) ) { - GST_VIDEOSINK_WIDTH (ximagesink) = xwindow->width & ~3; - GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height & ~3; + GST_VIDEOSINK_WIDTH (ximagesink) = xwindow->width; + GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height; } } } diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 5b39fad082..8962606513 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -559,7 +559,7 @@ gst_xvimagesink_get_xv_support (GstXContext *xcontext) "red_mask", G_TYPE_INT, formats[i].blue_mask, "width", GST_TYPE_INT_RANGE, 0, G_MAXINT, "height", GST_TYPE_INT_RANGE, 0, G_MAXINT, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, + "framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0, NULL); /* For RGB caps we store them and the image @@ -585,7 +585,7 @@ gst_xvimagesink_get_xv_support (GstXContext *xcontext) "format", GST_TYPE_FOURCC,formats[i].id, "width", GST_TYPE_INT_RANGE, 0, G_MAXINT, "height", GST_TYPE_INT_RANGE, 0, G_MAXINT, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, + "framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0, NULL); break; default: @@ -863,7 +863,7 @@ gst_xvimagesink_getcaps (GstPad *pad) return gst_caps_from_string( "video/x-raw-rgb, " - "framerate = (double) [ 0, MAX ], " + "framerate = (double) [ 1.0, 100.0 ], " "width = (int) [ 0, MAX ], " "height = (int) [ 0, MAX ]; " "video/x-raw-yuv, "