diff options
author | James Dong <jdong@google.com> | 2010-01-05 18:06:17 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-01-06 13:23:24 -0800 |
commit | 0bb93756e59a04933d4ab896ce593f994bf5267d (patch) | |
tree | fefb63f18b1e7f5f973c9ea95af4aa00cee0987a | |
parent | afa07b52460a1c9f88294f14f5a2a259543c88b5 (diff) | |
download | opencore-eclair-passion-release.tar.gz |
The number of frames that need to be hold in the video MIO is platform-specific.android-2.1_r2.1sandroid-2.1_r2.1p2android-2.1_r2.1pandroid-2.1_r2eclair-sholes-release2eclair-releaseeclair-passion-release
We add an extra member variable to the video mio base class, and ask the
derived class to overwrite this value if necessary.
-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 |