mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-07 12:21:17 +00:00
omx: Add macro to initialize OpenMAX structures
This commit is contained in:
parent
decf765502
commit
35850e7233
2 changed files with 12 additions and 11 deletions
15
omx/gstomx.c
15
omx/gstomx.c
|
@ -399,10 +399,7 @@ gst_omx_component_new (GstObject * parent, const gchar * core_name,
|
|||
if (component_role) {
|
||||
OMX_PARAM_COMPONENTROLETYPE param;
|
||||
|
||||
memset (¶m, 0, sizeof (param));
|
||||
param.nSize = sizeof (param);
|
||||
param.nVersion.s.nVersionMajor = 1;
|
||||
param.nVersion.s.nVersionMinor = 1;
|
||||
GST_OMX_INIT_STRUCT (¶m);
|
||||
|
||||
g_strlcpy ((gchar *) param.cRole, component_role, sizeof (param.cRole));
|
||||
err =
|
||||
|
@ -600,10 +597,9 @@ gst_omx_component_add_port (GstOMXComponent * comp, guint32 index)
|
|||
|
||||
GST_DEBUG_OBJECT (comp->parent, "Adding port %u", index);
|
||||
|
||||
port_def.nSize = sizeof (port_def);
|
||||
port_def.nVersion.s.nVersionMajor = 1;
|
||||
port_def.nVersion.s.nVersionMinor = 1;
|
||||
GST_OMX_INIT_STRUCT (&port_def);
|
||||
port_def.nPortIndex = index;
|
||||
|
||||
err = OMX_GetParameter (comp->handle, OMX_IndexParamPortDefinition,
|
||||
&port_def);
|
||||
if (err != OMX_ErrorNone) {
|
||||
|
@ -750,10 +746,7 @@ gst_omx_port_get_port_definition (GstOMXPort * port,
|
|||
|
||||
comp = port->comp;
|
||||
|
||||
memset (port_def, 0, sizeof (*port_def));
|
||||
port_def->nSize = sizeof (*port_def);
|
||||
port_def->nVersion.s.nVersionMajor = 1;
|
||||
port_def->nVersion.s.nVersionMinor = 1;
|
||||
GST_OMX_INIT_STRUCT (port_def);
|
||||
port_def->nPortIndex = port->index;
|
||||
|
||||
OMX_GetParameter (comp->handle, OMX_IndexParamPortDefinition, port_def);
|
||||
|
|
|
@ -22,11 +22,19 @@
|
|||
#define __GST_OMX_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <string.h>
|
||||
#include <OMX_Core.h>
|
||||
#include <OMX_Component.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_OMX_INIT_STRUCT(st) G_STMT_START { \
|
||||
memset ((st), 0, sizeof ((*st))); \
|
||||
(st)->nSize = sizeof ((*st)); \
|
||||
(st)->nVersion.s.nVersionMajor = 1; \
|
||||
(st)->nVersion.s.nVersionMinor = 1; \
|
||||
} G_STMT_END
|
||||
|
||||
/* Different hacks that are required to work around
|
||||
* bugs in different OpenMAX implementations
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue