summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/omx/tizonia
diff options
context:
space:
mode:
authorGurkirpal Singh <[email protected]>2018-01-20 06:14:17 +0530
committerJulien Isorce <[email protected]>2018-03-06 14:29:42 +0000
commit83d4a5d5aea5a8a05be2eb3116d2cf3acd201876 (patch)
treef8ccf96217e9272bad9bb1e93e66d53595f34f85 /src/gallium/state_trackers/omx/tizonia
parent430ccdbcb9155c6f3f73451047ee70f4f10f7ae5 (diff)
st/omx/tizonia: Add H.264 decoder
v2: Refactor out screen functions to st/omx Example Gstreamer pipeline : gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! videoconvert ! ximagesink Acked-by: Leo Liu <[email protected]> Reviewed-by: Julien Isorce <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/omx/tizonia')
-rw-r--r--src/gallium/state_trackers/omx/tizonia/Makefile.sources10
-rw-r--r--src/gallium/state_trackers/omx/tizonia/entrypoint.c43
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264d.c176
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264d.h40
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264dinport.c147
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264dinport.h31
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264dinport_decls.h48
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264dprc.c519
-rw-r--r--src/gallium/state_trackers/omx/tizonia/h264dprc.h31
-rw-r--r--src/gallium/state_trackers/omx/tizonia/names.h30
10 files changed, 1074 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources
index de6fcf926bd..41b7a3d4170 100644
--- a/src/gallium/state_trackers/omx/tizonia/Makefile.sources
+++ b/src/gallium/state_trackers/omx/tizonia/Makefile.sources
@@ -1,3 +1,11 @@
C_SOURCES := \
entrypoint.c \
- entrypoint.h
+ entrypoint.h \
+ h264d.c \
+ h264d.h \
+ h264dprc.c \
+ h264dprc.h \
+ h264dinport.c \
+ h264dinport.h \
+ h264dinport_decls.h \
+ names.h
diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c
index c89bdfdb10a..df81ee3f517 100644
--- a/src/gallium/state_trackers/omx/tizonia/entrypoint.c
+++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c
@@ -28,10 +28,53 @@
#include <tizplatform.h>
#include <tizkernel.h>
#include <tizscheduler.h>
+#include <tizport.h>
+#include <tizport_decls.h>
+#include <tizvideoport.h>
+#include <tizvideoport_decls.h>
+#include "vid_dec_h264_common.h"
#include "entrypoint.h"
+#include "h264d.h"
+#include "h264dprc.h"
+#include "h264dinport.h"
+#include "names.h"
OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl)
{
+ tiz_role_factory_t h264d_role;
+ const tiz_role_factory_t * rf_list[] = {&h264d_role};
+ tiz_type_factory_t h264dprc_type;
+ tiz_type_factory_t h264d_inport_type;
+ const tiz_type_factory_t * tf_list[] = {&h264dprc_type, &h264d_inport_type};
+
+ /* Settings for roles */
+ strcpy ((OMX_STRING) h264d_role.role, OMX_VID_DEC_AVC_ROLE);
+ h264d_role.pf_cport = instantiate_h264d_config_port;
+ h264d_role.pf_port[0] = instantiate_h264d_input_port;
+ h264d_role.pf_port[1] = instantiate_h264d_output_port;
+ h264d_role.nports = 2;
+ h264d_role.pf_proc = instantiate_h264d_processor;
+
+ /* Settings for classes */
+ strcpy ((OMX_STRING) h264dprc_type.class_name, "h264dprc_class");
+ h264dprc_type.pf_class_init = h264d_prc_class_init;
+ strcpy ((OMX_STRING) h264dprc_type.object_name, "h264dprc");
+ h264dprc_type.pf_object_init = h264d_prc_init;
+
+ strcpy ((OMX_STRING) h264d_inport_type.class_name, "h264dinport_class");
+ h264d_inport_type.pf_class_init = h264d_inport_class_init;
+ strcpy ((OMX_STRING) h264d_inport_type.object_name, "h264dinport");
+ h264d_inport_type.pf_object_init = h264d_inport_init;
+
+ /* Initialize the component infrastructure */
+ tiz_comp_init (ap_hdl, OMX_VID_COMP_NAME);
+
+ /* Classes need to be registered first */
+ tiz_comp_register_types (ap_hdl, tf_list, 2);
+
+ /* Register the component roles */
+ tiz_comp_register_roles (ap_hdl, rf_list, 1);
+
return OMX_ErrorNone;
}
diff --git a/src/gallium/state_trackers/omx/tizonia/h264d.c b/src/gallium/state_trackers/omx/tizonia/h264d.c
new file mode 100644
index 00000000000..92019a7a4bd
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264d.c
@@ -0,0 +1,176 @@
+/**************************************************************************
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <tizport_decls.h>
+
+#include "vid_dec_h264_common.h"
+
+#include "h264dprc.h"
+#include "h264d.h"
+#include "names.h"
+
+static OMX_VERSIONTYPE h264_decoder_version = {{0, 0, 0, 1}};
+
+OMX_PTR instantiate_h264d_input_port(OMX_HANDLETYPE ap_hdl)
+{
+ OMX_VIDEO_PORTDEFINITIONTYPE portdef;
+ OMX_VIDEO_PARAM_AVCTYPE avctype;
+ OMX_VIDEO_CODINGTYPE encodings[] = {
+ OMX_VIDEO_CodingAVC,
+ OMX_VIDEO_CodingMax
+ };
+ OMX_COLOR_FORMATTYPE formats[] = {
+ OMX_COLOR_FormatUnused,
+ OMX_COLOR_FormatMax
+ };
+ tiz_port_options_t avc_port_opts = {
+ OMX_PortDomainVideo,
+ OMX_DirInput,
+ OMX_VID_DEC_AVC_INPUT_PORT_MIN_BUF_COUNT,
+ OMX_VID_DEC_AVC_PORT_MIN_INPUT_BUF_SIZE,
+ OMX_VID_DEC_AVC_PORT_NONCONTIGUOUS,
+ OMX_VID_DEC_AVC_PORT_ALIGNMENT,
+ OMX_VID_DEC_AVC_PORT_SUPPLIERPREF,
+ {OMX_VID_DEC_AVC_INPUT_PORT_INDEX, NULL, NULL, NULL},
+ 1 /* slave port */
+ };
+ OMX_VIDEO_AVCLEVELTYPE levels[] = {
+ OMX_VIDEO_AVCLevel1,
+ OMX_VIDEO_AVCLevel1b,
+ OMX_VIDEO_AVCLevel11,
+ OMX_VIDEO_AVCLevel12,
+ OMX_VIDEO_AVCLevel13,
+ OMX_VIDEO_AVCLevel2,
+ OMX_VIDEO_AVCLevel21,
+ OMX_VIDEO_AVCLevel22,
+ OMX_VIDEO_AVCLevel3,
+ OMX_VIDEO_AVCLevel31,
+ OMX_VIDEO_AVCLevel32,
+ OMX_VIDEO_AVCLevel4,
+ OMX_VIDEO_AVCLevel41,
+ OMX_VIDEO_AVCLevel42,
+ OMX_VIDEO_AVCLevel5,
+ OMX_VIDEO_AVCLevel51,
+ OMX_VIDEO_AVCLevelMax
+ };
+
+ portdef.pNativeRender = NULL;
+ portdef.nFrameWidth = OMX_VID_DEC_AVC_DEFAULT_FRAME_WIDTH;
+ portdef.nFrameHeight = OMX_VID_DEC_AVC_DEFAULT_FRAME_HEIGHT;
+ portdef.nStride = 0;
+ portdef.nSliceHeight = 0;
+ portdef.nBitrate = 64000;
+ portdef.xFramerate = OMX_VID_DEC_AVC_DEFAULT_FRAME_RATE;
+ portdef.bFlagErrorConcealment = OMX_FALSE;
+ portdef.eCompressionFormat = OMX_VIDEO_CodingAVC;
+ portdef.eColorFormat = OMX_COLOR_FormatUnused;
+ portdef.pNativeWindow = NULL;
+
+ avctype.nSize = sizeof (OMX_VIDEO_PARAM_AVCTYPE);
+ avctype.nVersion.nVersion = OMX_VERSION;
+ avctype.nPortIndex = OMX_VID_DEC_AVC_INPUT_PORT_INDEX;
+ avctype.eProfile = OMX_VIDEO_AVCProfileHigh;
+ /* Encoder related, decide if need to initialise these */
+ avctype.nSliceHeaderSpacing = 0;
+ avctype.nPFrames = 0;
+ avctype.nBFrames = 0;
+ avctype.bUseHadamard = OMX_FALSE;
+ avctype.nRefFrames = 1;
+ avctype.nRefIdx10ActiveMinus1 = 1;
+ avctype.nRefIdx11ActiveMinus1 = 0;
+ avctype.bEnableUEP = OMX_FALSE;
+ avctype.bEnableFMO = OMX_FALSE;
+ avctype.bEnableASO = OMX_FALSE;
+ avctype.bEnableRS = OMX_FALSE;
+ avctype.eLevel = OMX_VIDEO_AVCLevel51;
+ avctype.nAllowedPictureTypes = 2;
+ avctype.bFrameMBsOnly = OMX_FALSE;
+ avctype.bMBAFF = OMX_FALSE;
+ avctype.bEntropyCodingCABAC = OMX_FALSE;
+ avctype.bWeightedPPrediction = OMX_FALSE;
+ avctype.nWeightedBipredicitonMode = 0;
+ avctype.bconstIpred = OMX_FALSE;
+ avctype.bDirect8x8Inference = OMX_FALSE;
+ avctype.bDirectSpatialTemporal = OMX_FALSE;
+ avctype.nCabacInitIdc = 0;
+ avctype.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable;
+
+ return factory_new (tiz_get_type(ap_hdl, "h264dinport"),
+ &avc_port_opts, &portdef,
+ &encodings, &formats, &avctype, &levels,
+ NULL /* OMX_VIDEO_PARAM_BITRATETYPE */,
+ NULL /* OMX_VIDEO_PARAM_QUANTIZATIONTYPE */);
+}
+
+OMX_PTR instantiate_h264d_output_port(OMX_HANDLETYPE ap_hdl)
+{
+ OMX_VIDEO_PORTDEFINITIONTYPE portdef;
+ OMX_VIDEO_CODINGTYPE encodings[] = {
+ OMX_VIDEO_CodingUnused,
+ OMX_VIDEO_CodingMax
+ };
+ OMX_COLOR_FORMATTYPE formats[] = {
+ OMX_COLOR_FormatYUV420SemiPlanar,
+ OMX_COLOR_FormatMax
+ };
+ tiz_port_options_t rawvideo_port_opts = {
+ OMX_PortDomainVideo,
+ OMX_DirOutput,
+ OMX_VID_DEC_AVC_OUTPUT_PORT_MIN_BUF_COUNT,
+ OMX_VID_DEC_AVC_PORT_MIN_OUTPUT_BUF_SIZE,
+ OMX_VID_DEC_AVC_PORT_NONCONTIGUOUS,
+ OMX_VID_DEC_AVC_PORT_ALIGNMENT,
+ OMX_VID_DEC_AVC_PORT_SUPPLIERPREF,
+ {OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, NULL, NULL, NULL},
+ 0 /* Master port */
+ };
+
+ portdef.pNativeRender = NULL;
+ portdef.nFrameWidth = OMX_VID_DEC_AVC_DEFAULT_FRAME_WIDTH;
+ portdef.nFrameHeight = OMX_VID_DEC_AVC_DEFAULT_FRAME_HEIGHT;
+ portdef.nStride = 0;
+ portdef.nSliceHeight = 0;
+ portdef.nBitrate = 64000;
+ portdef.xFramerate = OMX_VID_DEC_AVC_DEFAULT_FRAME_RATE;
+ portdef.bFlagErrorConcealment = OMX_FALSE;
+ portdef.eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portdef.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+ portdef.pNativeWindow = NULL;
+
+ return factory_new(tiz_get_type(ap_hdl, "tizvideoport"),
+ &rawvideo_port_opts, &portdef,
+ &encodings, &formats);
+}
+
+OMX_PTR instantiate_h264d_config_port(OMX_HANDLETYPE ap_hdl)
+{
+ return factory_new(tiz_get_type(ap_hdl, "tizconfigport"),
+ NULL, /* this port does not take options */
+ OMX_VID_COMP_NAME, h264_decoder_version);
+}
+
+OMX_PTR instantiate_h264d_processor(OMX_HANDLETYPE ap_hdl)
+{
+ return factory_new(tiz_get_type(ap_hdl, "h264dprc"));
+}
diff --git a/src/gallium/state_trackers/omx/tizonia/h264d.h b/src/gallium/state_trackers/omx/tizonia/h264d.h
new file mode 100644
index 00000000000..1733425d45c
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264d.h
@@ -0,0 +1,40 @@
+/**************************************************************************
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef H264D_H
+#define H264D_H
+
+#include <OMX_Core.h>
+#include <OMX_Types.h>
+#include <OMX_Video.h>
+
+OMX_PTR instantiate_h264d_config_port(OMX_HANDLETYPE ap_hdl);
+OMX_PTR instantiate_h264d_input_port(OMX_HANDLETYPE ap_hdl);
+OMX_PTR instantiate_h264d_output_port(OMX_HANDLETYPE ap_hdl);
+OMX_PTR instantiate_h264d_processor(OMX_HANDLETYPE ap_hdl);
+
+#endif /* H264D_H */
diff --git a/src/gallium/state_trackers/omx/tizonia/h264dinport.c b/src/gallium/state_trackers/omx/tizonia/h264dinport.c
new file mode 100644
index 00000000000..858ae761560
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264dinport.c
@@ -0,0 +1,147 @@
+/**************************************************************************
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <assert.h>
+#include <string.h>
+#include <limits.h>
+
+#include <tizplatform.h>
+#include <tizkernel.h>
+
+#include "vl/vl_winsys.h"
+
+#include "h264d.h"
+#include "h264dinport.h"
+#include "h264dinport_decls.h"
+#include "vid_dec_common.h"
+
+/*
+ * h264dinport class
+ */
+
+static void * h264d_inport_ctor(void * ap_obj, va_list * app)
+{
+ return super_ctor(typeOf(ap_obj, "h264dinport"), ap_obj, app);
+}
+
+static void * h264d_inport_dtor(void * ap_obj)
+{
+ return super_dtor(typeOf(ap_obj, "h264dinport"), ap_obj);
+}
+
+/*
+ * from tiz_api
+ */
+
+static OMX_ERRORTYPE h264d_inport_SetParameter(const void * ap_obj, OMX_HANDLETYPE ap_hdl,
+ OMX_INDEXTYPE a_index, OMX_PTR ap_struct)
+{
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+
+ assert(ap_obj);
+ assert(ap_hdl);
+ assert(ap_struct);
+
+ if (a_index == OMX_IndexParamPortDefinition) {
+ vid_dec_PrivateType * p_prc = tiz_get_prc(ap_hdl);
+ OMX_VIDEO_PORTDEFINITIONTYPE * p_def = &(p_prc->out_port_def_.format.video);
+ OMX_PARAM_PORTDEFINITIONTYPE * i_def = (OMX_PARAM_PORTDEFINITIONTYPE *) ap_struct;
+
+ /* Make changes only if there is a resolution change */
+ if ((p_def->nFrameWidth == i_def->format.video.nFrameWidth) &&
+ (p_def->nFrameHeight == i_def->format.video.nFrameHeight) &&
+ (p_def->eCompressionFormat == i_def->format.video.eCompressionFormat))
+ return err;
+
+ /* Set some default values if not set */
+ if (i_def->format.video.nStride == 0)
+ i_def->format.video.nStride = i_def->format.video.nFrameWidth;
+ if (i_def->format.video.nSliceHeight == 0)
+ i_def->format.video.nSliceHeight = i_def->format.video.nFrameHeight;
+
+ err = super_SetParameter(typeOf (ap_obj, "h264dinport"), ap_obj,
+ ap_hdl, a_index, ap_struct);
+ if (err == OMX_ErrorNone) {
+ tiz_port_t * p_obj = (tiz_port_t *) ap_obj;
+
+ /* Set desired buffer size that will be used when allocating input buffers */
+ p_obj->portdef_.nBufferSize = i_def->format.video.nFrameWidth * i_def->format.video.nFrameHeight * 512 / (16*16);
+
+ /* Get a locally copy of port def. Useful for the early return above */
+ tiz_check_omx(tiz_api_GetParameter(tiz_get_krn(handleOf(p_prc)), handleOf(p_prc),
+ OMX_IndexParamPortDefinition, &(p_prc->out_port_def_)));
+ }
+ }
+
+ return err;
+}
+
+/*
+ * h264dinport_class
+ */
+
+static void * h264d_inport_class_ctor(void * ap_obj, va_list * app)
+{
+ /* NOTE: Class methods might be added in the future. None for now. */
+ return super_ctor (typeOf (ap_obj, "h264dinport_class"), ap_obj, app);
+}
+
+/*
+ * initialization
+ */
+
+void * h264d_inport_class_init(void * ap_tos, void * ap_hdl)
+{
+ void * tizavcport = tiz_get_type(ap_hdl, "tizavcport");
+ void * h264dinport_class
+ = factory_new(classOf(tizavcport), "h264dinport_class",
+ classOf(tizavcport), sizeof(h264d_inport_class_t),
+ ap_tos, ap_hdl, ctor, h264d_inport_class_ctor, 0);
+ return h264dinport_class;
+}
+
+void * h264d_inport_init(void * ap_tos, void * ap_hdl)
+{
+ void * tizavcport = tiz_get_type (ap_hdl, "tizavcport");
+ void * h264dinport_class = tiz_get_type (ap_hdl, "h264dinport_class");
+ void * h264dinport = factory_new
+ /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
+ (h264dinport_class, "h264dinport", tizavcport,
+ sizeof (h264d_inport_t),
+ /* TIZ_CLASS_COMMENT: class constructor */
+ ap_tos, ap_hdl,
+ /* TIZ_CLASS_COMMENT: class constructor */
+ ctor, h264d_inport_ctor,
+ /* TIZ_CLASS_COMMENT: class destructor */
+ dtor, h264d_inport_dtor,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_api_SetParameter, h264d_inport_SetParameter,
+ /* TIZ_CLASS_COMMENT: stop value*/
+ 0);
+
+ return h264dinport;
+}
diff --git a/src/gallium/state_trackers/omx/tizonia/h264dinport.h b/src/gallium/state_trackers/omx/tizonia/h264dinport.h
new file mode 100644
index 00000000000..f158e4e1038
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264dinport.h
@@ -0,0 +1,31 @@
+/**************************************************************************
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef H264DINPORT_H
+#define H264DINPORT_H
+
+void * h264d_inport_class_init(void * ap_tos, void * ap_hdl);
+void * h264d_inport_init(void * ap_tos, void * ap_hdl);
+
+#endif /* H264DINPORT_H */
diff --git a/src/gallium/state_trackers/omx/tizonia/h264dinport_decls.h b/src/gallium/state_trackers/omx/tizonia/h264dinport_decls.h
new file mode 100644
index 00000000000..0194f6e3d09
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264dinport_decls.h
@@ -0,0 +1,48 @@
+/**************************************************************************
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef H264DINPORT_DECLS_H
+#define H264DINPORT_DECLS_H
+
+#include <OMX_TizoniaExt.h>
+#include <OMX_Types.h>
+
+#include <tizavcport_decls.h>
+
+typedef struct h264d_inport h264d_inport_t;
+struct h264d_inport
+{
+ /* Object */
+ const tiz_avcport_t _;
+};
+
+typedef struct h264d_inport_class h264d_inport_class_t;
+struct h264d_inport_class
+{
+ /* Class */
+ const tiz_avcport_class_t _;
+ /* NOTE: Class methods might be added in the future */
+};
+
+#endif /* H264DINPORT_DECLS_H */
diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.c b/src/gallium/state_trackers/omx/tizonia/h264dprc.c
new file mode 100644
index 00000000000..a55e3e9782b
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.c
@@ -0,0 +1,519 @@
+/**************************************************************************
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <tizplatform.h>
+#include <tizkernel.h>
+#include <tizutils.h>
+
+#include "entrypoint.h"
+#include "h264d.h"
+#include "h264dprc.h"
+#include "vid_omx_common.h"
+#include "vid_dec_common.h"
+#include "vid_dec_h264_common.h"
+
+#include "vl/vl_video_buffer.h"
+#include "vl/vl_compositor.h"
+#include "util/u_surface.h"
+
+unsigned dec_frame_delta;
+
+static void release_input_headers(vid_dec_PrivateType* priv) {
+ int i;
+ for (i = 0; i < priv->num_in_buffers; i++) {
+ assert(!priv->in_port_disabled_);
+ if (priv->in_buffers[i]->pInputPortPrivate) {
+ vid_dec_FreeInputPortPrivate(priv->in_buffers[i]);
+ }
+ (void) tiz_krn_release_buffer (tiz_get_krn (handleOf (priv)),
+ OMX_VID_DEC_AVC_INPUT_PORT_INDEX,
+ priv->in_buffers[i]);
+ priv->in_buffers[i] = NULL;
+ }
+ priv->p_inhdr_ = NULL;
+ priv->num_in_buffers = 0;
+}
+
+static void release_output_header(vid_dec_PrivateType* priv) {
+ if (priv->p_outhdr_) {
+ assert(!priv->out_port_disabled_);
+ (void) tiz_krn_release_buffer (tiz_get_krn (handleOf (priv)),
+ OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX,
+ priv->p_outhdr_);
+ priv->p_outhdr_ = NULL;
+ }
+}
+
+static OMX_ERRORTYPE h264d_release_all_headers(vid_dec_PrivateType* priv)
+{
+ assert(priv);
+ release_input_headers(priv);
+ release_output_header(priv);
+
+ return OMX_ErrorNone;
+}
+
+static void h264d_buffer_emptied(vid_dec_PrivateType* priv, OMX_BUFFERHEADERTYPE * p_hdr)
+{
+ assert(priv);
+ assert(priv->in_buffers[0] == p_hdr);
+
+ if (!priv->out_port_disabled_) {
+ assert (p_hdr->nFilledLen == 0);
+ p_hdr->nOffset = 0;
+
+ if ((p_hdr->nFlags & OMX_BUFFERFLAG_EOS) != 0) {
+ priv->eos_ = true;
+ }
+
+ (void) tiz_krn_release_buffer (tiz_get_krn (handleOf (priv)), 0, p_hdr);
+ priv->p_inhdr_ = NULL;
+ priv->in_buffers[0] = NULL;
+ }
+}
+
+static void h264d_buffer_filled(vid_dec_PrivateType* priv, OMX_BUFFERHEADERTYPE * p_hdr)
+{
+ assert(priv);
+ assert(p_hdr);
+ assert(priv->p_outhdr_ == p_hdr);
+
+ if (!priv->in_port_disabled_) {
+ p_hdr->nOffset = 0;
+
+ if (priv->eos_) {
+ /* EOS has been received and all the input data has been consumed
+ * already, so its time to propagate the EOS flag */
+ priv->p_outhdr_->nFlags |= OMX_BUFFERFLAG_EOS;
+ priv->eos_ = false;
+ }
+
+ (void) tiz_krn_release_buffer(tiz_get_krn (handleOf (priv)),
+ OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX,
+ p_hdr);
+ priv->p_outhdr_ = NULL;
+ }
+}
+
+static bool h264d_shift_buffers_left(vid_dec_PrivateType* priv) {
+ if (--priv->num_in_buffers) {
+ priv->in_buffers[0] = priv->in_buffers[1];
+ priv->sizes[0] = priv->sizes[1] - dec_frame_delta;
+ priv->inputs[0] = priv->inputs[1] + dec_frame_delta;
+ priv->timestamps[0] = priv->timestamps[1];
+
+ return true;
+ }
+ return false;
+}
+
+static OMX_BUFFERHEADERTYPE * get_input_buffer(vid_dec_PrivateType* priv) {
+ assert(priv);
+
+ if (priv->in_port_disabled_) {
+ return NULL;
+ }
+
+ if (priv->num_in_buffers > 1) {
+ /* The input buffer wasn't cleared last time. */
+ h264d_buffer_emptied(priv, priv->in_buffers[0]);
+ if (priv->in_buffers[0]) {
+ /* Failed to release buffer */
+ return NULL;
+ }
+ h264d_shift_buffers_left(priv);
+ }
+
+ /* Decode_frame expects new buffers each time */
+ assert(priv->p_inhdr_ || priv->first_buf_in_frame);
+ tiz_krn_claim_buffer(tiz_get_krn (handleOf (priv)),
+ OMX_VID_DEC_AVC_INPUT_PORT_INDEX, 0,
+ &priv->p_inhdr_);
+ return priv->p_inhdr_;
+}
+
+static OMX_BUFFERHEADERTYPE * get_output_buffer(vid_dec_PrivateType* priv) {
+ assert (priv);
+
+ if (priv->out_port_disabled_) {
+ return NULL;
+ }
+
+ if (!priv->p_outhdr_) {
+ tiz_krn_claim_buffer(tiz_get_krn (handleOf (priv)),
+ OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, 0,
+ &priv->p_outhdr_);
+ }
+ return priv->p_outhdr_;
+}
+
+static void reset_stream_parameters(vid_dec_PrivateType* apriv)
+{
+ assert(apriv);
+ TIZ_INIT_OMX_PORT_STRUCT(apriv->out_port_def_,
+ OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX);
+
+ tiz_api_GetParameter (tiz_get_krn (handleOf (apriv)), handleOf (apriv),
+ OMX_IndexParamPortDefinition, &(apriv->out_port_def_));
+
+ apriv->p_inhdr_ = 0;
+ apriv->num_in_buffers = 0;
+ apriv->first_buf_in_frame = true;
+ apriv->eos_ = false;
+ apriv->frame_finished = false;
+ apriv->frame_started = false;
+ apriv->picture.h264.field_order_cnt[0] = apriv->picture.h264.field_order_cnt[1] = INT_MAX;
+ apriv->slice = NULL;
+}
+
+/* Replacement for bellagio's omx_base_filter_BufferMgmtFunction */
+static void h264d_manage_buffers(vid_dec_PrivateType* priv) {
+ bool next_is_eos = priv->num_in_buffers == 2 ? !!(priv->in_buffers[1]->nFlags & OMX_BUFFERFLAG_EOS) : false;
+ vid_dec_FrameDecoded_common(priv, priv->in_buffers[0], priv->p_outhdr_);
+
+ priv->p_outhdr_->nTimeStamp = priv->in_buffers[0]->nTimeStamp;
+
+ /* Realase output buffer if filled or eos
+ Keep if two input buffers are being decoded */
+ if ((!next_is_eos) && ((priv->p_outhdr_->nFilledLen > 0) || priv->eos_)) {
+ h264d_buffer_filled(priv, priv->p_outhdr_);
+ }
+
+ /* Release input buffer if possible */
+ if (priv->in_buffers[0]->nFilledLen == 0) {
+ h264d_buffer_emptied(priv, priv->in_buffers[0]);
+ }
+}
+
+static OMX_ERRORTYPE decode_frame(vid_dec_PrivateType*priv,
+ OMX_BUFFERHEADERTYPE *in_buf)
+{
+ unsigned i = priv->num_in_buffers++;
+ priv->in_buffers[i] = in_buf;
+ priv->sizes[i] = in_buf->nFilledLen;
+ priv->inputs[i] = in_buf->pBuffer;
+ priv->timestamps[i] = in_buf->nTimeStamp;
+
+ while (priv->num_in_buffers > (!!(in_buf->nFlags & OMX_BUFFERFLAG_EOS) ? 0 : 1)) {
+ priv->eos_ = !!(priv->in_buffers[0]->nFlags & OMX_BUFFERFLAG_EOS);
+ unsigned min_bits_left = priv->eos_ ? 32 : MAX2(in_buf->nFilledLen * 8, 32);
+ struct vl_vlc vlc;
+
+ vl_vlc_init(&vlc, priv->num_in_buffers, priv->inputs, priv->sizes);
+
+ if (priv->slice)
+ priv->bytes_left = vl_vlc_bits_left(&vlc) / 8;
+
+ while (vl_vlc_bits_left (&vlc) > min_bits_left) {
+ vid_dec_h264_Decode(priv, &vlc, min_bits_left);
+ vl_vlc_fillbits(&vlc);
+ }
+
+ if (priv->slice) {
+ unsigned bytes = priv->bytes_left - vl_vlc_bits_left(&vlc) / 8;
+
+ priv->codec->decode_bitstream(priv->codec, priv->target, &priv->picture.base,
+ 1, &priv->slice, &bytes);
+
+ if (priv->num_in_buffers)
+ priv->slice = priv->inputs[1];
+ else
+ priv->slice = NULL;
+ }
+
+ if (priv->eos_ && priv->frame_started)
+ vid_dec_h264_EndFrame(priv);
+
+ if (priv->frame_finished) {
+ priv->frame_finished = false;
+ h264d_manage_buffers(priv);
+ } else if (priv->eos_) {
+ vid_dec_FreeInputPortPrivate(priv->in_buffers[0]);
+ h264d_manage_buffers(priv);
+ } else {
+ priv->in_buffers[0]->nFilledLen = 0;
+ h264d_buffer_emptied(priv, priv->in_buffers[0]);
+ }
+
+ if (priv->out_port_disabled_) {
+ /* In case out port is disabled, h264d_buffer_emptied will fail to release input port.
+ * We need to wait before shifting the buffers in that case and check in
+ * get_input_buffer when out port is enabled to release and shift the buffers.
+ * Infinite looping occurs if buffer is not released */
+ if (priv->num_in_buffers == 2) {
+ /* Set the delta value for use in get_input_buffer before exiting */
+ dec_frame_delta = MIN2((min_bits_left - vl_vlc_bits_left(&vlc)) / 8, priv->sizes[1]);
+ }
+ break;
+ }
+
+ h264d_shift_buffers_left(priv);
+ }
+
+ return OMX_ErrorNone;
+}
+
+/*
+ * h264dprc
+ */
+
+static void * h264d_prc_ctor(void *ap_obj, va_list * app)
+{
+ vid_dec_PrivateType*priv = super_ctor(typeOf (ap_obj, "h264dprc"), ap_obj, app);
+ assert(priv);
+ priv->p_inhdr_ = 0;
+ priv->p_outhdr_ = 0;
+ priv->first_buf_in_frame = true;
+ priv->eos_ = false;
+ priv->in_port_disabled_ = false;
+ priv->out_port_disabled_ = false;
+ priv->picture.base.profile = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
+ priv->profile = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
+ reset_stream_parameters(priv);
+
+ return priv;
+}
+
+static void * h264d_prc_dtor(void *ap_obj)
+{
+ return super_dtor(typeOf(ap_obj, "h264dprc"), ap_obj);
+}
+
+static OMX_ERRORTYPE h264d_prc_allocate_resources(void *ap_obj, OMX_U32 a_pid)
+{
+ vid_dec_PrivateType*priv = ap_obj;
+ struct pipe_screen *screen;
+
+ assert (priv);
+
+ priv->screen = omx_get_screen();
+ if (!priv->screen)
+ return OMX_ErrorInsufficientResources;
+
+ screen = priv->screen->pscreen;
+ priv->pipe = screen->context_create(screen, priv->screen, 0);
+ if (!priv->pipe)
+ return OMX_ErrorInsufficientResources;
+
+ if (!vl_compositor_init(&priv->compositor, priv->pipe)) {
+ priv->pipe->destroy(priv->pipe);
+ priv->pipe = NULL;
+ return OMX_ErrorInsufficientResources;
+ }
+
+ if (!vl_compositor_init_state(&priv->cstate, priv->pipe)) {
+ vl_compositor_cleanup(&priv->compositor);
+ priv->pipe->destroy(priv->pipe);
+ priv->pipe = NULL;
+ return OMX_ErrorInsufficientResources;
+ }
+
+ LIST_INITHEAD(&priv->codec_data.h264.dpb_list);
+
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_deallocate_resources(void *ap_obj)
+{
+ vid_dec_PrivateType*priv = ap_obj;
+ assert(priv);
+
+ if (priv->pipe) {
+ vl_compositor_cleanup_state(&priv->cstate);
+ vl_compositor_cleanup(&priv->compositor);
+ priv->pipe->destroy(priv->pipe);
+ }
+
+ if (priv->screen)
+ omx_put_screen();
+
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_prepare_to_transfer(void *ap_obj, OMX_U32 a_pid)
+{
+ vid_dec_PrivateType*priv = ap_obj;
+ assert(priv);
+
+ TIZ_INIT_OMX_PORT_STRUCT(priv->out_port_def_,
+ OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX);
+ tiz_check_omx(
+ tiz_api_GetParameter(tiz_get_krn(handleOf(priv)), handleOf(priv),
+ OMX_IndexParamPortDefinition, &(priv->out_port_def_)));
+
+ priv->first_buf_in_frame = true;
+ priv->eos_ = false;
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_transfer_and_process(void *ap_obj, OMX_U32 a_pid)
+{
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_stop_and_return(void *ap_obj)
+{
+ vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
+ return h264d_release_all_headers (priv);
+}
+
+static OMX_ERRORTYPE h264d_prc_buffers_ready(const void *ap_obj)
+{
+ vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
+ OMX_BUFFERHEADERTYPE *in_buf = NULL;
+ OMX_BUFFERHEADERTYPE *out_buf = NULL;
+
+ assert(priv);
+
+ /* Set parameters if start of stream */
+ if (!priv->eos_ && priv->first_buf_in_frame && (in_buf = get_input_buffer(priv))) {
+ decode_frame(priv, in_buf);
+ }
+
+ /* Don't get input buffer if output buffer not found */
+ while (!priv->eos_ && (out_buf = get_output_buffer(priv)) && (in_buf = get_input_buffer(priv))) {
+ if (!priv->out_port_disabled_) {
+ decode_frame(priv, in_buf);
+ }
+ }
+
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_port_flush(const void *ap_obj, OMX_U32 a_pid)
+{
+ vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_INPUT_PORT_INDEX == a_pid) {
+ release_input_headers(priv);
+ reset_stream_parameters(priv);
+ }
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX == a_pid) {
+ release_output_header(priv);
+ }
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_port_disable(const void *ap_obj, OMX_U32 a_pid)
+{
+ vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
+ assert(priv);
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_INPUT_PORT_INDEX == a_pid) {
+ /* Release all buffers */
+ h264d_release_all_headers(priv);
+ reset_stream_parameters(priv);
+ priv->in_port_disabled_ = true;
+ }
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX == a_pid) {
+ release_output_header(priv);
+ priv->out_port_disabled_ = true;
+ }
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE h264d_prc_port_enable(const void *ap_obj, OMX_U32 a_pid)
+{
+ vid_dec_PrivateType* priv = (vid_dec_PrivateType*) ap_obj;
+ assert(priv);
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_INPUT_PORT_INDEX == a_pid) {
+ if (priv->in_port_disabled_) {
+ reset_stream_parameters(priv);
+ priv->in_port_disabled_ = false;
+ }
+ }
+ if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX == a_pid) {
+ priv->out_port_disabled_ = false;
+ }
+ return OMX_ErrorNone;
+}
+
+/*
+ * h264d_prc_class
+ */
+
+static void * h264d_prc_class_ctor(void *ap_obj, va_list * app)
+{
+ /* NOTE: Class methods might be added in the future. None for now. */
+ return super_ctor(typeOf(ap_obj, "h264dprc_class"), ap_obj, app);
+}
+
+/*
+ * initialization
+ */
+
+void * h264d_prc_class_init(void * ap_tos, void * ap_hdl)
+{
+ void * tizprc = tiz_get_type(ap_hdl, "tizprc");
+ void * h264dprc_class = factory_new
+ /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
+ (classOf(tizprc), "h264dprc_class", classOf(tizprc),
+ sizeof(h264d_prc_class_t),
+ /* TIZ_CLASS_COMMENT: */
+ ap_tos, ap_hdl,
+ /* TIZ_CLASS_COMMENT: class constructor */
+ ctor, h264d_prc_class_ctor,
+ /* TIZ_CLASS_COMMENT: stop value*/
+ 0);
+ return h264dprc_class;
+}
+
+void * h264d_prc_init(void * ap_tos, void * ap_hdl)
+{
+ void * tizprc = tiz_get_type(ap_hdl, "tizprc");
+ void * h264dprc_class = tiz_get_type(ap_hdl, "h264dprc_class");
+ TIZ_LOG_CLASS (h264dprc_class);
+ void * h264dprc = factory_new
+ /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
+ (h264dprc_class, "h264dprc", tizprc, sizeof(vid_dec_PrivateType),
+ /* TIZ_CLASS_COMMENT: */
+ ap_tos, ap_hdl,
+ /* TIZ_CLASS_COMMENT: class constructor */
+ ctor, h264d_prc_ctor,
+ /* TIZ_CLASS_COMMENT: class destructor */
+ dtor, h264d_prc_dtor,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_srv_allocate_resources, h264d_prc_allocate_resources,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_srv_deallocate_resources, h264d_prc_deallocate_resources,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_srv_prepare_to_transfer, h264d_prc_prepare_to_transfer,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_srv_transfer_and_process, h264d_prc_transfer_and_process,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_srv_stop_and_return, h264d_prc_stop_and_return,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_prc_buffers_ready, h264d_prc_buffers_ready,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_prc_port_flush, h264d_prc_port_flush,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_prc_port_disable, h264d_prc_port_disable,
+ /* TIZ_CLASS_COMMENT: */
+ tiz_prc_port_enable, h264d_prc_port_enable,
+ /* TIZ_CLASS_COMMENT: stop value*/
+ 0);
+
+ return h264dprc;
+}
diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.h b/src/gallium/state_trackers/omx/tizonia/h264dprc.h
new file mode 100644
index 00000000000..08af5491a3e
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.h
@@ -0,0 +1,31 @@
+/**************************************************************************
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef H264DPRC_H
+#define H264DPRC_H
+
+void * h264d_prc_class_init(void * ap_tos, void * ap_hdl);
+void * h264d_prc_init(void * ap_tos, void * ap_hdl);
+
+#endif /* H264DPRC_H */
diff --git a/src/gallium/state_trackers/omx/tizonia/names.h b/src/gallium/state_trackers/omx/tizonia/names.h
new file mode 100644
index 00000000000..edde7df396a
--- /dev/null
+++ b/src/gallium/state_trackers/omx/tizonia/names.h
@@ -0,0 +1,30 @@
+/**************************************************************************
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef OMX_TIZ_NAMES_H
+#define OMX_TIZ_NAMES_H
+
+#define OMX_VID_COMP_NAME "OMX.mesa.video.all"
+
+#endif