From ef3712b4270c02239a3bdb358a9491ea51b5bf3b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 14 Apr 2011 12:42:20 -0700 Subject: [PATCH 1/4] Revert "video: Remove the extensive checkings from switch" This reverts commit 500d14c35c656890686574e1c041fb556df17056. --- gst-libs/gst/video/video.c | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index f680c5a3a3..a369387802 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -1061,6 +1061,27 @@ gboolean gst_video_format_is_rgb (GstVideoFormat format) { switch (format) { + case GST_VIDEO_FORMAT_I420: + case GST_VIDEO_FORMAT_YV12: + case GST_VIDEO_FORMAT_YUY2: + case GST_VIDEO_FORMAT_YVYU: + case GST_VIDEO_FORMAT_UYVY: + case GST_VIDEO_FORMAT_AYUV: + case GST_VIDEO_FORMAT_Y41B: + case GST_VIDEO_FORMAT_Y42B: + case GST_VIDEO_FORMAT_Y444: + case GST_VIDEO_FORMAT_v210: + case GST_VIDEO_FORMAT_v216: + case GST_VIDEO_FORMAT_NV12: + case GST_VIDEO_FORMAT_NV21: + case GST_VIDEO_FORMAT_v308: + case GST_VIDEO_FORMAT_UYVP: + case GST_VIDEO_FORMAT_A420: + case GST_VIDEO_FORMAT_YUV9: + case GST_VIDEO_FORMAT_YVU9: + case GST_VIDEO_FORMAT_IYU1: + case GST_VIDEO_FORMAT_AYUV64: + return FALSE; case GST_VIDEO_FORMAT_RGBx: case GST_VIDEO_FORMAT_BGRx: case GST_VIDEO_FORMAT_xRGB: @@ -1121,6 +1142,24 @@ gst_video_format_is_yuv (GstVideoFormat format) case GST_VIDEO_FORMAT_IYU1: case GST_VIDEO_FORMAT_AYUV64: return TRUE; + case GST_VIDEO_FORMAT_RGBx: + case GST_VIDEO_FORMAT_BGRx: + case GST_VIDEO_FORMAT_xRGB: + case GST_VIDEO_FORMAT_xBGR: + case GST_VIDEO_FORMAT_RGBA: + case GST_VIDEO_FORMAT_BGRA: + case GST_VIDEO_FORMAT_ARGB: + case GST_VIDEO_FORMAT_ABGR: + case GST_VIDEO_FORMAT_RGB: + case GST_VIDEO_FORMAT_BGR: + case GST_VIDEO_FORMAT_RGB16: + case GST_VIDEO_FORMAT_BGR16: + case GST_VIDEO_FORMAT_RGB15: + case GST_VIDEO_FORMAT_BGR15: + case GST_VIDEO_FORMAT_RGB8_PALETTED: + case GST_VIDEO_FORMAT_ARGB64: + case GST_VIDEO_FORMAT_r210: + return FALSE; default: return FALSE; } @@ -1166,6 +1205,26 @@ gboolean gst_video_format_has_alpha (GstVideoFormat format) { switch (format) { + case GST_VIDEO_FORMAT_I420: + case GST_VIDEO_FORMAT_YV12: + case GST_VIDEO_FORMAT_YUY2: + case GST_VIDEO_FORMAT_YVYU: + case GST_VIDEO_FORMAT_UYVY: + case GST_VIDEO_FORMAT_Y41B: + case GST_VIDEO_FORMAT_Y42B: + case GST_VIDEO_FORMAT_Y444: + case GST_VIDEO_FORMAT_v210: + case GST_VIDEO_FORMAT_v216: + case GST_VIDEO_FORMAT_NV12: + case GST_VIDEO_FORMAT_NV21: + case GST_VIDEO_FORMAT_v308: + case GST_VIDEO_FORMAT_Y800: + case GST_VIDEO_FORMAT_Y16: + case GST_VIDEO_FORMAT_UYVP: + case GST_VIDEO_FORMAT_YUV9: + case GST_VIDEO_FORMAT_YVU9: + case GST_VIDEO_FORMAT_IYU1: + return FALSE; case GST_VIDEO_FORMAT_AYUV: case GST_VIDEO_FORMAT_RGBA: case GST_VIDEO_FORMAT_BGRA: @@ -1176,6 +1235,18 @@ gst_video_format_has_alpha (GstVideoFormat format) case GST_VIDEO_FORMAT_ARGB64: case GST_VIDEO_FORMAT_AYUV64: return TRUE; + case GST_VIDEO_FORMAT_RGBx: + case GST_VIDEO_FORMAT_BGRx: + case GST_VIDEO_FORMAT_xRGB: + case GST_VIDEO_FORMAT_xBGR: + case GST_VIDEO_FORMAT_RGB: + case GST_VIDEO_FORMAT_BGR: + case GST_VIDEO_FORMAT_RGB16: + case GST_VIDEO_FORMAT_BGR16: + case GST_VIDEO_FORMAT_RGB15: + case GST_VIDEO_FORMAT_BGR15: + case GST_VIDEO_FORMAT_r210: + return FALSE; default: return FALSE; } From 2bb91c4880b2b7d8bd7641f226c35389d3b7bb45 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 14 Apr 2011 22:13:21 +0200 Subject: [PATCH 2/4] playbin2: ensure proper PAUSED_TO_READY cleanup ... since going async to PAUSED might fail, and never making it to PAUSED subsequently skips going down to READY. Fixes #647781. --- gst/playback/gstplaybin2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 05a2294b0d..4185c38b9c 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3642,6 +3642,7 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition) { GstStateChangeReturn ret; GstPlayBin *playbin; + gboolean do_save = FALSE; playbin = GST_PLAY_BIN (element); @@ -3660,6 +3661,7 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition) } break; case GST_STATE_CHANGE_PAUSED_TO_READY: + async_down: /* FIXME unlock our waiting groups */ GST_LOG_OBJECT (playbin, "setting shutdown flag"); g_atomic_int_set (&playbin->shutdown, 1); @@ -3673,6 +3675,13 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition) GST_PLAY_BIN_DYN_UNLOCK (playbin); break; case GST_STATE_CHANGE_READY_TO_NULL: + /* we go async to PAUSED, so if that fails, we never make it to PAUSED + * an no state change PAUSED to READY passes here, + * though it is a nice-to-have ... */ + if (!g_atomic_int_get (&playbin->shutdown)) { + do_save = TRUE; + goto async_down; + } memset (&playbin->duration, 0, sizeof (playbin->duration)); /* unlock so that all groups go to NULL */ @@ -3699,6 +3708,9 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition) { guint i; + /* also do missed state change down to READY */ + if (do_save) + save_current_group (playbin); /* Deactive the groups, set the uridecodebins to NULL * and unref them. */ From 961226e0cd9cbd8c94d142763f8a1ba82f9aa9a8 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 15 Apr 2011 11:11:52 +0200 Subject: [PATCH 3/4] playbin2: avoid foregoing READY_TO_NULL when appropriate --- gst/playback/gstplaybin2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 4185c38b9c..5f0f964cd8 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3673,7 +3673,8 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition) GST_PLAY_BIN_DYN_LOCK (playbin); GST_LOG_OBJECT (playbin, "dynamic lock taken, we can continue shutdown"); GST_PLAY_BIN_DYN_UNLOCK (playbin); - break; + if (!do_save) + break; case GST_STATE_CHANGE_READY_TO_NULL: /* we go async to PAUSED, so if that fails, we never make it to PAUSED * an no state change PAUSED to READY passes here, From 08a14d45b9f9b26ad77b37d99d1ba7cf71a8924a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 15 Apr 2011 21:09:00 +0100 Subject: [PATCH 4/4] tests: list libs/struct*h files explicitly in Makefile.am Hopefully makes the gentoo buildbot happy again. --- tests/check/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index e0b159dc49..8b8782d5b6 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -171,7 +171,9 @@ VALGRIND_TO_FIX = \ noinst_PROGRAMS = $(check_libvisual) noinst_HEADERS = \ - libs/struct_*.h + libs/struct_i386.h \ + libs/struct_i386_osx.h \ + libs/struct_x86_64.h AM_CFLAGS = -I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \ $(GST_CFLAGS) $(GST_CHECK_CFLAGS) \