summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/ACodec.h9
-rw-r--r--include/media/stagefright/CodecBase.h2
-rw-r--r--include/media/stagefright/MediaCodec.h8
3 files changed, 17 insertions, 2 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index c14e6c0..3ae2a2a 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -47,6 +47,8 @@ struct ACodec : public AHierarchicalStateMachine, public CodecBase {
virtual void initiateStart();
virtual void initiateShutdown(bool keepComponentAllocated = false);
+ virtual status_t setSurface(const sp<Surface> &surface);
+
virtual void signalFlush();
virtual void signalResume();
@@ -113,6 +115,7 @@ private:
kWhatDrainDeferredMessages = 'drai',
kWhatAllocateComponent = 'allo',
kWhatConfigureComponent = 'conf',
+ kWhatSetSurface = 'setS',
kWhatCreateInputSurface = 'cisf',
kWhatSignalEndOfInputStream = 'eois',
kWhatStart = 'star',
@@ -229,6 +232,12 @@ private:
status_t freeBuffersOnPort(OMX_U32 portIndex);
status_t freeBuffer(OMX_U32 portIndex, size_t i);
+ status_t handleSetSurface(const sp<Surface> &surface);
+ status_t setNativeWindowSizeFormatAndUsage(
+ ANativeWindow *nativeWindow /* nonnull */,
+ int width, int height, int format, int rotation, int usage);
+ status_t setupNativeWindowSizeFormatAndUsage(ANativeWindow *nativeWindow /* nonnull */);
+
status_t configureOutputBuffersFromNativeWindow(
OMX_U32 *nBufferCount, OMX_U32 *nBufferSize,
OMX_U32 *nMinUndequeuedBuffers);
diff --git a/include/media/stagefright/CodecBase.h b/include/media/stagefright/CodecBase.h
index 1bf27a6..6dece58 100644
--- a/include/media/stagefright/CodecBase.h
+++ b/include/media/stagefright/CodecBase.h
@@ -54,6 +54,8 @@ struct CodecBase : public AHandler {
// require an explicit message handler
virtual void onMessageReceived(const sp<AMessage> &msg) = 0;
+ virtual status_t setSurface(const sp<Surface> &surface) { return INVALID_OPERATION; }
+
virtual void signalFlush() = 0;
virtual void signalResume() = 0;
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h
index e232ce6..3187938 100644
--- a/include/media/stagefright/MediaCodec.h
+++ b/include/media/stagefright/MediaCodec.h
@@ -141,6 +141,8 @@ struct MediaCodec : public AHandler {
status_t getOutputFormat(size_t index, sp<AMessage> *format);
status_t getInputBuffer(size_t index, sp<ABuffer> *buffer);
+ status_t setSurface(const sp<Surface> &nativeWindow);
+
status_t requestIDRFrame();
// Notification will be posted once there "is something to do", i.e.
@@ -179,6 +181,7 @@ private:
enum {
kWhatInit = 'init',
kWhatConfigure = 'conf',
+ kWhatSetSurface = 'sSur',
kWhatCreateInputSurface = 'cisf',
kWhatStart = 'strt',
kWhatStop = 'stop',
@@ -334,8 +337,9 @@ private:
void extractCSD(const sp<AMessage> &format);
status_t queueCSDInputBuffer(size_t bufferIndex);
- status_t handleSetSurface(
- const sp<Surface> &surface);
+ status_t handleSetSurface(const sp<Surface> &surface);
+ status_t connectToSurface(const sp<Surface> &surface);
+ status_t disconnectFromSurface();
void postActivityNotificationIfPossible();