diff options
-rw-r--r-- | android/android_surface_output.cpp | 3 | ||||
-rw-r--r-- | android/android_surface_output.h | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/android/android_surface_output.cpp b/android/android_surface_output.cpp index 748faa8ce..efd7b03fe 100644 --- a/android/android_surface_output.cpp +++ b/android/android_surface_output.cpp @@ -48,6 +48,7 @@ OSCL_EXPORT_REF AndroidSurfaceOutput::AndroidSurfaceOutput() : mPvPlayer = NULL; mEmulation = false; iEosReceived = false; + mNumberOfFramesToHold = 2; } status_t AndroidSurfaceOutput::set(PVPlayer* pvPlayer, const sp<ISurface>& surface, bool emulation) @@ -935,7 +936,7 @@ void AndroidSurfaceOutput::Run() LOGV("Flushing buffers after EOS"); processWriteResponseQueue(0); } else { - processWriteResponseQueue(2); + processWriteResponseQueue(mNumberOfFramesToHold); } } diff --git a/android/android_surface_output.h b/android/android_surface_output.h index c07d558c9..095c61e5d 100644 --- a/android/android_surface_output.h +++ b/android/android_surface_output.h @@ -314,6 +314,18 @@ protected: //This bool is set true when all necassary parameters have been received. bool iIsMIOConfigured; + /* + * The value of mNumberOfFramesToHold is hardware/platform specific. + * 1. On non-overlay based platforms, its value it set to 2 + * so as to avoid potential tearings oberved during video playback. + * 2. On overlay-based platforms, its value should be overwritten. + * We have observed video decoder starvation when a value other than 1. + * + * We set the default value to 2 in this class. Please change its value + * accordingly in the derived class. + */ + int mNumberOfFramesToHold; + #ifdef PERFORMANCE_MEASUREMENTS_ENABLED PVProfile PVOmapVideoProfile; #endif |