gst-plugins-bad: schro: Fix compilation with 1.0.10

Robert Swain robswain at kemper.freedesktop.org
Tue Jan 31 17:16:28 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: 73a8c272c0d3a61aab75b9aa653fba7aa51b772f
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=73a8c272c0d3a61aab75b9aa653fba7aa51b772f

Author: Robert Swain <robert.swain at gmail.com>
Date:   Wed Feb  1 02:13:48 2012 +0100

schro: Fix compilation with 1.0.10

---

 ext/schroedinger/gstschrodec.c   |    4 ++++
 ext/schroedinger/gstschroenc.c   |   10 ++++++++++
 ext/schroedinger/gstschroutils.c |    3 +--
 ext/schroedinger/gstschroutils.h |    4 ++--
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c
index 030298e..782788a 100644
--- a/ext/schroedinger/gstschrodec.c
+++ b/ext/schroedinger/gstschrodec.c
@@ -313,11 +313,13 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
   ret = schro_parse_decode_sequence_header (data + 13, size - 13,
       &video_format);
   if (ret) {
+#if SCHRO_CHECK_VERSION(1,0,11)
     int bit_depth;
 
     bit_depth = schro_video_format_get_bit_depth (&video_format);
 
     if (bit_depth == 8) {
+#endif
       if (video_format.chroma_format == SCHRO_CHROMA_444) {
         state->format = GST_VIDEO_FORMAT_AYUV;
       } else if (video_format.chroma_format == SCHRO_CHROMA_422) {
@@ -325,6 +327,7 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
       } else if (video_format.chroma_format == SCHRO_CHROMA_420) {
         state->format = GST_VIDEO_FORMAT_I420;
       }
+#if SCHRO_CHECK_VERSION(1,0,11)
     } else if (bit_depth <= 10) {
       state->format = GST_VIDEO_FORMAT_v210;
     } else if (bit_depth <= 16) {
@@ -333,6 +336,7 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
       GST_ERROR ("bit depth too large (%d > 16)", bit_depth);
       state->format = GST_VIDEO_FORMAT_AYUV64;
     }
+#endif
     state->fps_n = video_format.frame_rate_numerator;
     state->fps_d = video_format.frame_rate_denominator;
     GST_DEBUG_OBJECT (schro_dec, "Frame rate is %d/%d", state->fps_n,
diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c
index 7ed96b3..9c00177 100644
--- a/ext/schroedinger/gstschroenc.c
+++ b/ext/schroedinger/gstschroenc.c
@@ -271,18 +271,24 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
   switch (state->format) {
     case GST_VIDEO_FORMAT_I420:
     case GST_VIDEO_FORMAT_YV12:
+#if SCHRO_CHECK_VERSION(1,0,11)
     case GST_VIDEO_FORMAT_Y42B:
+#endif
       schro_enc->video_format->chroma_format = SCHRO_CHROMA_420;
       break;
     case GST_VIDEO_FORMAT_YUY2:
     case GST_VIDEO_FORMAT_UYVY:
+#if SCHRO_CHECK_VERSION(1,0,11)
     case GST_VIDEO_FORMAT_v216:
     case GST_VIDEO_FORMAT_v210:
+#endif
       schro_enc->video_format->chroma_format = SCHRO_CHROMA_422;
       break;
     case GST_VIDEO_FORMAT_AYUV:
+#if SCHRO_CHECK_VERSION(1,0,11)
     case GST_VIDEO_FORMAT_Y444:
     case GST_VIDEO_FORMAT_AYUV64:
+#endif
       schro_enc->video_format->chroma_format = SCHRO_CHROMA_444;
       break;
     case GST_VIDEO_FORMAT_ARGB:
@@ -305,10 +311,13 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
   schro_enc->video_format->aspect_ratio_numerator = state->par_n;
   schro_enc->video_format->aspect_ratio_denominator = state->par_d;
 
+#if SCHRO_CHECK_VERSION(1,0,11)
   switch (state->format) {
     default:
+#endif
       schro_video_format_set_std_signal_range (schro_enc->video_format,
           SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
+#if SCHRO_CHECK_VERSION(1,0,11)
       break;
     case GST_VIDEO_FORMAT_v210:
       schro_video_format_set_std_signal_range (schro_enc->video_format,
@@ -322,6 +331,7 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
       schro_enc->video_format->chroma_excursion = 224 << 8;
       break;
   }
+#endif
 
   schro_video_format_set_std_colour_spec (schro_enc->video_format,
       SCHRO_COLOUR_SPEC_HDTV);
diff --git a/ext/schroedinger/gstschroutils.c b/ext/schroedinger/gstschroutils.c
index 99a22c8..5ee2317 100644
--- a/ext/schroedinger/gstschroutils.c
+++ b/ext/schroedinger/gstschroutils.c
@@ -72,6 +72,7 @@ gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width,
       frame =
           schro_frame_new_from_data_AYUV (GST_BUFFER_DATA (buf), width, height);
       break;
+#if SCHRO_CHECK_VERSION(1,0,11)
     case GST_VIDEO_FORMAT_Y42B:
       frame =
           schro_frame_new_from_data_Y42B (GST_BUFFER_DATA (buf), width, height);
@@ -88,8 +89,6 @@ gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width,
       frame =
           schro_frame_new_from_data_v216 (GST_BUFFER_DATA (buf), width, height);
       break;
-#ifdef SCHRO_FRAME_FORMAT_AY64
-      /* Added in 1.0.11 */
     case GST_VIDEO_FORMAT_AYUV64:
       frame =
           schro_frame_new_from_data_AY64 (GST_BUFFER_DATA (buf), width, height);
diff --git a/ext/schroedinger/gstschroutils.h b/ext/schroedinger/gstschroutils.h
index a9924a6..c1d06c5 100644
--- a/ext/schroedinger/gstschroutils.h
+++ b/ext/schroedinger/gstschroutils.h
@@ -24,10 +24,10 @@
 #include <gst/video/video.h>
 #include <schroedinger/schro.h>
 
-#ifdef SCHRO_FRAME_FORMAT_AY64
+#if SCHRO_CHECK_VERSION(1,0,11)
 #define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64 }"
 #else
-#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444 }"
+#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV }"
 #endif
 
 SchroFrame *



More information about the gstreamer-commits mailing list