1c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/*
2c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Copyright (c) 2010, Texas Instruments Incorporated
3c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * All rights reserved.
4c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
5c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Redistribution and use in source and binary forms, with or without
6c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * modification, are permitted provided that the following conditions
7c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * are met:
8c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
9c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * *  Redistributions of source code must retain the above copyright
10c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *    notice, this list of conditions and the following disclaimer.
11c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
12c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * *  Redistributions in binary form must reproduce the above copyright
13c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *    notice, this list of conditions and the following disclaimer in the
14c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *    documentation and/or other materials provided with the distribution.
15c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
16c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * *  Neither the name of Texas Instruments Incorporated nor the names of
17c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *    its contributors may be used to endorse or promote products derived
18c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *    from this software without specific prior written permission.
19c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
20c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
32c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
33c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include <dirent.h>
34c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
35c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define MAX_ROLES 20
36c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define MAX_TABLE_SIZE 50
37c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
38c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct _ComponentTable {
39c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_STRING name;
40c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U16 nRoles;
41c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_STRING pRoleArray[MAX_ROLES];
42c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev}ComponentTable;
43c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
44c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
45c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
46c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN      OMX_STRING compName,
47c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_INOUT   OMX_U32 *pNumRoles,
48c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_OUT     OMX_U8 **roles);
49c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
50c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_ERRORTYPE OMX_PrintComponentTable();
51c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_ERRORTYPE OMX_BuildComponentTable();
52c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_ERRORTYPE ComponentTable_EventHandler(
53c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_HANDLETYPE hComponent,
54c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_PTR pAppData,
55c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_EVENTTYPE eEvent,
56c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_U32 nData1,
57c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_U32 nData2,
58c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_PTR pEventData);
59c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
60c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_ERRORTYPE ComponentTable_EmptyBufferDone(
61c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_HANDLETYPE hComponent,
62c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_PTR pAppData,
63c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
64c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
65c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_ERRORTYPE ComponentTable_FillBufferDone(
66c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_HANDLETYPE hComponent,
67c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_PTR pAppData,
68c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
69