diff options
author | Pannag Sanketi <psanketi@google.com> | 2011-07-01 17:39:39 -0700 |
---|---|---|
committer | Pannag Sanketi <psanketi@google.com> | 2011-07-22 14:17:25 -0700 |
commit | 897e27bc75886e44d2f9f09155127f401c4173ea (patch) | |
tree | d352d82d32c65c1872c7020e18894c32411ca89e /include | |
parent | 95b404228547eb771700e6cbb927adc282aebccd (diff) | |
download | frameworks_base-897e27bc75886e44d2f9f09155127f401c4173ea.zip frameworks_base-897e27bc75886e44d2f9f09155127f401c4173ea.tar.gz frameworks_base-897e27bc75886e44d2f9f09155127f401c4173ea.tar.bz2 |
Connect MediaRecorder Native to SurfaceMediaSource
Making a connection from MediaRecorder Native layer to the
SurfaceMediaSource for the purpose of encoding GL Frames. This will be
called from the java side inside the Mobile Filter Framework.
The mediarecorder native layer (client), when set the videosource to
option VIDEO_SOURCE_FRAMES, asks the StageFrightRecorder on the mediaserver
side to create a SurfaceMediaSource object and pass it back as a
sp<ISurfaceTexture> object. Using that, the client side will dequeue and
queue buffers. Connecting the GL Frames to the obtained
sp<ISurfaceTexture> is not part of this CL.
Related to bug id: 4529323
Change-Id: I651bec718dd5b935779e7d7a050b841c2d0b0fcd
Diffstat (limited to 'include')
-rw-r--r-- | include/media/IMediaRecorder.h | 2 | ||||
-rw-r--r-- | include/media/MediaRecorderBase.h | 2 | ||||
-rw-r--r-- | include/media/mediarecorder.h | 10 | ||||
-rw-r--r-- | include/media/stagefright/SurfaceMediaSource.h | 10 |
4 files changed, 21 insertions, 3 deletions
diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index a73267d..007aea6 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -26,6 +26,7 @@ class Surface; class ICamera; class ICameraRecordingProxy; class IMediaRecorderClient; +class ISurfaceTexture; class IMediaRecorder: public IInterface { @@ -55,6 +56,7 @@ public: virtual status_t init() = 0; virtual status_t close() = 0; virtual status_t release() = 0; + virtual sp<ISurfaceTexture> querySurfaceMediaSource() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/MediaRecorderBase.h b/include/media/MediaRecorderBase.h index 1c08969..ef799f5 100644 --- a/include/media/MediaRecorderBase.h +++ b/include/media/MediaRecorderBase.h @@ -26,6 +26,7 @@ namespace android { class ICameraRecordingProxy; class Surface; +class ISurfaceTexture; struct MediaRecorderBase { MediaRecorderBase() {} @@ -54,6 +55,7 @@ struct MediaRecorderBase { virtual status_t reset() = 0; virtual status_t getMaxAmplitude(int *max) = 0; virtual status_t dump(int fd, const Vector<String16>& args) const = 0; + virtual sp<ISurfaceTexture> querySurfaceMediaSource() const = 0; private: MediaRecorderBase(const MediaRecorderBase &); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index af12d3c..72d3736 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -31,12 +31,15 @@ class Surface; class IMediaRecorder; class ICamera; class ICameraRecordingProxy; +class ISurfaceTexture; +class SurfaceTextureClient; typedef void (*media_completion_f)(status_t status, void *cookie); enum video_source { VIDEO_SOURCE_DEFAULT = 0, VIDEO_SOURCE_CAMERA = 1, + VIDEO_SOURCE_GRALLOC_BUFFER = 2, VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type }; @@ -226,6 +229,7 @@ public: status_t close(); status_t release(); void notify(int msg, int ext1, int ext2); + sp<ISurfaceTexture> querySurfaceMediaSourceFromMediaServer(); private: void doCleanUp(); @@ -233,6 +237,12 @@ private: sp<IMediaRecorder> mMediaRecorder; sp<MediaRecorderListener> mListener; + + // Reference toISurfaceTexture + // for encoding GL Frames. That is useful only when the + // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER + sp<ISurfaceTexture> mSurfaceMediaSource; + media_recorder_states mCurrentState; bool mIsAudioSourceSet; bool mIsVideoSourceSet; diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index e1852ec..d772701 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -64,8 +64,8 @@ public: virtual sp<MetaData> getFormat(); // Get / Set the frame rate used for encoding. Default fps = 30 - void setFrameRate(uint32_t fps) ; - uint32_t getFrameRate( ) const; + status_t setFrameRate(int32_t fps) ; + int32_t getFrameRate( ) const; // The call for the StageFrightRecorder to tell us that // it is done using the MediaBuffer data so that its state @@ -178,7 +178,11 @@ public: void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - protected: + // isMetaDataStoredInVideoBuffers tells the encoder whether we will + // pass metadata through the buffers. Currently, it is force set to true + bool isMetaDataStoredInVideoBuffers() const; + +protected: // freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for // all slots. |