diff options
Diffstat (limited to 'libvideoeditor/lvpp/NativeWindowRenderer.cpp')
-rwxr-xr-x | libvideoeditor/lvpp/NativeWindowRenderer.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.cpp b/libvideoeditor/lvpp/NativeWindowRenderer.cpp index b2c2675..2e15ff9 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.cpp +++ b/libvideoeditor/lvpp/NativeWindowRenderer.cpp @@ -22,9 +22,9 @@ #include <cutils/log.h> #include <gui/SurfaceTexture.h> #include <gui/SurfaceTextureClient.h> -#include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/MediaBuffer.h> #include <media/stagefright/MetaData.h> +#include <media/stagefright/foundation/ADebug.h> #include "VideoEditorTools.h" #define CHECK_EGL_ERROR CHECK(EGL_SUCCESS == eglGetError()) @@ -382,7 +382,7 @@ void NativeWindowRenderer::queueInternalBuffer(ANativeWindow *anw, int64_t timeUs; CHECK(buffer->meta_data()->findInt64(kKeyTime, &timeUs)); native_window_set_buffers_timestamp(anw, timeUs * 1000); - status_t err = anw->queueBuffer(anw, buffer->graphicBuffer().get()); + status_t err = anw->queueBuffer(anw, buffer->graphicBuffer().get(), -1); if (err != 0) { ALOGE("queueBuffer failed with error %s (%d)", strerror(-err), -err); return; @@ -399,18 +399,16 @@ void NativeWindowRenderer::queueExternalBuffer(ANativeWindow* anw, native_window_set_usage(anw, GRALLOC_USAGE_SW_WRITE_OFTEN); ANativeWindowBuffer* anb; - anw->dequeueBuffer(anw, &anb); + CHECK(NO_ERROR == native_window_dequeue_buffer_and_wait(anw, &anb)); CHECK(anb != NULL); - sp<GraphicBuffer> buf(new GraphicBuffer(anb, false)); - CHECK(NO_ERROR == anw->lockBuffer(anw, buf->getNativeBuffer())); - // Copy the buffer uint8_t* img = NULL; + sp<GraphicBuffer> buf(new GraphicBuffer(anb, false)); buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img)); copyI420Buffer(buffer, img, width, height, buf->getStride()); buf->unlock(); - CHECK(NO_ERROR == anw->queueBuffer(anw, buf->getNativeBuffer())); + CHECK(NO_ERROR == anw->queueBuffer(anw, buf->getNativeBuffer(), -1)); } void NativeWindowRenderer::copyI420Buffer(MediaBuffer* src, uint8_t* dst, |