diff options
author | Wu-cheng Li <wuchengli@google.com> | 2012-03-19 19:25:56 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-19 19:25:56 -0700 |
commit | fa6494d086e697543efa3d16440647e14ea09f30 (patch) | |
tree | 39df5e3d5fdff528f8fa8ab364b07dde2b90fc75 /media/libstagefright/CameraSource.cpp | |
parent | 1bb8e81b066a2311fd238fc6dae8f026e33ed99e (diff) | |
parent | 8e0792bb55a604ffcd4aa90fdb4419d8b3c6ad24 (diff) | |
download | frameworks_av-fa6494d086e697543efa3d16440647e14ea09f30.zip frameworks_av-fa6494d086e697543efa3d16440647e14ea09f30.tar.gz frameworks_av-fa6494d086e697543efa3d16440647e14ea09f30.tar.bz2 |
Merge "Do not set camera preview display if the surface is null."
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rwxr-xr-x | media/libstagefright/CameraSource.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index 0d67800..fd3f892 100755 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -515,9 +515,13 @@ status_t CameraSource::initWithCameraAccess( return err; } - // This CHECK is good, since we just passed the lock/unlock - // check earlier by calling mCamera->setParameters(). - CHECK_EQ((status_t)OK, mCamera->setPreviewDisplay(mSurface)); + // Set the preview display. Skip this if mSurface is null because + // applications may already set a surface to the camera. + if (mSurface != NULL) { + // This CHECK is good, since we just passed the lock/unlock + // check earlier by calling mCamera->setParameters(). + CHECK_EQ((status_t)OK, mCamera->setPreviewDisplay(mSurface)); + } // By default, do not store metadata in video buffers mIsMetaDataStoredInVideoBuffers = false; |