am 5fb60c7a: Use metadata in video buffers for timelapse video recording by default to eliminate memcpy
* commit '5fb60c7af2cbf59a99ae324c4284c7860b37c723': Use metadata in video buffers for timelapse video recording by default to eliminate memcpy
This commit is contained in:
@@ -1229,25 +1229,13 @@ status_t StagefrightRecorder::setupVideoEncoder(
|
|||||||
}
|
}
|
||||||
if (mVideoEncoderLevel != -1) {
|
if (mVideoEncoderLevel != -1) {
|
||||||
enc_meta->setInt32(kKeyVideoLevel, mVideoEncoderLevel);
|
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;
|
OMXClient client;
|
||||||
CHECK_EQ(client.connect(), OK);
|
CHECK_EQ(client.connect(), OK);
|
||||||
|
|
||||||
// Use software codec for time lapse
|
|
||||||
uint32_t encoder_flags = 0;
|
uint32_t encoder_flags = 0;
|
||||||
if (mCaptureTimeLapse) {
|
if (mIsMetaDataStoredInVideoBuffers) {
|
||||||
// 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) {
|
|
||||||
encoder_flags |= OMXCodec::kHardwareCodecsOnly;
|
encoder_flags |= OMXCodec::kHardwareCodecsOnly;
|
||||||
encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
|
encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ CameraSourceTimeLapse::CameraSourceTimeLapse(
|
|||||||
int32_t videoFrameRate,
|
int32_t videoFrameRate,
|
||||||
const sp<Surface>& surface,
|
const sp<Surface>& surface,
|
||||||
int64_t timeBetweenTimeLapseFrameCaptureUs)
|
int64_t timeBetweenTimeLapseFrameCaptureUs)
|
||||||
: CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, false),
|
: CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, true),
|
||||||
mTimeBetweenTimeLapseFrameCaptureUs(timeBetweenTimeLapseFrameCaptureUs),
|
mTimeBetweenTimeLapseFrameCaptureUs(timeBetweenTimeLapseFrameCaptureUs),
|
||||||
mTimeBetweenTimeLapseVideoFramesUs(1E6/videoFrameRate),
|
mTimeBetweenTimeLapseVideoFramesUs(1E6/videoFrameRate),
|
||||||
mLastTimeLapseFrameRealTimestampUs(0),
|
mLastTimeLapseFrameRealTimestampUs(0),
|
||||||
|
|||||||
Reference in New Issue
Block a user