frameworks/base: android_native_buffer_t -> ANativeWindowBuffer

Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h
index d1ecaaf..946a0aa 100644
--- a/include/media/stagefright/HardwareAPI.h
+++ b/include/media/stagefright/HardwareAPI.h
@@ -84,7 +84,7 @@
     OMX_U32 nPortIndex;
     OMX_PTR pAppPrivate;
     OMX_BUFFERHEADERTYPE **bufferHeader;
-    const sp<android_native_buffer_t>& nativeBuffer;
+    const sp<ANativeWindowBuffer>& nativeBuffer;
 };
 
 // A pointer to this struct is passed to OMX_GetParameter when the extension
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 9928f44..e52f6d1 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -505,7 +505,7 @@
 
     // Dequeue buffers and send them to OMX
     for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
-        android_native_buffer_t *buf;
+        ANativeWindowBuffer *buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
             LOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
@@ -574,7 +574,7 @@
 }
 
 ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
-    android_native_buffer_t *buf;
+    ANativeWindowBuffer *buf;
     CHECK_EQ(mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf), 0);
 
     for (size_t i = mBuffers[kPortIndexOutput].size(); i-- > 0;) {
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 06352f4..78d13b2 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1830,7 +1830,7 @@
 
     // Dequeue buffers and send them to OMX
     for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
-        android_native_buffer_t* buf;
+        ANativeWindowBuffer* buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
             LOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
@@ -1900,7 +1900,7 @@
 
 OMXCodec::BufferInfo* OMXCodec::dequeueBufferFromNativeWindow() {
     // Dequeue the next buffer from the native window.
-    android_native_buffer_t* buf;
+    ANativeWindowBuffer* buf;
     int err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
     if (err != 0) {
       CODEC_LOGE("dequeueBuffer failed w/ error 0x%08x", err);
diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
index 31afc43..3b13476 100644
--- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp
+++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
@@ -108,7 +108,7 @@
 
 void SoftwareRenderer::render(
         const void *data, size_t size, void *platformPrivate) {
-    android_native_buffer_t *buf;
+    ANativeWindowBuffer *buf;
     int err;
     if ((err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf)) != 0) {
         LOGW("Surface::dequeueBuffer returned error %d", err);
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index e30f7bf..f9fa30e 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -504,7 +504,7 @@
     {
         int rc;
         ANativeWindow *a = anw(w);
-        struct android_native_buffer_t* anb;
+        ANativeWindowBuffer* anb;
         rc = a->dequeueBuffer(a, &anb);
         if (!rc) {
             rc = a->lockBuffer(a, anb);
@@ -527,7 +527,7 @@
     {
         ANativeWindow *a = anw(w);
         return a->queueBuffer(a,
-                  container_of(buffer, android_native_buffer_t, handle));
+                  container_of(buffer, ANativeWindowBuffer, handle));
     }
 
     static int __cancel_buffer(struct preview_stream_ops* w,
@@ -535,20 +535,20 @@
     {
         ANativeWindow *a = anw(w);
         return a->cancelBuffer(a,
-                  container_of(buffer, android_native_buffer_t, handle));
+                  container_of(buffer, ANativeWindowBuffer, handle));
     }
 
     static int __set_buffer_count(struct preview_stream_ops* w, int count)
     {
         ANativeWindow *a = anw(w);
-        return a->perform(a, NATIVE_WINDOW_SET_BUFFER_COUNT, count);
+	return native_window_set_buffer_count(a, count);
     }
 
     static int __set_buffers_geometry(struct preview_stream_ops* w,
                       int width, int height, int format)
     {
         ANativeWindow *a = anw(w);
-        return a->perform(a, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY,
+        return native_window_set_buffers_geometry(a,
                           width, height, format);
     }
 
@@ -561,13 +561,13 @@
         crop.top = top;
         crop.right = right;
         crop.bottom = bottom;
-        return a->perform(a, NATIVE_WINDOW_SET_CROP, &crop);
+        return native_window_set_crop(a, &crop);
     }
 
     static int __set_usage(struct preview_stream_ops* w, int usage)
     {
         ANativeWindow *a = anw(w);
-        return a->perform(a, NATIVE_WINDOW_SET_USAGE, usage);
+        return native_window_set_usage(a, usage);
     }
 
     static int __set_swap_interval(struct preview_stream_ops *w, int interval)