Merge "Stagefright: Query buffer usage from the component."

This commit is contained in:
Jamie Gennis
2011-03-01 11:41:29 -08:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 4 deletions

View File

@@ -440,10 +440,17 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
}
// Set up the native window.
// XXX TODO: Get the gralloc usage flags from the OMX plugin!
OMX_U32 usage = 0;
err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
if (err != 0) {
LOGW("querying usage flags from OMX IL component failed: %d", err);
// XXX: Currently this error is logged, but not fatal.
usage = 0;
}
err = native_window_set_usage(
mNativeWindow.get(),
GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
if (err != 0) {
LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);

View File

@@ -1753,9 +1753,16 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
}
// Set up the native window.
// XXX TODO: Get the gralloc usage flags from the OMX plugin!
OMX_U32 usage = 0;
err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
if (err != 0) {
LOGW("querying usage flags from OMX IL component failed: %d", err);
// XXX: Currently this error is logged, but not fatal.
usage = 0;
}
err = native_window_set_usage(
mNativeWindow.get(), GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
mNativeWindow.get(), usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
if (err != 0) {
LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
return err;