diff options
author | James Dong <jdong@google.com> | 2010-10-10 10:01:31 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-10 10:01:31 -0700 |
commit | 6fcd10bf4ceec8ceea29a686b922c5343e317263 (patch) | |
tree | 446bcef8cfa9808e7587174501ab4318e281ed33 | |
parent | d206c874cf517dba3ca70ca55353f88506dd26c4 (diff) | |
parent | 997eaa2c7c6f7c59d145dab3e93431ea2e2a7dc7 (diff) | |
download | frameworks_base-6fcd10bf4ceec8ceea29a686b922c5343e317263.zip frameworks_base-6fcd10bf4ceec8ceea29a686b922c5343e317263.tar.gz frameworks_base-6fcd10bf4ceec8ceea29a686b922c5343e317263.tar.bz2 |
Merge "0-memcpy video recording framework"
-rw-r--r-- | include/media/stagefright/CameraSource.h | 2 | ||||
-rw-r--r-- | media/libstagefright/CameraSource.cpp | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h index b0bce29..3592aeb 100644 --- a/include/media/stagefright/CameraSource.h +++ b/include/media/stagefright/CameraSource.h @@ -83,7 +83,7 @@ public: * kKeyColorFormat: YUV color format of the video frames * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames * kKeySampleRate: frame rate in frames per second - * kKeyMimeType: always fixed + * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW */ virtual sp<MetaData> getFormat(); diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index f7b76f8..1eb394a 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -451,6 +451,27 @@ status_t CameraSource::init( // This CHECK is good, since we just passed the lock/unlock // check earlier by calling mCamera->setParameters(). CHECK_EQ(OK, mCamera->setPreviewDisplay(mSurface)); + + /* + * mCamera->startRecording() signals camera hal to make + * available the video buffers (for instance, allocation + * of the video buffers may be triggered when camera hal's + * startRecording() method is called). Making available these + * video buffers earlier (before calling start()) is critical, + * if one wants to configure omx video encoders to use these + * buffers for passing video frame data during video recording + * without the need to memcpy the video frame data stored + * in these buffers. Eliminating memcpy for video frame data + * is crucial in performance for HD quality video recording + * applications. + * + * Based on OMX IL spec, configuring the omx video encoders + * must occur in loaded state. When start() is called, omx + * video encoders are already in idle state, which is too + * late. Thus, we must call mCamera->startRecording() earlier. + */ + startCameraRecording(); + IPCThreadState::self()->restoreCallingIdentity(token); int64_t glitchDurationUs = (1000000LL / mVideoFrameRate); @@ -478,6 +499,7 @@ CameraSource::~CameraSource() { void CameraSource::startCameraRecording() { CHECK_EQ(OK, mCamera->startRecording()); + CHECK(mCamera->recordingEnabled()); } status_t CameraSource::start(MetaData *meta) { @@ -501,7 +523,6 @@ status_t CameraSource::start(MetaData *meta) { int64_t token = IPCThreadState::self()->clearCallingIdentity(); mCamera->setListener(new CameraSourceListener(this)); - startCameraRecording(); IPCThreadState::self()->restoreCallingIdentity(token); mStarted = true; |