diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2005-09-09 17:53:47 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2005-09-09 17:53:47 +0000 |
commit | 0f4fa24d8e3b39b4111c5af88e7302c608c5707e (patch) | |
tree | 2b2f591f80e279ec7ef95df15c91312123727757 /sys | |
parent | 09c75de7cc45dc5c5102afa6e75e12cc9bf79d10 (diff) |
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ximage/ximagesink.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index caee628f..8e6c41b5 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -635,6 +635,11 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink) GST_VIDEO_SINK_HEIGHT (ximagesink) != ximagesink->xwindow->height) { GstCaps *caps; + GST_DEBUG_OBJECT (ximagesink, + "Window changed size to %dx%d from %dx%d. Setting desired caps", + ximagesink->xwindow->width, ximagesink->xwindow->height, + GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink)); + caps = gst_caps_new_simple ("video/x-raw-rgb", "bpp", G_TYPE_INT, ximagesink->xcontext->bpp, "depth", G_TYPE_INT, ximagesink->xcontext->depth, @@ -1049,6 +1054,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) gboolean ret = TRUE; GstStructure *structure; const GValue *par; + gint new_width, new_height; ximagesink = GST_XIMAGESINK (bsink); @@ -1060,12 +1066,25 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) GST_PTR_FORMAT, ximagesink->xcontext->caps, caps); structure = gst_caps_get_structure (caps, 0); + +/* We used to only get the new width and height if we don't + * yet have one, which means GST_VIDEO_SINK_WIDTH/HEIGHT never change + * after the first buffer, which seems totally bogus. I don't understand + * why it might have been this way... + */ +#if 0 if (GST_VIDEO_SINK_WIDTH (ximagesink) == 0) { - ret &= gst_structure_get_int (structure, "width", - &(GST_VIDEO_SINK_WIDTH (ximagesink))); - ret &= gst_structure_get_int (structure, "height", - &(GST_VIDEO_SINK_HEIGHT (ximagesink))); + ret &= gst_structure_get_int (structure, "width", &new_width); + ret &= gst_structure_get_int (structure, "height", &new_height); + } else { + new_width = GST_VIDEO_SINK_WIDTH (ximagesink); + new_height = GST_VIDEO_SINK_HEIGHT (ximagesink); } +#else + ret &= gst_structure_get_int (structure, "width", &new_width); + ret &= gst_structure_get_int (structure, "height", &new_height); +#endif + ret &= gst_structure_get_double (structure, "framerate", &ximagesink->framerate); if (!ret) @@ -1079,6 +1098,16 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) if (par && gst_value_compare (par, ximagesink->par) != GST_VALUE_EQUAL) goto wrong_aspect; + if (GST_VIDEO_SINK_WIDTH (ximagesink) != new_width || + GST_VIDEO_SINK_HEIGHT (ximagesink) != new_height) { + GST_DEBUG_OBJECT (ximagesink, "Input caps changed size %dx%d -> %dx%d", + GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink), + new_width, new_height); + } + + GST_VIDEO_SINK_WIDTH (ximagesink) = new_width; + GST_VIDEO_SINK_HEIGHT (ximagesink) = new_height; + /* Creating our window and our image */ g_assert (GST_VIDEO_SINK_WIDTH (ximagesink) > 0); g_assert (GST_VIDEO_SINK_HEIGHT (ximagesink) > 0); @@ -1349,9 +1378,11 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, GST_DEBUG_OBJECT (ximagesink, "no usable image in pool, creating ximage"); ximage = gst_ximagesink_ximage_new (ximagesink, width, height); - if (ximagesink->desired_caps) + if (ximagesink->desired_caps) { + GST_DEBUG_OBJECT (ximagesink, "Returning buffer with my desired caps %" + GST_PTR_FORMAT, ximagesink->desired_caps); gst_buffer_set_caps (GST_BUFFER (ximage), ximagesink->desired_caps); - else + } else /* fixme we have no guarantee that the ximage is actually of these caps, do we? */ gst_buffer_set_caps (GST_BUFFER (ximage), caps); |