summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-10-13 21:14:18 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-13 21:14:18 -0700
commit6fd6589c6771fe5123a9e7d295170fc08b79197c (patch)
tree68e4c8606bfd36fbcb4f1b6e87e52a7944cbb585
parent0138890a0993b66d04b95ce1f94a9800b2c666b6 (diff)
parentb8a89c8c3cdcaa95706897b18bff35098df0c817 (diff)
downloadframeworks_av-6fd6589c6771fe5123a9e7d295170fc08b79197c.zip
frameworks_av-6fd6589c6771fe5123a9e7d295170fc08b79197c.tar.gz
frameworks_av-6fd6589c6771fe5123a9e7d295170fc08b79197c.tar.bz2
Merge "libstagefright: Allow for CameraSourceTimeLapse to be extended"
-rw-r--r--include/media/stagefright/CameraSourceTimeLapse.h5
-rw-r--r--media/libavextensions/stagefright/AVExtensions.h15
-rw-r--r--media/libavextensions/stagefright/AVFactory.cpp18
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp4
4 files changed, 36 insertions, 6 deletions
diff --git a/include/media/stagefright/CameraSourceTimeLapse.h b/include/media/stagefright/CameraSourceTimeLapse.h
index 34213be..f264d98 100644
--- a/include/media/stagefright/CameraSourceTimeLapse.h
+++ b/include/media/stagefright/CameraSourceTimeLapse.h
@@ -20,6 +20,7 @@
#include <pthread.h>
+#include <media/stagefright/CameraSource.h>
#include <utils/RefBase.h>
#include <utils/threads.h>
#include <utils/String16.h>
@@ -56,7 +57,7 @@ public:
// returning quickly.
void startQuickReadReturns();
-private:
+protected:
// size of the encoded video.
int32_t mVideoWidth;
int32_t mVideoHeight;
@@ -152,7 +153,7 @@ private:
// the frame needs to be encoded, it returns false and also modifies
// the time stamp to be one frame time ahead of the last encoded
// frame's time stamp.
- bool skipFrameAndModifyTimeStamp(int64_t *timestampUs);
+ virtual bool skipFrameAndModifyTimeStamp(int64_t *timestampUs);
// Wrapper to enter threadTimeLapseEntry()
static void *ThreadTimeLapseWrapper(void *me);
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() {
}
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 136e6cf..80d5ac2 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1465,13 +1465,13 @@ status_t StagefrightRecorder::setupCameraSource(
return BAD_VALUE;
}
- mCameraSourceTimeLapse = CameraSourceTimeLapse::CreateFromCamera(
+ mCameraSourceTimeLapse = AVFactory::get()->CreateCameraSourceTimeLapseFromCamera(
mCamera, mCameraProxy, mCameraId, mClientName, mClientUid,
videoSize, mFrameRate, mPreviewSurface,
mTimeBetweenCaptureUs);
*cameraSource = mCameraSourceTimeLapse;
} else {
- *cameraSource = AVFactory::get()->CreateFromCamera(
+ *cameraSource = AVFactory::get()->CreateCameraSourceFromCamera(
mCamera, mCameraProxy, mCameraId, mClientName, mClientUid,
videoSize, mFrameRate,
mPreviewSurface);