[MOVED FROM BAD 044/134] vp8: Use VPX_PLANE_* instead of PLANE_*
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 26 May 2010 04:52:15 +0000 (06:52 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 16 Sep 2012 13:27:14 +0000 (15:27 +0200)
ext/vp8/gstvp8dec.c
ext/vp8/gstvp8enc.c
ext/vp8/gstvp8utils.h

index 4a570f0..e1720a3 100644 (file)
@@ -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
index 8f73444..a3b2aeb 100644 (file)
@@ -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);
 
index 68652dd..e62ab8f 100644 (file)
@@ -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