diff options
author | Surajit Podder <spodder@codeaurora.org> | 2015-07-21 15:29:39 +0530 |
---|---|---|
committer | Satish Kamuju <skamuj@codeaurora.org> | 2015-10-06 17:36:01 +0530 |
commit | 9953765019ae2243e98e8e74eee327c9893b93d1 (patch) | |
tree | a0d21f06540cbdac85dcb6348a27b9eddf3cb68d /include | |
parent | bd019775a921ae9165e924e4d37bc838a7ef5781 (diff) | |
download | frameworks_av-9953765019ae2243e98e8e74eee327c9893b93d1.zip frameworks_av-9953765019ae2243e98e8e74eee327c9893b93d1.tar.gz frameworks_av-9953765019ae2243e98e8e74eee327c9893b93d1.tar.bz2 |
video: Modify classes to support camcorder pause/resume
* Modify MediaRecorder, CameraSource, AudioSource to
be extendable.
* Add hooks to instantiate extended implementations to
implement pause/resume.
Change-Id: I847263fc69e4f613c5ea60fb6809c7da176d3a8d
Diffstat (limited to 'include')
-rw-r--r-- | include/media/mediarecorder.h | 8 | ||||
-rw-r--r-- | include/media/stagefright/AudioSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/CameraSource.h | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index b74f888..6ace36d 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -236,13 +236,13 @@ public: status_t setOutputFile(int fd, int64_t offset, int64_t length); status_t setVideoSize(int width, int height); status_t setVideoFrameRate(int frames_per_second); - status_t setParameters(const String8& params); + virtual status_t setParameters(const String8& params); status_t setListener(const sp<MediaRecorderListener>& listener); status_t setClientName(const String16& clientName); status_t prepare(); status_t getMaxAmplitude(int* max); - status_t start(); - status_t stop(); + virtual status_t start(); + virtual status_t stop(); status_t reset(); status_t init(); status_t close(); @@ -251,7 +251,7 @@ public: status_t setInputSurface(const sp<PersistentSurface>& surface); sp<IGraphicBufferProducer> querySurfaceMediaSourceFromMediaServer(); -private: +protected: void doCleanUp(); status_t doReset(); diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h index ed523d8..9750bcd 100644 --- a/include/media/stagefright/AudioSource.h +++ b/include/media/stagefright/AudioSource.h @@ -46,6 +46,8 @@ struct AudioSource : public MediaSource, public MediaBufferObserver { virtual status_t stop() { return reset(); } virtual sp<MetaData> getFormat(); + virtual status_t pause() { return ERROR_UNSUPPORTED; } + // Returns the maximum amplitude since last call. int16_t getMaxAmplitude(); @@ -58,7 +60,7 @@ struct AudioSource : public MediaSource, public MediaBufferObserver { protected: virtual ~AudioSource(); -private: +protected: enum { //calculated for max duration 80 msec with 48K sampling rate. kMaxBufferSize = 30720, @@ -102,7 +104,7 @@ private: int32_t startFrame, int32_t rampDurationFrames, uint8_t *data, size_t bytes); - void queueInputBuffer_l(MediaBuffer *buffer, int64_t timeUs); + virtual void queueInputBuffer_l(MediaBuffer *buffer, int64_t timeUs); void releaseQueuedFrames_l(); void waitOutstandingEncodingFrames_l(); virtual status_t reset(); diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h index 069e897..527ee15 100644 --- a/include/media/stagefright/CameraSource.h +++ b/include/media/stagefright/CameraSource.h @@ -92,6 +92,8 @@ public: virtual status_t read( MediaBuffer **buffer, const ReadOptions *options = NULL); + virtual status_t pause() { return ERROR_UNSUPPORTED; } + /** * Check whether a CameraSource object is properly initialized. * Must call this method before stop(). @@ -189,7 +191,7 @@ protected: void releaseCamera(); -private: +protected: friend struct CameraSourceListener; Mutex mLock; |