Use metadata in video buffers for timelapse video recording by default to eliminate memcpy

bug - 3361771

Change-Id: Ib37ffe4be8edc8708baa76b3507b6f11372536d9
This commit is contained in:
James Dong
2011-01-18 21:12:31 -08:00
parent 3355e18f68
commit 5fb60c7af2
2 changed files with 2 additions and 14 deletions

View File

@@ -1229,25 +1229,13 @@ status_t StagefrightRecorder::setupVideoEncoder(
}
if (mVideoEncoderLevel != -1) {
enc_meta->setInt32(kKeyVideoLevel, mVideoEncoderLevel);
} else if (mCaptureTimeLapse) {
// Check if we are using high resolution and/or high bitrate and
// set appropriate level for the software AVCEncoder.
if ((width * height >= 921600) // 720p
|| (videoBitRate >= 20000000)) {
enc_meta->setInt32(kKeyVideoLevel, OMX_VIDEO_AVCLevel5);
}
}
OMXClient client;
CHECK_EQ(client.connect(), OK);
// Use software codec for time lapse
uint32_t encoder_flags = 0;
if (mCaptureTimeLapse) {
// Do not use software encoder for timelapse for now
// It is _very_ slow and the preview appears sluggish
//encoder_flags |= OMXCodec::kPreferSoftwareCodecs;
} else if (mIsMetaDataStoredInVideoBuffers) {
if (mIsMetaDataStoredInVideoBuffers) {
encoder_flags |= OMXCodec::kHardwareCodecsOnly;
encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
}

View File

@@ -66,7 +66,7 @@ CameraSourceTimeLapse::CameraSourceTimeLapse(
int32_t videoFrameRate,
const sp<Surface>& surface,
int64_t timeBetweenTimeLapseFrameCaptureUs)
: CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, false),
: CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, true),
mTimeBetweenTimeLapseFrameCaptureUs(timeBetweenTimeLapseFrameCaptureUs),
mTimeBetweenTimeLapseVideoFramesUs(1E6/videoFrameRate),
mLastTimeLapseFrameRealTimestampUs(0),