diff options
author | Vincent Penquerc'h | 2012-11-23 07:33:17 -0600 |
---|---|---|
committer | Nikhil Devshatwar | 2013-05-15 05:35:47 -0500 |
commit | 400913b67573a9f78db74cbb3427cbd9ef10a49a (patch) | |
tree | 9c86eefc2af181035dc62e608da8659d8162c509 | |
parent | 497a5ce5a24068c5f6d36f0d2cbb1999bc87edc2 (diff) | |
download | gst-plugins-base0-10-400913b67573a9f78db74cbb3427cbd9ef10a49a.tar.gz gst-plugins-base0-10-400913b67573a9f78db74cbb3427cbd9ef10a49a.tar.xz gst-plugins-base0-10-400913b67573a9f78db74cbb3427cbd9ef10a49a.zip |
xvimagesink: fix display of cropped buffers from ducati
I suspect this is needed to work around some bug in the lower
layers (X or drivers), but do not know X enough to tell.
-rw-r--r-- | sys/xvimage/xvimagesink.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index b2103589a..b1a6b1d7e 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c | |||
@@ -861,14 +861,12 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, | |||
861 | if (crop == NULL) { | 861 | if (crop == NULL) { |
862 | disp_x = xvimagesink->disp_x; | 862 | disp_x = xvimagesink->disp_x; |
863 | disp_y = xvimagesink->disp_y; | 863 | disp_y = xvimagesink->disp_y; |
864 | disp_width = xvimagesink->disp_width; | ||
865 | disp_height = xvimagesink->disp_height; | ||
866 | } else { | 864 | } else { |
867 | disp_x = xvimagesink->disp_x + gst_video_crop_left (crop); | 865 | disp_x = xvimagesink->disp_x + gst_video_crop_left (crop); |
868 | disp_y = xvimagesink->disp_y + gst_video_crop_top (crop); | 866 | disp_y = xvimagesink->disp_y + gst_video_crop_top (crop); |
869 | disp_width = gst_video_crop_width (crop); | ||
870 | disp_height = gst_video_crop_height (crop); | ||
871 | } | 867 | } |
868 | disp_width = xvimagesink->disp_width; | ||
869 | disp_height = xvimagesink->disp_height; | ||
872 | 870 | ||
873 | /* We scale to the window's geometry */ | 871 | /* We scale to the window's geometry */ |
874 | #ifdef HAVE_XSHM | 872 | #ifdef HAVE_XSHM |
@@ -884,7 +882,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, | |||
884 | xvimagesink->xwindow->win, | 882 | xvimagesink->xwindow->win, |
885 | xvimagesink->xwindow->gc, xvimage->xvimage, | 883 | xvimagesink->xwindow->gc, xvimage->xvimage, |
886 | disp_x, disp_y, disp_width, disp_height, | 884 | disp_x, disp_y, disp_width, disp_height, |
887 | result.x, result.y, result.w, result.h, FALSE); | 885 | 0, 0, disp_width, disp_height, FALSE); |
888 | } else | 886 | } else |
889 | #endif /* HAVE_XSHM */ | 887 | #endif /* HAVE_XSHM */ |
890 | { | 888 | { |
@@ -892,8 +890,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, | |||
892 | xvimagesink->xcontext->xv_port_id, | 890 | xvimagesink->xcontext->xv_port_id, |
893 | xvimagesink->xwindow->win, | 891 | xvimagesink->xwindow->win, |
894 | xvimagesink->xwindow->gc, xvimage->xvimage, | 892 | xvimagesink->xwindow->gc, xvimage->xvimage, |
895 | disp_x, disp_y, disp_width, disp_height, | 893 | disp_x, disp_y, disp_width, disp_height, 0, 0, disp_width, disp_height); |
896 | result.x, result.y, result.w, result.h); | ||
897 | } | 894 | } |
898 | 895 | ||
899 | XSync (xvimagesink->xcontext->disp, FALSE); | 896 | XSync (xvimagesink->xcontext->disp, FALSE); |
@@ -2492,10 +2489,19 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event) | |||
2492 | height = GST_VIDEO_SINK_HEIGHT (xvimagesink) - top; | 2489 | height = GST_VIDEO_SINK_HEIGHT (xvimagesink) - top; |
2493 | } | 2490 | } |
2494 | 2491 | ||
2492 | g_mutex_lock (xvimagesink->flow_lock); | ||
2493 | g_mutex_lock (xvimagesink->x_lock); | ||
2494 | |||
2495 | if (xvimagesink->crop_rect) | 2495 | if (xvimagesink->crop_rect) |
2496 | gst_video_crop_unref (xvimagesink->crop_rect); | 2496 | gst_video_crop_unref (xvimagesink->crop_rect); |
2497 | xvimagesink->crop_rect = gst_video_crop_new (top, left, width, height); | 2497 | xvimagesink->crop_rect = gst_video_crop_new (top, left, width, height); |
2498 | 2498 | ||
2499 | XResizeWindow (xvimagesink->xcontext->disp, xvimagesink->xwindow->win, | ||
2500 | width, height); | ||
2501 | |||
2502 | g_mutex_unlock (xvimagesink->x_lock); | ||
2503 | g_mutex_unlock (xvimagesink->flow_lock); | ||
2504 | |||
2499 | structure = gst_structure_new ("video-size-crop", "width", G_TYPE_INT, | 2505 | structure = gst_structure_new ("video-size-crop", "width", G_TYPE_INT, |
2500 | width, "height", G_TYPE_INT, height, NULL); | 2506 | width, "height", G_TYPE_INT, height, NULL); |
2501 | message = gst_message_new_application (GST_OBJECT (xvimagesink), | 2507 | message = gst_message_new_application (GST_OBJECT (xvimagesink), |