aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/omx/vid_enc.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-06-10 02:14:18 +0100
committerEmil Velikov <[email protected]>2014-06-26 14:05:12 +0100
commitc35cf3400f57c5ed60df4c4a801a71fe897edfb8 (patch)
tree8b2f2ddf2d89edbd299825404ee55538912cab74 /src/gallium/state_trackers/omx/vid_enc.c
parent9a9742f92c9ad9d8af7fbddc96a18157f7945d61 (diff)
st/omx: avoid using dynamic vid_(enc|dec)_base and avc_(name|role)
Strictly speaking we should not have done this in the first place, as all of the above should be static across the system. Currently this may cause some minor issues, which will be resolved in the following patches, by providing a single library for the OMX api. Cleanup a few unneeded strcpy cases while we're around. Note: Make sure to rebuild the .omxregister file, by executing $ omxregister-bellagio If you have more than one omx library (libomx-radeonsi, libomx-r600), make sure to temporary move the unused one. By the end of the series there will be only one library that will be used for all hardware - r600, radeonsi and nouveau. Cc: Leo Liu <[email protected]> Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/omx/vid_enc.c')
-rw-r--r--src/gallium/state_trackers/omx/vid_enc.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c
index db4fc8f47e9..15eeb091225 100644
--- a/src/gallium/state_trackers/omx/vid_enc.c
+++ b/src/gallium/state_trackers/omx/vid_enc.c
@@ -96,16 +96,6 @@ static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE*
static void enc_ReleaseTasks(struct list_head *head);
-static void vid_enc_name(char str[OMX_MAX_STRINGNAME_SIZE])
-{
- snprintf(str, OMX_MAX_STRINGNAME_SIZE, OMX_VID_ENC_BASE_NAME, driver_descriptor.name);
-}
-
-static void vid_enc_name_avc(char str[OMX_MAX_STRINGNAME_SIZE])
-{
- snprintf(str, OMX_MAX_STRINGNAME_SIZE, OMX_VID_ENC_AVC_NAME, driver_descriptor.name);
-}
-
OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp)
{
comp->componentVersion.s.nVersionMajor = 0;
@@ -115,11 +105,7 @@ OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp)
comp->name_specific_length = 1;
comp->constructor = vid_enc_Constructor;
- comp->name = CALLOC(1, OMX_MAX_STRINGNAME_SIZE);
- if (!comp->name)
- return OMX_ErrorInsufficientResources;
-
- vid_enc_name(comp->name);
+ comp->name = OMX_VID_ENC_BASE_NAME;
comp->name_specific = CALLOC(1, sizeof(char *));
if (!comp->name_specific)
@@ -129,28 +115,15 @@ OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp)
if (!comp->role_specific)
goto error_arrays;
- comp->name_specific[0] = CALLOC(1, OMX_MAX_STRINGNAME_SIZE);
- if (!comp->name_specific[0])
- goto error_specific;
-
- vid_enc_name_avc(comp->name_specific[0]);
+ comp->name_specific[0] = OMX_VID_ENC_AVC_NAME;
- comp->role_specific[0] = CALLOC(1, OMX_MAX_STRINGNAME_SIZE);
- if (!comp->role_specific[0])
- goto error_specific;
-
- strcpy(comp->role_specific[0], OMX_VID_ENC_AVC_ROLE);
+ comp->role_specific[0] = OMX_VID_ENC_AVC_ROLE;
return OMX_ErrorNone;
-error_specific:
- FREE(comp->name_specific[0]);
- FREE(comp->role_specific[0]);
-
error_arrays:
FREE(comp->role_specific);
FREE(comp->name_specific);
- FREE(comp->name);
return OMX_ErrorInsufficientResources;
}