diff options
author | Lajos Molnar <lajos@google.com> | 2013-05-02 16:30:48 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2013-10-03 16:12:45 +0000 |
commit | 56ce726019f700a95ce5b45beebceadae4836e30 (patch) | |
tree | 4ad17b9ec996277e80861895fb1b20f2dc408b9d /media/libmedia/IOMX.cpp | |
parent | a306ee6bc1aef463f8984be26b8a4214490b6c55 (diff) | |
download | frameworks_av-56ce726019f700a95ce5b45beebceadae4836e30.zip frameworks_av-56ce726019f700a95ce5b45beebceadae4836e30.tar.gz frameworks_av-56ce726019f700a95ce5b45beebceadae4836e30.tar.bz2 |
IOMX: Add prepareForAdaptivePlayback method
prepareForAdaptivePlayback is the fallback mechanism to support
seamless resolution change for devices that do not support dynamic
output buffers. It is up to the codecs to handle this appropriately,
but codecs that do not handle dynamic output buffers would
request enough buffers up to the requested size in this method
to avoid port reconfiguration on resolution changes.
Change-Id: I58d4aa8ef1359ea3472735bbe9140c3132039b3d
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 10192531
Related-to-bug: 7093648
Diffstat (limited to 'media/libmedia/IOMX.cpp')
-rw-r--r-- | media/libmedia/IOMX.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp index ef99f4f..71ce320 100644 --- a/media/libmedia/IOMX.cpp +++ b/media/libmedia/IOMX.cpp @@ -43,6 +43,7 @@ enum { CREATE_INPUT_SURFACE, SIGNAL_END_OF_INPUT_STREAM, STORE_META_DATA_IN_BUFFERS, + PREPARE_FOR_ADAPTIVE_PLAYBACK, ALLOC_BUFFER, ALLOC_BUFFER_WITH_BACKUP, FREE_BUFFER, @@ -351,6 +352,22 @@ public: return err; } + virtual status_t prepareForAdaptivePlayback( + node_id node, OMX_U32 port_index, OMX_BOOL enable, + OMX_U32 max_width, OMX_U32 max_height) { + Parcel data, reply; + data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); + data.writeIntPtr((intptr_t)node); + data.writeInt32(port_index); + data.writeInt32((int32_t)enable); + data.writeInt32(max_width); + data.writeInt32(max_height); + remote()->transact(PREPARE_FOR_ADAPTIVE_PLAYBACK, data, &reply); + + status_t err = reply.readInt32(); + return err; + } + virtual status_t allocateBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data) { @@ -770,6 +787,23 @@ status_t BnOMX::onTransact( return NO_ERROR; } + case PREPARE_FOR_ADAPTIVE_PLAYBACK: + { + CHECK_OMX_INTERFACE(IOMX, data, reply); + + node_id node = (void*)data.readIntPtr(); + OMX_U32 port_index = data.readInt32(); + OMX_BOOL enable = (OMX_BOOL)data.readInt32(); + OMX_U32 max_width = data.readInt32(); + OMX_U32 max_height = data.readInt32(); + + status_t err = prepareForAdaptivePlayback( + node, port_index, enable, max_width, max_height); + reply->writeInt32(err); + + return NO_ERROR; + } + case ALLOC_BUFFER: { CHECK_OMX_INTERFACE(IOMX, data, reply); |