From: Sebastian Dröge Date: Wed, 26 May 2010 04:52:15 +0000 (+0200) Subject: [MOVED FROM BAD 044/134] vp8: Use VPX_PLANE_* instead of PLANE_* X-Git-Tag: 1.19.3~509^2~6641 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2014a7eee2d586d0f0b93c7f7d46398397f0bb0e;p=platform%2Fupstream%2Fgstreamer.git [MOVED FROM BAD 044/134] vp8: Use VPX_PLANE_* instead of PLANE_* --- diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index 4a570f0..e1720a3 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -390,7 +390,8 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img, w = MIN (w, img->w); for (i = 0; i < h; i++) - memcpy (d + i * stride, img->planes[PLANE_Y] + i * img->stride[PLANE_Y], w); + memcpy (d + i * stride, + img->planes[VPX_PLANE_Y] + i * img->stride[VPX_PLANE_Y], w); d = GST_BUFFER_DATA (buffer) + gst_video_format_get_component_offset (decoder->state.format, 1, @@ -405,14 +406,16 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img, decoder->state.width); w = MIN (w, img->w >> img->x_chroma_shift); for (i = 0; i < h; i++) - memcpy (d + i * stride, img->planes[PLANE_U] + i * img->stride[PLANE_U], w); + memcpy (d + i * stride, + img->planes[VPX_PLANE_U] + i * img->stride[VPX_PLANE_U], w); d = GST_BUFFER_DATA (buffer) + gst_video_format_get_component_offset (decoder->state.format, 2, decoder->state.width, decoder->state.height); /* Same stride, height, width as above */ for (i = 0; i < h; i++) - memcpy (d + i * stride, img->planes[PLANE_V] + i * img->stride[PLANE_V], w); + memcpy (d + i * stride, + img->planes[VPX_PLANE_V] + i * img->stride[VPX_PLANE_V], w); } static GstFlowReturn diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c index 8f73444..a3b2aeb 100644 --- a/ext/vp8/gstvp8enc.c +++ b/ext/vp8/gstvp8enc.c @@ -613,22 +613,22 @@ gst_vp8_enc_buffer_to_image (GstVP8Enc * enc, GstBuffer * buffer) image->w = image->d_w = encoder->state.width; image->h = image->d_h = encoder->state.height; - image->stride[PLANE_Y] = + image->stride[VPX_PLANE_Y] = gst_video_format_get_row_stride (encoder->state.format, 0, encoder->state.width); - image->stride[PLANE_U] = + image->stride[VPX_PLANE_U] = gst_video_format_get_row_stride (encoder->state.format, 1, encoder->state.width); - image->stride[PLANE_V] = + image->stride[VPX_PLANE_V] = gst_video_format_get_row_stride (encoder->state.format, 2, encoder->state.width); - image->planes[PLANE_Y] = + image->planes[VPX_PLANE_Y] = data + gst_video_format_get_component_offset (encoder->state.format, 0, encoder->state.width, encoder->state.height); - image->planes[PLANE_U] = + image->planes[VPX_PLANE_U] = data + gst_video_format_get_component_offset (encoder->state.format, 1, encoder->state.width, encoder->state.height); - image->planes[PLANE_V] = + image->planes[VPX_PLANE_V] = data + gst_video_format_get_component_offset (encoder->state.format, 2, encoder->state.width, encoder->state.height); diff --git a/ext/vp8/gstvp8utils.h b/ext/vp8/gstvp8utils.h index 68652dd..e62ab8f 100644 --- a/ext/vp8/gstvp8utils.h +++ b/ext/vp8/gstvp8utils.h @@ -30,6 +30,18 @@ G_BEGIN_DECLS #define VPX_IMG_FMT_I420 IMG_FMT_I420 #endif +#ifndef VPX_PLANE_Y +#define VPX_PLANE_Y PLANE_Y +#endif + +#ifndef VPX_PLANE_U +#define VPX_PLANE_U PLANE_U +#endif + +#ifndef VPX_PLANE_V +#define VPX_PLANE_V PLANE_V +#endif + const char * gst_vpx_error_name (vpx_codec_err_t status); G_END_DECLS