Loading media/libstagefright/ACodec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -642,8 +642,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // FIXME: assume that surface is controlled by app (native window // returns the number for the case when surface is not controlled by app) (*minUndequeuedBuffers)++; // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported // For now, try to allocate 1 more buffer, but don't fail if unsuccessful // Use conservative allocation while also trying to reduce starvation // Loading @@ -651,7 +651,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // minimum needed for the consumer to be able to work // 2. try to allocate two (2) additional buffers to reduce starvation from // the consumer for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { // plus an extra buffer to account for incorrect minUndequeuedBufs for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers; def.nBufferCountActual = newBufferCount; Loading media/libstagefright/OMXCodec.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -1797,7 +1797,8 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { } // FIXME: assume that surface is controlled by app (native window // returns the number for the case when surface is not controlled by app) minUndequeuedBufs++; // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported // For now, try to allocate 1 more buffer, but don't fail if unsuccessful // Use conservative allocation while also trying to reduce starvation // Loading @@ -1805,10 +1806,11 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { // minimum needed for the consumer to be able to work // 2. try to allocate two (2) additional buffers to reduce starvation from // the consumer CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", // plus an extra buffer to account for incorrect minUndequeuedBufs CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + minUndequeuedBufs + extraBuffers; def.nBufferCountActual = newBufferCount; Loading @@ -1827,7 +1829,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { return err; } } CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); err = native_window_set_buffer_count( Loading Loading
media/libstagefright/ACodec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -642,8 +642,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // FIXME: assume that surface is controlled by app (native window // returns the number for the case when surface is not controlled by app) (*minUndequeuedBuffers)++; // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported // For now, try to allocate 1 more buffer, but don't fail if unsuccessful // Use conservative allocation while also trying to reduce starvation // Loading @@ -651,7 +651,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // minimum needed for the consumer to be able to work // 2. try to allocate two (2) additional buffers to reduce starvation from // the consumer for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { // plus an extra buffer to account for incorrect minUndequeuedBufs for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers; def.nBufferCountActual = newBufferCount; Loading
media/libstagefright/OMXCodec.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -1797,7 +1797,8 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { } // FIXME: assume that surface is controlled by app (native window // returns the number for the case when surface is not controlled by app) minUndequeuedBufs++; // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported // For now, try to allocate 1 more buffer, but don't fail if unsuccessful // Use conservative allocation while also trying to reduce starvation // Loading @@ -1805,10 +1806,11 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { // minimum needed for the consumer to be able to work // 2. try to allocate two (2) additional buffers to reduce starvation from // the consumer CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", // plus an extra buffer to account for incorrect minUndequeuedBufs CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + minUndequeuedBufs + extraBuffers; def.nBufferCountActual = newBufferCount; Loading @@ -1827,7 +1829,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { return err; } } CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); err = native_window_set_buffer_count( Loading