summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/libavextensions/stagefright/AVExtensions.h3
-rw-r--r--media/libavextensions/stagefright/AVFactory.cpp6
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp2
-rw-r--r--media/libstagefright/MPEG4Writer.cpp2
-rw-r--r--media/libstagefright/MediaMuxer.cpp3
5 files changed, 13 insertions, 3 deletions
diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h
index b0e4bb5..c4c9aae 100644
--- a/media/libavextensions/stagefright/AVExtensions.h
+++ b/media/libavextensions/stagefright/AVExtensions.h
@@ -59,6 +59,7 @@ class ICameraRecordingProxy;
class String16;
class IGraphicBufferProducer;
struct Size;
+class MPEG4Writer;
/*
* Factory to create objects of base-classes in libstagefright
@@ -107,6 +108,8 @@ struct AVFactory {
const sp<IGraphicBufferProducer>& surface,
int64_t timeBetweenFrameCaptureUs,
bool storeMetaDataInVideoBuffers = true);
+
+ virtual MPEG4Writer *CreateMPEG4Writer(int fd);
// ----- NO TRESSPASSING BEYOND THIS LINE ------
DECLARE_LOADABLE_SINGLETON(AVFactory);
};
diff --git a/media/libavextensions/stagefright/AVFactory.cpp b/media/libavextensions/stagefright/AVFactory.cpp
index f6d5f53..7420d12 100644
--- a/media/libavextensions/stagefright/AVFactory.cpp
+++ b/media/libavextensions/stagefright/AVFactory.cpp
@@ -45,6 +45,7 @@
#include <media/stagefright/CameraSource.h>
#include <media/stagefright/CameraSourceTimeLapse.h>
#include <camera/CameraParameters.h>
+#include <media/stagefright/MPEG4Writer.h>
#include "common/ExtensionsLoader.hpp"
#include "stagefright/AVExtensions.h"
@@ -120,6 +121,11 @@ CameraSourceTimeLapse* AVFactory::CreateCameraSourceTimeLapseFromCamera(
clientName, clientUid, videoSize, videoFrameRate, surface,
timeBetweenFrameCaptureUs, storeMetaDataInVideoBuffers);
}
+
+MPEG4Writer* AVFactory::CreateMPEG4Writer(int fd) {
+ return new MPEG4Writer(fd);
+}
+
// ----- NO TRESSPASSING BEYOND THIS LINE ------
AVFactory::AVFactory() {
}
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index d182a68..18df1fc 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1743,7 +1743,7 @@ status_t StagefrightRecorder::setupMPEG4orWEBMRecording() {
if (mOutputFormat == OUTPUT_FORMAT_WEBM) {
writer = new WebmWriter(mOutputFd);
} else {
- writer = mp4writer = new MPEG4Writer(mOutputFd);
+ writer = mp4writer = AVFactory::get()->CreateMPEG4Writer(mOutputFd);
}
if (mVideoSource < VIDEO_SOURCE_LIST_END) {
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index f5e0fbf..24da000 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -1148,7 +1148,7 @@ off64_t MPEG4Writer::addSample_l(MediaBuffer *buffer) {
return old_offset;
}
-static void StripStartcode(MediaBuffer *buffer) {
+void MPEG4Writer::StripStartcode(MediaBuffer *buffer) {
if (buffer->range_length() < 4) {
return;
}
diff --git a/media/libstagefright/MediaMuxer.cpp b/media/libstagefright/MediaMuxer.cpp
index b13877d..798a855 100644
--- a/media/libstagefright/MediaMuxer.cpp
+++ b/media/libstagefright/MediaMuxer.cpp
@@ -35,6 +35,7 @@
#include <media/stagefright/MetaData.h>
#include <media/stagefright/MPEG4Writer.h>
#include <media/stagefright/Utils.h>
+#include <stagefright/AVExtensions.h>
namespace android {
@@ -42,7 +43,7 @@ MediaMuxer::MediaMuxer(int fd, OutputFormat format)
: mFormat(format),
mState(UNINITIALIZED) {
if (format == OUTPUT_FORMAT_MPEG_4) {
- mWriter = new MPEG4Writer(fd);
+ mWriter = AVFactory::get()->CreateMPEG4Writer(fd);
} else if (format == OUTPUT_FORMAT_WEBM) {
mWriter = new WebmWriter(fd);
}