[vlc-commits] omxil: Implement OMX_GetExtensionIndex and OMX_SetConfig for IOMX
Martin Storsjö
git at videolan.org
Thu Sep 22 13:56:25 CEST 2011
vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Sep 22 14:12:36 2011 +0300| [3bd67a1e5ad4e8c6a50d7a311b217464c0b5f0a9] | committer: Jean-Baptiste Kempf
omxil: Implement OMX_GetExtensionIndex and OMX_SetConfig for IOMX
OMX_SetConfig still lacks a good way to figure out the size of
the passed struct/variable, for now hardcoded to the size of the
only use case.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3bd67a1e5ad4e8c6a50d7a311b217464c0b5f0a9
---
modules/codec/omxil/iomx.cpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/modules/codec/omxil/iomx.cpp b/modules/codec/omxil/iomx.cpp
index a07a92a..acdd054 100644
--- a/modules/codec/omxil/iomx.cpp
+++ b/modules/codec/omxil/iomx.cpp
@@ -248,6 +248,19 @@ static OMX_ERRORTYPE iomx_component_role_enum(OMX_HANDLETYPE component, OMX_U8 *
return OMX_ErrorInvalidComponentName;
}
+static OMX_ERRORTYPE iomx_get_extension_index(OMX_HANDLETYPE component, OMX_STRING parameter, OMX_INDEXTYPE *index)
+{
+ OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
+ return get_error(ctx->iomx->getExtensionIndex(node->node, parameter, index));
+}
+
+static OMX_ERRORTYPE iomx_set_config(OMX_HANDLETYPE component, OMX_INDEXTYPE index, OMX_PTR param)
+{
+ OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
+ /* TODO: Need a way to map index to param size */
+ return get_error(ctx->iomx->setConfig(node->node, index, param, sizeof(OMX_BOOL)));
+}
+
static OMX_ERRORTYPE iomx_get_handle(OMX_HANDLETYPE *handle_ptr, const char *component_name, OMX_PTR app_data, const OMX_CALLBACKTYPE *callbacks)
{
OMXNode* node = new OMXNode();
@@ -275,6 +288,8 @@ static OMX_ERRORTYPE iomx_get_handle(OMX_HANDLETYPE *handle_ptr, const char *com
component->GetState = iomx_get_state;
component->AllocateBuffer = iomx_allocate_buffer;
component->ComponentRoleEnum = iomx_component_role_enum;
+ component->GetExtensionIndex = iomx_get_extension_index;
+ component->SetConfig = iomx_set_config;
*handle_ptr = component;
node->handle = component;
More information about the vlc-commits
mailing list