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,
&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,

View file

@ -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);

View file

@ -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);

View file

@ -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 *