summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/vss
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-07-12 02:24:49 +0800
committerChih-Chung Chang <chihchung@google.com>2011-07-12 02:24:49 +0800
commit6d566304093bc0f79b47d96ed8d840620c163264 (patch)
tree9e005da229d1fe9b072706e479bfc2c8a5047cc3 /libvideoeditor/vss
parentbc8e52dadeb078c45e62ebda17fd95e67f689654 (diff)
downloadframeworks_av-6d566304093bc0f79b47d96ed8d840620c163264.zip
frameworks_av-6d566304093bc0f79b47d96ed8d840620c163264.tar.gz
frameworks_av-6d566304093bc0f79b47d96ed8d840620c163264.tar.bz2
Fix 4973565: implement getFormat() like Ie534e2660b0de2c3ac697b4e1f61e3aaf2c4cffe.
Change-Id: I9c684fa971d5ef3f975017cbaaf06ba789a6c41f
Diffstat (limited to 'libvideoeditor/vss')
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditorAudioEncoder.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioEncoder.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioEncoder.cpp
index 39204cd..588428e 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioEncoder.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioEncoder.cpp
@@ -42,7 +42,8 @@
namespace android {
struct VideoEditorAudioEncoderSource : public MediaSource {
public:
- static sp<VideoEditorAudioEncoderSource> Create();
+ static sp<VideoEditorAudioEncoderSource> Create(
+ const sp<MetaData> &format);
virtual status_t start(MetaData *params = NULL);
virtual status_t stop();
virtual sp<MetaData> getFormat();
@@ -68,8 +69,9 @@ struct VideoEditorAudioEncoderSource : public MediaSource {
MediaBufferChain* mLastBufferLink;
int32_t mNbBuffer;
State mState;
+ sp<MetaData> mEncFormat;
- VideoEditorAudioEncoderSource();
+ VideoEditorAudioEncoderSource(const sp<MetaData> &format);
// Don't call me.
VideoEditorAudioEncoderSource(const VideoEditorAudioEncoderSource&);
@@ -77,20 +79,23 @@ struct VideoEditorAudioEncoderSource : public MediaSource {
const VideoEditorAudioEncoderSource&);
};
-sp<VideoEditorAudioEncoderSource> VideoEditorAudioEncoderSource::Create() {
+sp<VideoEditorAudioEncoderSource> VideoEditorAudioEncoderSource::Create(
+ const sp<MetaData> &format) {
LOGV("VideoEditorAudioEncoderSource::Create");
sp<VideoEditorAudioEncoderSource> aSource =
- new VideoEditorAudioEncoderSource();
+ new VideoEditorAudioEncoderSource(format);
return aSource;
}
-VideoEditorAudioEncoderSource::VideoEditorAudioEncoderSource():
+VideoEditorAudioEncoderSource::VideoEditorAudioEncoderSource(
+ const sp<MetaData> &format):
mFirstBufferLink(NULL),
mLastBufferLink(NULL),
mNbBuffer(0),
- mState(CREATED) {
+ mState(CREATED),
+ mEncFormat(format) {
LOGV("VideoEditorAudioEncoderSource::VideoEditorAudioEncoderSource");
}
@@ -152,10 +157,7 @@ status_t VideoEditorAudioEncoderSource::stop() {
sp<MetaData> VideoEditorAudioEncoderSource::getFormat() {
LOGV("VideoEditorAudioEncoderSource::getFormat");
-
- LOGV("VideoEditorAudioEncoderSource::getFormat :THIS IS NOT IMPLEMENTED");
-
- return NULL;
+ return mEncFormat;
}
status_t VideoEditorAudioEncoderSource::read(MediaBuffer **buffer,
@@ -428,7 +430,8 @@ M4OSA_ERR VideoEditorAudioEncoder_open(M4OSA_Context pContext,
encoderMetadata->setInt32(kKeyChannelCount, iNbChannel);
// Create the encoder source
- pEncoderContext->mEncoderSource = VideoEditorAudioEncoderSource::Create();
+ pEncoderContext->mEncoderSource = VideoEditorAudioEncoderSource::Create(
+ encoderMetadata);
VIDEOEDITOR_CHECK(NULL != pEncoderContext->mEncoderSource.get(),
M4ERR_STATE);