summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/gui/SurfaceTextureClient.h16
-rw-r--r--include/media/stagefright/HardwareAPI.h2
-rw-r--r--include/surfaceflinger/Surface.h16
-rw-r--r--include/ui/FramebufferNativeWindow.h6
-rw-r--r--include/ui/GraphicBuffer.h12
-rw-r--r--libs/gui/Surface.cpp20
-rw-r--r--libs/gui/SurfaceTextureClient.cpp8
-rw-r--r--libs/gui/tests/SurfaceTextureClient_test.cpp18
-rw-r--r--libs/gui/tests/SurfaceTexture_test.cpp6
-rw-r--r--libs/gui/tests/Surface_test.cpp2
-rw-r--r--libs/ui/FramebufferNativeWindow.cpp16
-rw-r--r--libs/ui/GraphicBuffer.cpp8
-rw-r--r--media/libstagefright/ACodec.cpp4
-rw-r--r--media/libstagefright/OMXCodec.cpp4
-rw-r--r--media/libstagefright/colorconversion/SoftwareRenderer.cpp2
-rw-r--r--opengl/include/EGL/eglext.h2
-rw-r--r--opengl/libagl/TextureObjectManager.cpp2
-rw-r--r--opengl/libagl/TextureObjectManager.h4
-rw-r--r--opengl/libagl/egl.cpp28
-rw-r--r--opengl/libagl/texture.cpp12
-rw-r--r--opengl/libagl2/src/egl.cpp28
-rw-r--r--services/camera/libcameraservice/CameraHardwareInterface.h14
-rw-r--r--services/surfaceflinger/TextureManager.cpp2
-rw-r--r--services/surfaceflinger/tests/surface/surface.cpp2
24 files changed, 117 insertions, 117 deletions
diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h
index 61ccbcb..c77bc4c 100644
--- a/include/gui/SurfaceTextureClient.h
+++ b/include/gui/SurfaceTextureClient.h
@@ -45,20 +45,20 @@ private:
SurfaceTextureClient(const SurfaceTextureClient& rhs);
// ANativeWindow hooks
- static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
- static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
- static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
+ static int cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
+ static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
+ static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
static int perform(ANativeWindow* window, int operation, ...);
static int query(const ANativeWindow* window, int what, int* value);
- static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
+ static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
static int setSwapInterval(ANativeWindow* window, int interval);
- int cancelBuffer(android_native_buffer_t* buffer);
- int dequeueBuffer(android_native_buffer_t** buffer);
- int lockBuffer(android_native_buffer_t* buffer);
+ int cancelBuffer(ANativeWindowBuffer* buffer);
+ int dequeueBuffer(ANativeWindowBuffer** buffer);
+ int lockBuffer(ANativeWindowBuffer* buffer);
int perform(int operation, va_list args);
int query(int what, int* value) const;
- int queueBuffer(android_native_buffer_t* buffer);
+ int queueBuffer(ANativeWindowBuffer* buffer);
int setSwapInterval(int interval);
int dispatchConnect(va_list args);
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 @@ struct UseAndroidNativeBufferParams {
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/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h
index 31f2496..ab30f45 100644
--- a/include/surfaceflinger/Surface.h
+++ b/include/surfaceflinger/Surface.h
@@ -202,17 +202,17 @@ private:
* ANativeWindow hooks
*/
static int setSwapInterval(ANativeWindow* window, int interval);
- static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
- static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
- static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
- static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
+ static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
+ static int cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
+ static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
+ static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
static int query(const ANativeWindow* window, int what, int* value);
static int perform(ANativeWindow* window, int operation, ...);
- int dequeueBuffer(android_native_buffer_t** buffer);
- int lockBuffer(android_native_buffer_t* buffer);
- int queueBuffer(android_native_buffer_t* buffer);
- int cancelBuffer(android_native_buffer_t* buffer);
+ int dequeueBuffer(ANativeWindowBuffer** buffer);
+ int lockBuffer(ANativeWindowBuffer* buffer);
+ int queueBuffer(ANativeWindowBuffer* buffer);
+ int cancelBuffer(ANativeWindowBuffer* buffer);
int query(int what, int* value) const;
int perform(int operation, va_list args);
diff --git a/include/ui/FramebufferNativeWindow.h b/include/ui/FramebufferNativeWindow.h
index 3e67f96..302d012 100644
--- a/include/ui/FramebufferNativeWindow.h
+++ b/include/ui/FramebufferNativeWindow.h
@@ -67,9 +67,9 @@ private:
friend class LightRefBase<FramebufferNativeWindow>;
~FramebufferNativeWindow(); // this class cannot be overloaded
static int setSwapInterval(ANativeWindow* window, int interval);
- static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
- static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
- static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
+ static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
+ static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
+ static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
static int query(const ANativeWindow* window, int what, int* value);
static int perform(ANativeWindow* window, int operation, ...);
diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h
index 02d6f8f..370253a 100644
--- a/include/ui/GraphicBuffer.h
+++ b/include/ui/GraphicBuffer.h
@@ -26,7 +26,7 @@
#include <utils/Flattenable.h>
#include <pixelflinger/pixelflinger.h>
-struct android_native_buffer_t;
+struct ANativeWindowBuffer;
namespace android {
@@ -38,7 +38,7 @@ class GraphicBufferMapper;
class GraphicBuffer
: public EGLNativeBase<
- android_native_buffer_t,
+ ANativeWindowBuffer,
GraphicBuffer,
LightRefBase<GraphicBuffer> >, public Flattenable
{
@@ -74,8 +74,8 @@ public:
GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage,
uint32_t stride, native_handle_t* handle, bool keepOwnership);
- // create a buffer from an existing android_native_buffer_t
- GraphicBuffer(android_native_buffer_t* buffer, bool keepOwnership);
+ // create a buffer from an existing ANativeWindowBuffer
+ GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership);
// return status
status_t initCheck() const;
@@ -94,7 +94,7 @@ public:
status_t lock(GGLSurface* surface, uint32_t usage);
status_t unlock();
- android_native_buffer_t* getNativeBuffer() const;
+ ANativeWindowBuffer* getNativeBuffer() const;
void setIndex(int index);
int getIndex() const;
@@ -149,7 +149,7 @@ private:
// If we're wrapping another buffer then this reference will make sure it
// doesn't get freed.
- sp<android_native_buffer_t> mWrappedBuffer;
+ sp<ANativeWindowBuffer> mWrappedBuffer;
};
}; // namespace android
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 812bd6a..0c5767b 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -513,25 +513,25 @@ int Surface::setSwapInterval(ANativeWindow* window, int interval) {
}
int Surface::dequeueBuffer(ANativeWindow* window,
- android_native_buffer_t** buffer) {
+ ANativeWindowBuffer** buffer) {
Surface* self = getSelf(window);
return self->dequeueBuffer(buffer);
}
int Surface::cancelBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
Surface* self = getSelf(window);
return self->cancelBuffer(buffer);
}
int Surface::lockBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
Surface* self = getSelf(window);
return self->lockBuffer(buffer);
}
int Surface::queueBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
Surface* self = getSelf(window);
return self->queueBuffer(buffer);
}
@@ -570,7 +570,7 @@ bool Surface::needNewBuffer(int bufIdx,
return newNeewBuffer;
}
-int Surface::dequeueBuffer(android_native_buffer_t** buffer)
+int Surface::dequeueBuffer(ANativeWindowBuffer** buffer)
{
status_t err = validate();
if (err != NO_ERROR)
@@ -624,7 +624,7 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer)
return err;
}
-int Surface::cancelBuffer(android_native_buffer_t* buffer)
+int Surface::cancelBuffer(ANativeWindowBuffer* buffer)
{
status_t err = validate(true);
switch (err) {
@@ -651,7 +651,7 @@ int Surface::cancelBuffer(android_native_buffer_t* buffer)
}
-int Surface::lockBuffer(android_native_buffer_t* buffer)
+int Surface::lockBuffer(ANativeWindowBuffer* buffer)
{
status_t err = validate();
if (err != NO_ERROR)
@@ -670,7 +670,7 @@ int Surface::lockBuffer(android_native_buffer_t* buffer)
return err;
}
-int Surface::queueBuffer(android_native_buffer_t* buffer)
+int Surface::queueBuffer(ANativeWindowBuffer* buffer)
{
status_t err = validate();
if (err != NO_ERROR)
@@ -969,7 +969,7 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking)
// we're intending to do software rendering from this point
setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
- android_native_buffer_t* out;
+ ANativeWindowBuffer* out;
status_t err = dequeueBuffer(&out);
LOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err));
if (err == NO_ERROR) {
@@ -1063,7 +1063,7 @@ int Surface::getBufferIndex(const sp<GraphicBuffer>& buffer) const
if (idx < 0) {
// The buffer doesn't have an index set. See if the handle the same as
// one of the buffers for which we do know the index. This can happen
- // e.g. if GraphicBuffer is used to wrap an android_native_buffer_t that
+ // e.g. if GraphicBuffer is used to wrap an ANativeWindowBuffer that
// was dequeued from an ANativeWindow.
for (size_t i = 0; i < mBuffers.size(); i++) {
if (mBuffers[i] != 0 && buffer->handle == mBuffers[i]->handle) {
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 7631449..ec6da43 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -53,25 +53,25 @@ int SurfaceTextureClient::setSwapInterval(ANativeWindow* window, int interval) {
}
int SurfaceTextureClient::dequeueBuffer(ANativeWindow* window,
- android_native_buffer_t** buffer) {
+ ANativeWindowBuffer** buffer) {
SurfaceTextureClient* c = getSelf(window);
return c->dequeueBuffer(buffer);
}
int SurfaceTextureClient::cancelBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
SurfaceTextureClient* c = getSelf(window);
return c->cancelBuffer(buffer);
}
int SurfaceTextureClient::lockBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
SurfaceTextureClient* c = getSelf(window);
return c->lockBuffer(buffer);
}
int SurfaceTextureClient::queueBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer) {
+ ANativeWindowBuffer* buffer) {
SurfaceTextureClient* c = getSelf(window);
return c->queueBuffer(buffer);
}
diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp
index db781de..753e933 100644
--- a/libs/gui/tests/SurfaceTextureClient_test.cpp
+++ b/libs/gui/tests/SurfaceTextureClient_test.cpp
@@ -113,7 +113,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryInvalidSizesFail) {
TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(1, buf->width);
EXPECT_EQ(1, buf->height);
@@ -123,7 +123,7 @@ TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) {
TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, PIXEL_FORMAT_RGB_565));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(16, buf->width);
@@ -134,7 +134,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) {
TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, PIXEL_FORMAT_RGB_565));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(1, buf->width);
@@ -145,7 +145,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) {
TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, 0));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(16, buf->width);
@@ -156,7 +156,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) {
TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, 0));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(16, buf->width);
@@ -173,7 +173,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) {
TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) {
sp<ANativeWindow> anw(mSTC);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, PIXEL_FORMAT_RGB_565));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(1, buf->width);
@@ -191,7 +191,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) {
TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) {
sp<ANativeWindow> anw(mSTC);
sp<SurfaceTexture> st(mST);
- android_native_buffer_t* buf;
+ ANativeWindowBuffer* buf;
EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf));
EXPECT_EQ(16, buf->width);
@@ -203,7 +203,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) {
TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) {
sp<ANativeWindow> anw(mSTC);
sp<SurfaceTexture> st(mST);
- android_native_buffer_t* buf[2];
+ ANativeWindowBuffer* buf[2];
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[0]));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[1]));
EXPECT_NE(buf[0], buf[1]);
@@ -224,7 +224,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) {
TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) {
sp<ANativeWindow> anw(mSTC);
sp<SurfaceTexture> st(mST);
- android_native_buffer_t* buf[2];
+ ANativeWindowBuffer* buf[2];
EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[0]));
ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[1]));
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp
index 6c71343..8747ba5 100644
--- a/libs/gui/tests/SurfaceTexture_test.cpp
+++ b/libs/gui/tests/SurfaceTexture_test.cpp
@@ -476,7 +476,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) {
ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
- android_native_buffer_t* anb;
+ ANativeWindowBuffer* anb;
ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
ASSERT_TRUE(anb != NULL);
@@ -524,7 +524,7 @@ TEST_F(SurfaceTextureGLTest, DISABLED_TexturingFromCpuFilledYV12BufferPow2) {
ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
- android_native_buffer_t* anb;
+ ANativeWindowBuffer* anb;
ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
ASSERT_TRUE(anb != NULL);
@@ -583,7 +583,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) {
ASSERT_EQ(NO_ERROR, native_window_set_crop(mANW.get(), &crop));
- android_native_buffer_t* anb;
+ ANativeWindowBuffer* anb;
ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
ASSERT_TRUE(anb != NULL);
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index 440a48b..35c8640 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -93,7 +93,7 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersFail) {
ASSERT_EQ(NO_ERROR, native_window_set_usage(anw.get(),
GRALLOC_USAGE_PROTECTED));
ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(anw.get(), 3));
- android_native_buffer_t* buf = 0;
+ ANativeWindowBuffer* buf = 0;
for (int i = 0; i < 4; i++) {
// Loop to make sure SurfaceFlinger has retired a protected buffer.
ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf));
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 0c820e5..4393504 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -47,16 +47,16 @@ namespace android {
class NativeBuffer
: public EGLNativeBase<
- android_native_buffer_t,
+ ANativeWindowBuffer,
NativeBuffer,
LightRefBase<NativeBuffer> >
{
public:
NativeBuffer(int w, int h, int f, int u) : BASE() {
- android_native_buffer_t::width = w;
- android_native_buffer_t::height = h;
- android_native_buffer_t::format = f;
- android_native_buffer_t::usage = u;
+ ANativeWindowBuffer::width = w;
+ ANativeWindowBuffer::height = h;
+ ANativeWindowBuffer::format = f;
+ ANativeWindowBuffer::usage = u;
}
private:
friend class LightRefBase<NativeBuffer>;
@@ -201,7 +201,7 @@ int FramebufferNativeWindow::getCurrentBufferIndex() const
}
int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,
- android_native_buffer_t** buffer)
+ ANativeWindowBuffer** buffer)
{
FramebufferNativeWindow* self = getSelf(window);
Mutex::Autolock _l(self->mutex);
@@ -229,7 +229,7 @@ int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,
}
int FramebufferNativeWindow::lockBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer)
+ ANativeWindowBuffer* buffer)
{
FramebufferNativeWindow* self = getSelf(window);
Mutex::Autolock _l(self->mutex);
@@ -249,7 +249,7 @@ int FramebufferNativeWindow::lockBuffer(ANativeWindow* window,
}
int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
- android_native_buffer_t* buffer)
+ ANativeWindowBuffer* buffer)
{
FramebufferNativeWindow* self = getSelf(window);
Mutex::Autolock _l(self->mutex);
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index 97312a6..54a3ffa 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -33,7 +33,7 @@
namespace android {
// ===========================================================================
-// Buffer and implementation of android_native_buffer_t
+// Buffer and implementation of ANativeWindowBuffer
// ===========================================================================
GraphicBuffer::GraphicBuffer()
@@ -77,7 +77,7 @@ GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
handle = inHandle;
}
-GraphicBuffer::GraphicBuffer(android_native_buffer_t* buffer, bool keepOwnership)
+GraphicBuffer::GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership)
: BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
mBufferMapper(GraphicBufferMapper::get()),
mInitCheck(NO_ERROR), mIndex(-1), mWrappedBuffer(buffer)
@@ -119,9 +119,9 @@ void GraphicBuffer::dumpAllocationsToSystemLog()
GraphicBufferAllocator::dumpToSystemLog();
}
-android_native_buffer_t* GraphicBuffer::getNativeBuffer() const
+ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const
{
- return static_cast<android_native_buffer_t*>(
+ return static_cast<ANativeWindowBuffer*>(
const_cast<GraphicBuffer*>(this));
}
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 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
// 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 @@ status_t ACodec::cancelBufferToNativeWindow(BufferInfo *info) {
}
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 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
// 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 @@ status_t OMXCodec::cancelBufferToNativeWindow(BufferInfo *info) {
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 @@ SoftwareRenderer::~SoftwareRenderer() {
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/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h
index 1ffcd56..1123e16 100644
--- a/opengl/include/EGL/eglext.h
+++ b/opengl/include/EGL/eglext.h
@@ -225,7 +225,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGL
#ifndef EGL_ANDROID_image_native_buffer
#define EGL_ANDROID_image_native_buffer 1
-struct android_native_buffer_t;
+struct ANativeWindowBuffer;
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp
index bbb82fc..022de09 100644
--- a/opengl/libagl/TextureObjectManager.cpp
+++ b/opengl/libagl/TextureObjectManager.cpp
@@ -145,7 +145,7 @@ status_t EGLTextureObject::setSurface(GGLSurface const* s)
return NO_ERROR;
}
-status_t EGLTextureObject::setImage(android_native_buffer_t* native_buffer)
+status_t EGLTextureObject::setImage(ANativeWindowBuffer* native_buffer)
{
GGLSurface sur;
sur.version = sizeof(GGLSurface);
diff --git a/opengl/libagl/TextureObjectManager.h b/opengl/libagl/TextureObjectManager.h
index 70e3bef..de9e03e 100644
--- a/opengl/libagl/TextureObjectManager.h
+++ b/opengl/libagl/TextureObjectManager.h
@@ -48,7 +48,7 @@ public:
~EGLTextureObject();
status_t setSurface(GGLSurface const* s);
- status_t setImage(android_native_buffer_t* buffer);
+ status_t setImage(ANativeWindowBuffer* buffer);
void setImageBits(void* vaddr) { surface.data = (GGLubyte*)vaddr; }
status_t reallocate(GLint level,
@@ -80,7 +80,7 @@ public:
GLint crop_rect[4];
GLint generate_mipmap;
GLint direct;
- android_native_buffer_t* buffer;
+ ANativeWindowBuffer* buffer;
};
// ----------------------------------------------------------------------------
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 97e913ba..0d03361 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -230,11 +230,11 @@ struct egl_window_surface_v2_t : public egl_surface_t
virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
private:
- status_t lock(android_native_buffer_t* buf, int usage, void** vaddr);
- status_t unlock(android_native_buffer_t* buf);
+ status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr);
+ status_t unlock(ANativeWindowBuffer* buf);
ANativeWindow* nativeWindow;
- android_native_buffer_t* buffer;
- android_native_buffer_t* previousBuffer;
+ ANativeWindowBuffer* buffer;
+ ANativeWindowBuffer* previousBuffer;
gralloc_module_t const* module;
int width;
int height;
@@ -322,8 +322,8 @@ private:
};
void copyBlt(
- android_native_buffer_t* dst, void* dst_vaddr,
- android_native_buffer_t* src, void const* src_vaddr,
+ ANativeWindowBuffer* dst, void* dst_vaddr,
+ ANativeWindowBuffer* src, void const* src_vaddr,
const Region& clip);
Rect dirtyRegion;
@@ -415,7 +415,7 @@ void egl_window_surface_v2_t::disconnect()
}
status_t egl_window_surface_v2_t::lock(
- android_native_buffer_t* buf, int usage, void** vaddr)
+ ANativeWindowBuffer* buf, int usage, void** vaddr)
{
int err;
@@ -425,7 +425,7 @@ status_t egl_window_surface_v2_t::lock(
return err;
}
-status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
+status_t egl_window_surface_v2_t::unlock(ANativeWindowBuffer* buf)
{
if (!buf) return BAD_VALUE;
int err = NO_ERROR;
@@ -436,8 +436,8 @@ status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
}
void egl_window_surface_v2_t::copyBlt(
- android_native_buffer_t* dst, void* dst_vaddr,
- android_native_buffer_t* src, void const* src_vaddr,
+ ANativeWindowBuffer* dst, void* dst_vaddr,
+ ANativeWindowBuffer* src, void const* src_vaddr,
const Region& clip)
{
// NOTE: dst and src must be the same format
@@ -2003,12 +2003,12 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)buffer;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
switch (native_buffer->format) {
@@ -2034,12 +2034,12 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
return setError(EGL_BAD_DISPLAY, EGL_FALSE);
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)img;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)img;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
return setError(EGL_BAD_PARAMETER, EGL_FALSE);
native_buffer->common.decRef(&native_buffer->common);
diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp
index eb96895..8eb17c4 100644
--- a/opengl/libagl/texture.cpp
+++ b/opengl/libagl/texture.cpp
@@ -126,7 +126,7 @@ void ogles_lock_textures(ogles_context_t* c)
for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
if (c->rasterizer.state.texture[i].enable) {
texture_unit_t& u(c->textures.tmu[i]);
- android_native_buffer_t* native_buffer = u.texture->buffer;
+ ANativeWindowBuffer* native_buffer = u.texture->buffer;
if (native_buffer) {
c->rasterizer.procs.activeTexture(c, i);
hw_module_t const* pModule;
@@ -154,7 +154,7 @@ void ogles_unlock_textures(ogles_context_t* c)
for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
if (c->rasterizer.state.texture[i].enable) {
texture_unit_t& u(c->textures.tmu[i]);
- android_native_buffer_t* native_buffer = u.texture->buffer;
+ ANativeWindowBuffer* native_buffer = u.texture->buffer;
if (native_buffer) {
c->rasterizer.procs.activeTexture(c, i);
hw_module_t const* pModule;
@@ -1615,12 +1615,12 @@ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
return;
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
ogles_error(c, GL_INVALID_VALUE);
return;
}
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) {
ogles_error(c, GL_INVALID_VALUE);
return;
}
@@ -1643,12 +1643,12 @@ void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
return;
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
ogles_error(c, GL_INVALID_VALUE);
return;
}
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) {
ogles_error(c, GL_INVALID_VALUE);
return;
}
diff --git a/opengl/libagl2/src/egl.cpp b/opengl/libagl2/src/egl.cpp
index ec5889d..0d02ce6 100644
--- a/opengl/libagl2/src/egl.cpp
+++ b/opengl/libagl2/src/egl.cpp
@@ -211,11 +211,11 @@ struct egl_window_surface_v2_t : public egl_surface_t {
virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
private:
- status_t lock(android_native_buffer_t* buf, int usage, void** vaddr);
- status_t unlock(android_native_buffer_t* buf);
+ status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr);
+ status_t unlock(ANativeWindowBuffer* buf);
ANativeWindow* nativeWindow;
- android_native_buffer_t* buffer;
- android_native_buffer_t* previousBuffer;
+ ANativeWindowBuffer* buffer;
+ ANativeWindowBuffer* previousBuffer;
gralloc_module_t const* module;
int width;
int height;
@@ -307,8 +307,8 @@ private:
};
void copyBlt(
- android_native_buffer_t* dst, void* dst_vaddr,
- android_native_buffer_t* src, void const* src_vaddr,
+ ANativeWindowBuffer* dst, void* dst_vaddr,
+ ANativeWindowBuffer* src, void const* src_vaddr,
const Region& clip);
Rect dirtyRegion;
@@ -407,7 +407,7 @@ void egl_window_surface_v2_t::disconnect()
}
status_t egl_window_surface_v2_t::lock(
- android_native_buffer_t* buf, int usage, void** vaddr)
+ ANativeWindowBuffer* buf, int usage, void** vaddr)
{
int err;
@@ -417,7 +417,7 @@ status_t egl_window_surface_v2_t::lock(
return err;
}
-status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
+status_t egl_window_surface_v2_t::unlock(ANativeWindowBuffer* buf)
{
if (!buf) return BAD_VALUE;
int err = NO_ERROR;
@@ -428,8 +428,8 @@ status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
}
void egl_window_surface_v2_t::copyBlt(
- android_native_buffer_t* dst, void* dst_vaddr,
- android_native_buffer_t* src, void const* src_vaddr,
+ ANativeWindowBuffer* dst, void* dst_vaddr,
+ ANativeWindowBuffer* src, void const* src_vaddr,
const Region& clip)
{
// NOTE: dst and src must be the same format
@@ -2105,12 +2105,12 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)buffer;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
switch (native_buffer->format) {
@@ -2136,12 +2136,12 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
return setError(EGL_BAD_DISPLAY, EGL_FALSE);
}
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)img;
+ ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)img;
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
+ if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
return setError(EGL_BAD_PARAMETER, EGL_FALSE);
native_buffer->common.decRef(&native_buffer->common);
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 @@ private:
{
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 @@ private:
{
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 @@ private:
{
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 @@ private:
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)
diff --git a/services/surfaceflinger/TextureManager.cpp b/services/surfaceflinger/TextureManager.cpp
index 9e24f90..bb63c37 100644
--- a/services/surfaceflinger/TextureManager.cpp
+++ b/services/surfaceflinger/TextureManager.cpp
@@ -144,7 +144,7 @@ status_t TextureManager::initEglImage(Image* pImage,
}
// construct an EGL_NATIVE_BUFFER_ANDROID
- android_native_buffer_t* clientBuf = buffer->getNativeBuffer();
+ ANativeWindowBuffer* clientBuf = buffer->getNativeBuffer();
// create the new EGLImageKHR
const EGLint attrs[] = {
diff --git a/services/surfaceflinger/tests/surface/surface.cpp b/services/surfaceflinger/tests/surface/surface.cpp
index 67ecf7e..5265f91 100644
--- a/services/surfaceflinger/tests/surface/surface.cpp
+++ b/services/surfaceflinger/tests/surface/surface.cpp
@@ -53,7 +53,7 @@ int main(int argc, char** argv)
printf("window=%p\n", window);
int err = native_window_set_buffer_count(window, 8);
- android_native_buffer_t* buffer;
+ ANativeWindowBuffer* buffer;
for (int i=0 ; i<8 ; i++) {
window->dequeueBuffer(window, &buffer);