schro: Fix compilation with 1.0.10

This commit is contained in:
Robert Swain 2012-02-01 02:13:48 +01:00 committed by Robert Swain
parent 521e8b199b
commit 73a8c272c0
4 changed files with 17 additions and 4 deletions

View file

@ -313,11 +313,13 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
ret = schro_parse_decode_sequence_header (data + 13, size - 13, ret = schro_parse_decode_sequence_header (data + 13, size - 13,
&video_format); &video_format);
if (ret) { if (ret) {
#if SCHRO_CHECK_VERSION(1,0,11)
int bit_depth; int bit_depth;
bit_depth = schro_video_format_get_bit_depth (&video_format); bit_depth = schro_video_format_get_bit_depth (&video_format);
if (bit_depth == 8) { if (bit_depth == 8) {
#endif
if (video_format.chroma_format == SCHRO_CHROMA_444) { if (video_format.chroma_format == SCHRO_CHROMA_444) {
state->format = GST_VIDEO_FORMAT_AYUV; state->format = GST_VIDEO_FORMAT_AYUV;
} else if (video_format.chroma_format == SCHRO_CHROMA_422) { } 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) { } else if (video_format.chroma_format == SCHRO_CHROMA_420) {
state->format = GST_VIDEO_FORMAT_I420; state->format = GST_VIDEO_FORMAT_I420;
} }
#if SCHRO_CHECK_VERSION(1,0,11)
} else if (bit_depth <= 10) { } else if (bit_depth <= 10) {
state->format = GST_VIDEO_FORMAT_v210; state->format = GST_VIDEO_FORMAT_v210;
} else if (bit_depth <= 16) { } 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); GST_ERROR ("bit depth too large (%d > 16)", bit_depth);
state->format = GST_VIDEO_FORMAT_AYUV64; state->format = GST_VIDEO_FORMAT_AYUV64;
} }
#endif
state->fps_n = video_format.frame_rate_numerator; state->fps_n = video_format.frame_rate_numerator;
state->fps_d = video_format.frame_rate_denominator; state->fps_d = video_format.frame_rate_denominator;
GST_DEBUG_OBJECT (schro_dec, "Frame rate is %d/%d", state->fps_n, GST_DEBUG_OBJECT (schro_dec, "Frame rate is %d/%d", state->fps_n,

View file

@ -271,18 +271,24 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
switch (state->format) { switch (state->format) {
case GST_VIDEO_FORMAT_I420: case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_YV12:
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y42B: case GST_VIDEO_FORMAT_Y42B:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_420; schro_enc->video_format->chroma_format = SCHRO_CHROMA_420;
break; break;
case GST_VIDEO_FORMAT_YUY2: case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_UYVY: case GST_VIDEO_FORMAT_UYVY:
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_v216: case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_v210: case GST_VIDEO_FORMAT_v210:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_422; schro_enc->video_format->chroma_format = SCHRO_CHROMA_422;
break; break;
case GST_VIDEO_FORMAT_AYUV: case GST_VIDEO_FORMAT_AYUV:
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y444: case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_AYUV64: case GST_VIDEO_FORMAT_AYUV64:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_444; schro_enc->video_format->chroma_format = SCHRO_CHROMA_444;
break; break;
case GST_VIDEO_FORMAT_ARGB: 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_numerator = state->par_n;
schro_enc->video_format->aspect_ratio_denominator = state->par_d; schro_enc->video_format->aspect_ratio_denominator = state->par_d;
#if SCHRO_CHECK_VERSION(1,0,11)
switch (state->format) { switch (state->format) {
default: default:
#endif
schro_video_format_set_std_signal_range (schro_enc->video_format, schro_video_format_set_std_signal_range (schro_enc->video_format,
SCHRO_SIGNAL_RANGE_8BIT_VIDEO); SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
#if SCHRO_CHECK_VERSION(1,0,11)
break; break;
case GST_VIDEO_FORMAT_v210: case GST_VIDEO_FORMAT_v210:
schro_video_format_set_std_signal_range (schro_enc->video_format, 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; schro_enc->video_format->chroma_excursion = 224 << 8;
break; break;
} }
#endif
schro_video_format_set_std_colour_spec (schro_enc->video_format, schro_video_format_set_std_colour_spec (schro_enc->video_format,
SCHRO_COLOUR_SPEC_HDTV); SCHRO_COLOUR_SPEC_HDTV);

View file

@ -72,6 +72,7 @@ gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width,
frame = frame =
schro_frame_new_from_data_AYUV (GST_BUFFER_DATA (buf), width, height); schro_frame_new_from_data_AYUV (GST_BUFFER_DATA (buf), width, height);
break; break;
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y42B: case GST_VIDEO_FORMAT_Y42B:
frame = frame =
schro_frame_new_from_data_Y42B (GST_BUFFER_DATA (buf), width, height); 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 = frame =
schro_frame_new_from_data_v216 (GST_BUFFER_DATA (buf), width, height); schro_frame_new_from_data_v216 (GST_BUFFER_DATA (buf), width, height);
break; break;
#ifdef SCHRO_FRAME_FORMAT_AY64
/* Added in 1.0.11 */
case GST_VIDEO_FORMAT_AYUV64: case GST_VIDEO_FORMAT_AYUV64:
frame = frame =
schro_frame_new_from_data_AY64 (GST_BUFFER_DATA (buf), width, height); schro_frame_new_from_data_AY64 (GST_BUFFER_DATA (buf), width, height);

View file

@ -24,10 +24,10 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include <schroedinger/schro.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 }" #define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64 }"
#else #else
#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444 }" #define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV }"
#endif #endif
SchroFrame * SchroFrame *