diff options
author | Lajos Molnar <lajos@google.com> | 2014-02-24 16:37:24 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-03-10 11:40:03 -0700 |
commit | e0381245dff04aa823a59aa8b85869eddab0f39f (patch) | |
tree | 956a2615b37d049528ad0b2ae503b14fc852962c /include/media | |
parent | 259f1624cf7b93ba831af10a616267487601c27f (diff) | |
download | frameworks_av-e0381245dff04aa823a59aa8b85869eddab0f39f.zip frameworks_av-e0381245dff04aa823a59aa8b85869eddab0f39f.tar.gz frameworks_av-e0381245dff04aa823a59aa8b85869eddab0f39f.tar.bz2 |
MediaCodec: add getInputFormat() method
Additional input-port format item:
int32: "adaptive-playback"
video decoders only
whether codec is configured for adaptive playback. In this case, if
codec has max-width/height limits, those limits are also exposed
(int32: "max-width", "max-height")
Also, getInput/OutputFormat() is now callable in CONFIGURED and
STARTING states, although output format may be missing CSD fields
until INFO_OUTPUT_FORMAT_CHANGED message.
Includes missing OMX support for MP3 software decoder.
Bug: 11785204
Change-Id: I90c7e34ba81c7b81c43641599f3f496e838958c6
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/ACodec.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 36f2a67..88146f0 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -67,8 +67,6 @@ struct ACodec : public AHierarchicalStateMachine { void signalRequestIDRFrame(); - bool isConfiguredForAdaptivePlayback() { return mIsConfiguredForAdaptivePlayback; } - struct PortDescription : public RefBase { size_t countBuffers(); IOMX::buffer_id bufferIDAt(size_t index) const; @@ -178,6 +176,8 @@ private: sp<MemoryDealer> mDealer[2]; sp<ANativeWindow> mNativeWindow; + sp<AMessage> mInputFormat; + sp<AMessage> mOutputFormat; Vector<BufferInfo> mBuffers[2]; bool mPortEOS[2]; @@ -189,7 +189,6 @@ private: bool mIsEncoder; bool mUseMetadataOnEncoderOutput; bool mShutdownInProgress; - bool mIsConfiguredForAdaptivePlayback; // If "mKeepComponentAllocated" we only transition back to Loaded state // and do not release the component instance. @@ -305,6 +304,7 @@ private: void processDeferredMessages(); void sendFormatChange(const sp<AMessage> &reply); + status_t getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify); void signalError( OMX_ERRORTYPE error = OMX_ErrorUndefined, diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 76aa503..276543b 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -106,6 +106,7 @@ struct MediaCodec : public AHandler { status_t signalEndOfInputStream(); status_t getOutputFormat(sp<AMessage> *format) const; + status_t getInputFormat(sp<AMessage> *format) const; status_t getInputBuffers(Vector<sp<ABuffer> > *buffers) const; status_t getOutputBuffers(Vector<sp<ABuffer> > *buffers) const; @@ -159,6 +160,7 @@ private: kWhatGetBuffers = 'getB', kWhatFlush = 'flus', kWhatGetOutputFormat = 'getO', + kWhatGetInputFormat = 'getI', kWhatDequeueInputTimedOut = 'dITO', kWhatDequeueOutputTimedOut = 'dOTO', kWhatCodecNotify = 'codc', @@ -199,6 +201,7 @@ private: sp<Surface> mNativeWindow; SoftwareRenderer *mSoftRenderer; sp<AMessage> mOutputFormat; + sp<AMessage> mInputFormat; List<size_t> mAvailPortBuffers[2]; Vector<BufferInfo> mPortBuffers[2]; |