summaryrefslogtreecommitdiffstats
path: root/media/libavextensions
diff options
context:
space:
mode:
authorDeva Ramasubramanian <dramasub@codeaurora.org>2015-09-17 12:48:59 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-09 13:39:32 -0700
commitb8a89c8c3cdcaa95706897b18bff35098df0c817 (patch)
tree76d58d42a3c60a39fa18ad2d104a3b951fa83ae9 /media/libavextensions
parenta9961f6786d048c247cd41363e2b784e1a5aeab4 (diff)
downloadframeworks_av-b8a89c8c3cdcaa95706897b18bff35098df0c817.zip
frameworks_av-b8a89c8c3cdcaa95706897b18bff35098df0c817.tar.gz
frameworks_av-b8a89c8c3cdcaa95706897b18bff35098df0c817.tar.bz2
libstagefright: Allow for CameraSourceTimeLapse to be extended
Add in hooks to route CameraSourceTimeLapse creation to AVFactory so that we can add our customizations. Change-Id: I309a247ba6e3c5626cfba096677a6dbfeae543f3
Diffstat (limited to 'media/libavextensions')
-rw-r--r--media/libavextensions/stagefright/AVExtensions.h15
-rw-r--r--media/libavextensions/stagefright/AVFactory.cpp18
2 files changed, 31 insertions, 2 deletions
diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h
index fc04df1..9c712e4 100644
--- a/media/libavextensions/stagefright/AVExtensions.h
+++ b/media/libavextensions/stagefright/AVExtensions.h
@@ -54,6 +54,7 @@ class CameraParameters;
class MediaBuffer;
struct AudioSource;
class CameraSource;
+class CameraSourceTimeLapse;
class ICamera;
class ICameraRecordingProxy;
class String16;
@@ -85,7 +86,7 @@ struct AVFactory {
uint32_t channels,
uint32_t outSampleRate = 0);
- virtual CameraSource *CreateFromCamera(
+ virtual CameraSource *CreateCameraSourceFromCamera(
const sp<ICamera> &camera,
const sp<ICameraRecordingProxy> &proxy,
int32_t cameraId,
@@ -95,6 +96,18 @@ struct AVFactory {
int32_t frameRate,
const sp<IGraphicBufferProducer>& surface,
bool storeMetaDataInVideoBuffers = true);
+
+ virtual CameraSourceTimeLapse *CreateCameraSourceTimeLapseFromCamera(
+ const sp<ICamera> &camera,
+ const sp<ICameraRecordingProxy> &proxy,
+ int32_t cameraId,
+ const String16& clientName,
+ uid_t clientUid,
+ Size videoSize,
+ int32_t videoFrameRate,
+ const sp<IGraphicBufferProducer>& surface,
+ int64_t timeBetweenFrameCaptureUs,
+ bool storeMetaDataInVideoBuffers = true);
// ----- NO TRESSPASSING BEYOND THIS LINE ------
DECLARE_LOADABLE_SINGLETON(AVFactory);
};
diff --git a/media/libavextensions/stagefright/AVFactory.cpp b/media/libavextensions/stagefright/AVFactory.cpp
index 19977e9..90ac7b2 100644
--- a/media/libavextensions/stagefright/AVFactory.cpp
+++ b/media/libavextensions/stagefright/AVFactory.cpp
@@ -43,6 +43,7 @@
#include <media/stagefright/MediaHTTP.h>
#include <media/stagefright/AudioSource.h>
#include <media/stagefright/CameraSource.h>
+#include <media/stagefright/CameraSourceTimeLapse.h>
#include <camera/CameraParameters.h>
#include "common/ExtensionsLoader.hpp"
@@ -88,7 +89,7 @@ AudioSource* AVFactory::createAudioSource(
channels, outSampleRate);
}
-CameraSource* AVFactory::CreateFromCamera(
+CameraSource* AVFactory::CreateCameraSourceFromCamera(
const sp<ICamera> &camera,
const sp<ICameraRecordingProxy> &proxy,
int32_t cameraId,
@@ -103,6 +104,21 @@ CameraSource* AVFactory::CreateFromCamera(
storeMetaDataInVideoBuffers);
}
+CameraSourceTimeLapse* AVFactory::CreateCameraSourceTimeLapseFromCamera(
+ const sp<ICamera> &camera,
+ const sp<ICameraRecordingProxy> &proxy,
+ int32_t cameraId,
+ const String16& clientName,
+ uid_t clientUid,
+ Size videoSize,
+ int32_t videoFrameRate,
+ const sp<IGraphicBufferProducer>& surface,
+ int64_t timeBetweenFrameCaptureUs,
+ bool storeMetaDataInVideoBuffers) {
+ return CameraSourceTimeLapse::CreateFromCamera(camera, proxy, cameraId,
+ clientName, clientUid, videoSize, videoFrameRate, surface,
+ timeBetweenFrameCaptureUs, storeMetaDataInVideoBuffers);
+}
// ----- NO TRESSPASSING BEYOND THIS LINE ------
AVFactory::AVFactory() {
}