summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 6981668..c0ba091 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -71,17 +71,17 @@ StagefrightRecorder::StagefrightRecorder()
mVideoSource(VIDEO_SOURCE_LIST_END),
mStarted(false), mSurfaceMediaSource(NULL) {
- LOGV("Constructor");
+ ALOGV("Constructor");
reset();
}
StagefrightRecorder::~StagefrightRecorder() {
- LOGV("Destructor");
+ ALOGV("Destructor");
stop();
}
status_t StagefrightRecorder::init() {
- LOGV("init");
+ ALOGV("init");
return OK;
}
@@ -89,12 +89,12 @@ status_t StagefrightRecorder::init() {
// and return a interface reference. The client side will use that
// while encoding GL Frames
sp<ISurfaceTexture> StagefrightRecorder::querySurfaceMediaSource() const {
- LOGV("Get SurfaceMediaSource");
+ ALOGV("Get SurfaceMediaSource");
return mSurfaceMediaSource;
}
status_t StagefrightRecorder::setAudioSource(audio_source_t as) {
- LOGV("setAudioSource: %d", as);
+ ALOGV("setAudioSource: %d", as);
if (as < AUDIO_SOURCE_DEFAULT ||
as >= AUDIO_SOURCE_CNT) {
LOGE("Invalid audio source: %d", as);
@@ -111,7 +111,7 @@ status_t StagefrightRecorder::setAudioSource(audio_source_t as) {
}
status_t StagefrightRecorder::setVideoSource(video_source vs) {
- LOGV("setVideoSource: %d", vs);
+ ALOGV("setVideoSource: %d", vs);
if (vs < VIDEO_SOURCE_DEFAULT ||
vs >= VIDEO_SOURCE_LIST_END) {
LOGE("Invalid video source: %d", vs);
@@ -128,7 +128,7 @@ status_t StagefrightRecorder::setVideoSource(video_source vs) {
}
status_t StagefrightRecorder::setOutputFormat(output_format of) {
- LOGV("setOutputFormat: %d", of);
+ ALOGV("setOutputFormat: %d", of);
if (of < OUTPUT_FORMAT_DEFAULT ||
of >= OUTPUT_FORMAT_LIST_END) {
LOGE("Invalid output format: %d", of);
@@ -145,7 +145,7 @@ status_t StagefrightRecorder::setOutputFormat(output_format of) {
}
status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) {
- LOGV("setAudioEncoder: %d", ae);
+ ALOGV("setAudioEncoder: %d", ae);
if (ae < AUDIO_ENCODER_DEFAULT ||
ae >= AUDIO_ENCODER_LIST_END) {
LOGE("Invalid audio encoder: %d", ae);
@@ -162,7 +162,7 @@ status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) {
}
status_t StagefrightRecorder::setVideoEncoder(video_encoder ve) {
- LOGV("setVideoEncoder: %d", ve);
+ ALOGV("setVideoEncoder: %d", ve);
if (ve < VIDEO_ENCODER_DEFAULT ||
ve >= VIDEO_ENCODER_LIST_END) {
LOGE("Invalid video encoder: %d", ve);
@@ -179,7 +179,7 @@ status_t StagefrightRecorder::setVideoEncoder(video_encoder ve) {
}
status_t StagefrightRecorder::setVideoSize(int width, int height) {
- LOGV("setVideoSize: %dx%d", width, height);
+ ALOGV("setVideoSize: %dx%d", width, height);
if (width <= 0 || height <= 0) {
LOGE("Invalid video size: %dx%d", width, height);
return BAD_VALUE;
@@ -193,7 +193,7 @@ status_t StagefrightRecorder::setVideoSize(int width, int height) {
}
status_t StagefrightRecorder::setVideoFrameRate(int frames_per_second) {
- LOGV("setVideoFrameRate: %d", frames_per_second);
+ ALOGV("setVideoFrameRate: %d", frames_per_second);
if ((frames_per_second <= 0 && frames_per_second != -1) ||
frames_per_second > 120) {
LOGE("Invalid video frame rate: %d", frames_per_second);
@@ -208,7 +208,7 @@ status_t StagefrightRecorder::setVideoFrameRate(int frames_per_second) {
status_t StagefrightRecorder::setCamera(const sp<ICamera> &camera,
const sp<ICameraRecordingProxy> &proxy) {
- LOGV("setCamera");
+ ALOGV("setCamera");
if (camera == 0) {
LOGE("camera is NULL");
return BAD_VALUE;
@@ -224,7 +224,7 @@ status_t StagefrightRecorder::setCamera(const sp<ICamera> &camera,
}
status_t StagefrightRecorder::setPreviewSurface(const sp<Surface> &surface) {
- LOGV("setPreviewSurface: %p", surface.get());
+ ALOGV("setPreviewSurface: %p", surface.get());
mPreviewSurface = surface;
return OK;
@@ -239,7 +239,7 @@ status_t StagefrightRecorder::setOutputFile(const char *path) {
}
status_t StagefrightRecorder::setOutputFile(int fd, int64_t offset, int64_t length) {
- LOGV("setOutputFile: %d, %lld, %lld", fd, offset, length);
+ ALOGV("setOutputFile: %d, %lld, %lld", fd, offset, length);
// These don't make any sense, do they?
CHECK_EQ(offset, 0);
CHECK_EQ(length, 0);
@@ -313,7 +313,7 @@ static void TrimString(String8 *s) {
}
status_t StagefrightRecorder::setParamAudioSamplingRate(int32_t sampleRate) {
- LOGV("setParamAudioSamplingRate: %d", sampleRate);
+ ALOGV("setParamAudioSamplingRate: %d", sampleRate);
if (sampleRate <= 0) {
LOGE("Invalid audio sampling rate: %d", sampleRate);
return BAD_VALUE;
@@ -325,7 +325,7 @@ status_t StagefrightRecorder::setParamAudioSamplingRate(int32_t sampleRate) {
}
status_t StagefrightRecorder::setParamAudioNumberOfChannels(int32_t channels) {
- LOGV("setParamAudioNumberOfChannels: %d", channels);
+ ALOGV("setParamAudioNumberOfChannels: %d", channels);
if (channels <= 0 || channels >= 3) {
LOGE("Invalid number of audio channels: %d", channels);
return BAD_VALUE;
@@ -337,7 +337,7 @@ status_t StagefrightRecorder::setParamAudioNumberOfChannels(int32_t channels) {
}
status_t StagefrightRecorder::setParamAudioEncodingBitRate(int32_t bitRate) {
- LOGV("setParamAudioEncodingBitRate: %d", bitRate);
+ ALOGV("setParamAudioEncodingBitRate: %d", bitRate);
if (bitRate <= 0) {
LOGE("Invalid audio encoding bit rate: %d", bitRate);
return BAD_VALUE;
@@ -352,7 +352,7 @@ status_t StagefrightRecorder::setParamAudioEncodingBitRate(int32_t bitRate) {
}
status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) {
- LOGV("setParamVideoEncodingBitRate: %d", bitRate);
+ ALOGV("setParamVideoEncodingBitRate: %d", bitRate);
if (bitRate <= 0) {
LOGE("Invalid video encoding bit rate: %d", bitRate);
return BAD_VALUE;
@@ -368,7 +368,7 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) {
// Always rotate clockwise, and only support 0, 90, 180 and 270 for now.
status_t StagefrightRecorder::setParamVideoRotation(int32_t degrees) {
- LOGV("setParamVideoRotation: %d", degrees);
+ ALOGV("setParamVideoRotation: %d", degrees);
if (degrees < 0 || degrees % 90 != 0) {
LOGE("Unsupported video rotation angle: %d", degrees);
return BAD_VALUE;
@@ -378,7 +378,7 @@ status_t StagefrightRecorder::setParamVideoRotation(int32_t degrees) {
}
status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) {
- LOGV("setParamMaxFileDurationUs: %lld us", timeUs);
+ ALOGV("setParamMaxFileDurationUs: %lld us", timeUs);
// This is meant for backward compatibility for MediaRecorder.java
if (timeUs <= 0) {
@@ -397,7 +397,7 @@ status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) {
}
status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) {
- LOGV("setParamMaxFileSizeBytes: %lld bytes", bytes);
+ ALOGV("setParamMaxFileSizeBytes: %lld bytes", bytes);
// This is meant for backward compatibility for MediaRecorder.java
if (bytes <= 0) {
@@ -418,7 +418,7 @@ status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) {
}
status_t StagefrightRecorder::setParamInterleaveDuration(int32_t durationUs) {
- LOGV("setParamInterleaveDuration: %d", durationUs);
+ ALOGV("setParamInterleaveDuration: %d", durationUs);
if (durationUs <= 500000) { // 500 ms
// If interleave duration is too small, it is very inefficient to do
// interleaving since the metadata overhead will count for a significant
@@ -440,20 +440,20 @@ status_t StagefrightRecorder::setParamInterleaveDuration(int32_t durationUs) {
// If seconds == 0, all frames are encoded as I frames. No P frames
// If seconds > 0, it is the time spacing (seconds) between 2 neighboring I frames
status_t StagefrightRecorder::setParamVideoIFramesInterval(int32_t seconds) {
- LOGV("setParamVideoIFramesInterval: %d seconds", seconds);
+ ALOGV("setParamVideoIFramesInterval: %d seconds", seconds);
mIFramesIntervalSec = seconds;
return OK;
}
status_t StagefrightRecorder::setParam64BitFileOffset(bool use64Bit) {
- LOGV("setParam64BitFileOffset: %s",
+ ALOGV("setParam64BitFileOffset: %s",
use64Bit? "use 64 bit file offset": "use 32 bit file offset");
mUse64BitFileOffset = use64Bit;
return OK;
}
status_t StagefrightRecorder::setParamVideoCameraId(int32_t cameraId) {
- LOGV("setParamVideoCameraId: %d", cameraId);
+ ALOGV("setParamVideoCameraId: %d", cameraId);
if (cameraId < 0) {
return BAD_VALUE;
}
@@ -462,7 +462,7 @@ status_t StagefrightRecorder::setParamVideoCameraId(int32_t cameraId) {
}
status_t StagefrightRecorder::setParamTrackTimeStatus(int64_t timeDurationUs) {
- LOGV("setParamTrackTimeStatus: %lld", timeDurationUs);
+ ALOGV("setParamTrackTimeStatus: %lld", timeDurationUs);
if (timeDurationUs < 20000) { // Infeasible if shorter than 20 ms?
LOGE("Tracking time duration too short: %lld us", timeDurationUs);
return BAD_VALUE;
@@ -472,7 +472,7 @@ status_t StagefrightRecorder::setParamTrackTimeStatus(int64_t timeDurationUs) {
}
status_t StagefrightRecorder::setParamVideoEncoderProfile(int32_t profile) {
- LOGV("setParamVideoEncoderProfile: %d", profile);
+ ALOGV("setParamVideoEncoderProfile: %d", profile);
// Additional check will be done later when we load the encoder.
// For now, we are accepting values defined in OpenMAX IL.
@@ -481,7 +481,7 @@ status_t StagefrightRecorder::setParamVideoEncoderProfile(int32_t profile) {
}
status_t StagefrightRecorder::setParamVideoEncoderLevel(int32_t level) {
- LOGV("setParamVideoEncoderLevel: %d", level);
+ ALOGV("setParamVideoEncoderLevel: %d", level);
// Additional check will be done later when we load the encoder.
// For now, we are accepting values defined in OpenMAX IL.
@@ -490,7 +490,7 @@ status_t StagefrightRecorder::setParamVideoEncoderLevel(int32_t level) {
}
status_t StagefrightRecorder::setParamMovieTimeScale(int32_t timeScale) {
- LOGV("setParamMovieTimeScale: %d", timeScale);
+ ALOGV("setParamMovieTimeScale: %d", timeScale);
// The range is set to be the same as the audio's time scale range
// since audio's time scale has a wider range.
@@ -503,7 +503,7 @@ status_t StagefrightRecorder::setParamMovieTimeScale(int32_t timeScale) {
}
status_t StagefrightRecorder::setParamVideoTimeScale(int32_t timeScale) {
- LOGV("setParamVideoTimeScale: %d", timeScale);
+ ALOGV("setParamVideoTimeScale: %d", timeScale);
// 60000 is chosen to make sure that each video frame from a 60-fps
// video has 1000 ticks.
@@ -516,7 +516,7 @@ status_t StagefrightRecorder::setParamVideoTimeScale(int32_t timeScale) {
}
status_t StagefrightRecorder::setParamAudioTimeScale(int32_t timeScale) {
- LOGV("setParamAudioTimeScale: %d", timeScale);
+ ALOGV("setParamAudioTimeScale: %d", timeScale);
// 96000 Hz is the highest sampling rate support in AAC.
if (timeScale < 600 || timeScale > 96000) {
@@ -528,7 +528,7 @@ status_t StagefrightRecorder::setParamAudioTimeScale(int32_t timeScale) {
}
status_t StagefrightRecorder::setParamTimeLapseEnable(int32_t timeLapseEnable) {
- LOGV("setParamTimeLapseEnable: %d", timeLapseEnable);
+ ALOGV("setParamTimeLapseEnable: %d", timeLapseEnable);
if(timeLapseEnable == 0) {
mCaptureTimeLapse = false;
@@ -541,7 +541,7 @@ status_t StagefrightRecorder::setParamTimeLapseEnable(int32_t timeLapseEnable) {
}
status_t StagefrightRecorder::setParamTimeBetweenTimeLapseFrameCapture(int64_t timeUs) {
- LOGV("setParamTimeBetweenTimeLapseFrameCapture: %lld us", timeUs);
+ ALOGV("setParamTimeBetweenTimeLapseFrameCapture: %lld us", timeUs);
// Not allowing time more than a day
if (timeUs <= 0 || timeUs > 86400*1E6) {
@@ -575,7 +575,7 @@ status_t StagefrightRecorder::setParamGeoDataLatitude(
status_t StagefrightRecorder::setParameter(
const String8 &key, const String8 &value) {
- LOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
+ ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
if (key == "max-duration") {
int64_t max_duration_ms;
if (safe_strtoi64(value.string(), &max_duration_ms)) {
@@ -689,7 +689,7 @@ status_t StagefrightRecorder::setParameter(
}
status_t StagefrightRecorder::setParameters(const String8 &params) {
- LOGV("setParameters: %s", params.string());
+ ALOGV("setParameters: %s", params.string());
const char *cparams = params.string();
const char *key_start = cparams;
for (;;) {
@@ -1016,7 +1016,7 @@ status_t StagefrightRecorder::startMPEG2TSRecording() {
}
void StagefrightRecorder::clipVideoFrameRate() {
- LOGV("clipVideoFrameRate: encoder %d", mVideoEncoder);
+ ALOGV("clipVideoFrameRate: encoder %d", mVideoEncoder);
int minFrameRate = mEncoderProfiles->getVideoEncoderParamByName(
"enc.vid.fps.min", mVideoEncoder);
int maxFrameRate = mEncoderProfiles->getVideoEncoderParamByName(
@@ -1033,7 +1033,7 @@ void StagefrightRecorder::clipVideoFrameRate() {
}
void StagefrightRecorder::clipVideoBitRate() {
- LOGV("clipVideoBitRate: encoder %d", mVideoEncoder);
+ ALOGV("clipVideoBitRate: encoder %d", mVideoEncoder);
int minBitRate = mEncoderProfiles->getVideoEncoderParamByName(
"enc.vid.bps.min", mVideoEncoder);
int maxBitRate = mEncoderProfiles->getVideoEncoderParamByName(
@@ -1050,7 +1050,7 @@ void StagefrightRecorder::clipVideoBitRate() {
}
void StagefrightRecorder::clipVideoFrameWidth() {
- LOGV("clipVideoFrameWidth: encoder %d", mVideoEncoder);
+ ALOGV("clipVideoFrameWidth: encoder %d", mVideoEncoder);
int minFrameWidth = mEncoderProfiles->getVideoEncoderParamByName(
"enc.vid.width.min", mVideoEncoder);
int maxFrameWidth = mEncoderProfiles->getVideoEncoderParamByName(
@@ -1082,7 +1082,7 @@ status_t StagefrightRecorder::checkVideoEncoderCapabilities() {
// Set to use AVC baseline profile if the encoding parameters matches
// CAMCORDER_QUALITY_LOW profile; this is for the sake of MMS service.
void StagefrightRecorder::setDefaultProfileIfNecessary() {
- LOGV("setDefaultProfileIfNecessary");
+ ALOGV("setDefaultProfileIfNecessary");
camcorder_quality quality = CAMCORDER_QUALITY_LOW;
@@ -1145,7 +1145,7 @@ status_t StagefrightRecorder::checkAudioEncoderCapabilities() {
}
void StagefrightRecorder::clipAudioBitRate() {
- LOGV("clipAudioBitRate: encoder %d", mAudioEncoder);
+ ALOGV("clipAudioBitRate: encoder %d", mAudioEncoder);
int minAudioBitRate =
mEncoderProfiles->getAudioEncoderParamByName(
@@ -1167,7 +1167,7 @@ void StagefrightRecorder::clipAudioBitRate() {
}
void StagefrightRecorder::clipAudioSampleRate() {
- LOGV("clipAudioSampleRate: encoder %d", mAudioEncoder);
+ ALOGV("clipAudioSampleRate: encoder %d", mAudioEncoder);
int minSampleRate =
mEncoderProfiles->getAudioEncoderParamByName(
@@ -1189,7 +1189,7 @@ void StagefrightRecorder::clipAudioSampleRate() {
}
void StagefrightRecorder::clipNumberOfAudioChannels() {
- LOGV("clipNumberOfAudioChannels: encoder %d", mAudioEncoder);
+ ALOGV("clipNumberOfAudioChannels: encoder %d", mAudioEncoder);
int minChannels =
mEncoderProfiles->getAudioEncoderParamByName(
@@ -1211,7 +1211,7 @@ void StagefrightRecorder::clipNumberOfAudioChannels() {
}
void StagefrightRecorder::clipVideoFrameHeight() {
- LOGV("clipVideoFrameHeight: encoder %d", mVideoEncoder);
+ ALOGV("clipVideoFrameHeight: encoder %d", mVideoEncoder);
int minFrameHeight = mEncoderProfiles->getVideoEncoderParamByName(
"enc.vid.height.min", mVideoEncoder);
int maxFrameHeight = mEncoderProfiles->getVideoEncoderParamByName(
@@ -1548,7 +1548,7 @@ status_t StagefrightRecorder::startMPEG4Recording() {
}
status_t StagefrightRecorder::pause() {
- LOGV("pause");
+ ALOGV("pause");
if (mWriter == NULL) {
return UNKNOWN_ERROR;
}
@@ -1573,7 +1573,7 @@ status_t StagefrightRecorder::pause() {
}
status_t StagefrightRecorder::stop() {
- LOGV("stop");
+ ALOGV("stop");
status_t err = OK;
if (mCaptureTimeLapse && mCameraSourceTimeLapse != NULL) {
@@ -1610,14 +1610,14 @@ status_t StagefrightRecorder::stop() {
}
status_t StagefrightRecorder::close() {
- LOGV("close");
+ ALOGV("close");
stop();
return OK;
}
status_t StagefrightRecorder::reset() {
- LOGV("reset");
+ ALOGV("reset");
stop();
// No audio or video source by default
@@ -1664,7 +1664,7 @@ status_t StagefrightRecorder::reset() {
}
status_t StagefrightRecorder::getMaxAmplitude(int *max) {
- LOGV("getMaxAmplitude");
+ ALOGV("getMaxAmplitude");
if (max == NULL) {
LOGE("Null pointer argument");
@@ -1682,7 +1682,7 @@ status_t StagefrightRecorder::getMaxAmplitude(int *max) {
status_t StagefrightRecorder::dump(
int fd, const Vector<String16>& args) const {
- LOGV("dump");
+ ALOGV("dump");
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;