summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-01-05 15:21:14 -0800
committerSteve Kondik <steve@cyngn.com>2016-01-05 15:22:11 -0800
commitde1e368d8ac5891e03e664a0ea385b896b48db0b (patch)
tree12b15ff95a32ca0a55d4fa9f94dbba8c886c09d8 /media/libmediaplayerservice
parent72f2347c4eb4aa50503cd990d1ab5c0f8f5bbb61 (diff)
downloadframeworks_av-de1e368d8ac5891e03e664a0ea385b896b48db0b.zip
frameworks_av-de1e368d8ac5891e03e664a0ea385b896b48db0b.tar.gz
frameworks_av-de1e368d8ac5891e03e664a0ea385b896b48db0b.tar.bz2
stagefright: Forward-port HFR and HSR support
* CAF commit bd42a7ac3a60c0d8a079b4567484c9b006bac8ad upstream Change-Id: I457ccab603647f3139ea2199a544f64ac3d1a214
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp13
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 6baca4d..189bf8f 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1622,12 +1622,12 @@ status_t StagefrightRecorder::setupVideoEncoder(
}
}
- setupCustomVideoEncoderParams(cameraSource, format);
-
format->setInt32("bitrate", mVideoBitRate);
format->setInt32("frame-rate", mFrameRate);
format->setInt32("i-frame-interval", mIFramesIntervalSec);
+ setupCustomVideoEncoderParams(cameraSource, format);
+
if (mVideoTimeScale > 0) {
format->setInt32("time-scale", mVideoTimeScale);
}
@@ -2094,4 +2094,13 @@ status_t StagefrightRecorder::setSourcePause(bool pause) {
}
return err;
}
+
+void StagefrightRecorder::setupCustomVideoEncoderParams(sp<MediaSource> cameraSource,
+ sp<AMessage> &format) {
+
+ // Setup HFR if needed
+ AVUtils::get()->HFRUtils().initializeHFR(cameraSource->getFormat(), format,
+ mMaxFileDurationUs, mVideoEncoder);
+}
+
} // namespace android
diff --git a/media/libmediaplayerservice/StagefrightRecorder.h b/media/libmediaplayerservice/StagefrightRecorder.h
index 72dc77b..d93fc3b 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.h
+++ b/media/libmediaplayerservice/StagefrightRecorder.h
@@ -154,8 +154,8 @@ protected:
status_t setupCameraSource(sp<CameraSource> *cameraSource);
status_t setupAudioEncoder(const sp<MediaWriter>& writer);
virtual status_t setupVideoEncoder(sp<MediaSource> cameraSource, sp<MediaSource> *source);
- virtual void setupCustomVideoEncoderParams(sp<MediaSource> /*cameraSource*/,
- sp<AMessage> &/*format*/) {}
+ virtual void setupCustomVideoEncoderParams(sp<MediaSource> cameraSource,
+ sp<AMessage> &format);
virtual bool setCustomVideoEncoderMime(const video_encoder videoEncoder, sp<AMessage> format);
// Encoding parameter handling utilities