From 322d0a4dd98eae78c0f0acbebc2b622be9fd5438 Mon Sep 17 00:00:00 2001 From: Deva Ramasubramanian Date: Mon, 9 Nov 2015 18:55:59 -0800 Subject: libstagefright: Allow for MPEG4Writer extension Defer MPEG4 muxer creation to AVFactory. Change-Id: If0918be77ab7f8d82c78203f371df789e3cc29b8 --- media/libavextensions/stagefright/AVExtensions.h | 3 +++ media/libavextensions/stagefright/AVFactory.cpp | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'media/libavextensions') 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& 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 #include #include +#include #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() { } -- cgit v1.1