Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ce23645 authored by Iliyan Malchev's avatar Iliyan Malchev
Browse files

frameworks/base: android_native_buffer_t -> ANativeWindowBuffer



Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: default avatarIliyan Malchev <malchev@google.com>
parent 8951a97b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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;) {
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+7 −7
Original line number Diff line number Diff line
@@ -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)