khronosfws/openmax_al/src/common/xastreaminformationitf.c
changeset 33 5e8b14bae8c3
parent 25 6f7ceef7b1d1
child 43 9894ed580e4a
equal deleted inserted replaced
28:ebf79c79991a 33:5e8b14bae8c3
    16  */
    16  */
    17 
    17 
    18 #include <assert.h>
    18 #include <assert.h>
    19 
    19 
    20 #include "xastreaminformationitf.h"
    20 #include "xastreaminformationitf.h"
    21 #include "xastreaminformationitfadaptation.h"
    21 
    22 #include "xastreaminformationitfadaptationmmf.h"
    22 #include "xastreaminformationitfadaptationmmf.h"
    23 
    23 
    24 /* XAStreamInformationItfImpl* GetImpl
    24 /* XAStreamInformationItfImpl* GetImpl
    25  * Description: Validate interface pointer and cast it to implementation pointer.
    25  * Description: Validate interface pointer and cast it to implementation pointer.
    26  */
    26  */
    54         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    54         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    55         DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
    55         DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
    56         return XA_RESULT_PARAMETER_INVALID;
    56         return XA_RESULT_PARAMETER_INVALID;
    57         }
    57         }
    58 
    58 
    59     if (impl->adapCtx->fwtype == FWMgrFWGST)
    59     if (impl->adapCtx->fwtype == FWMgrFWMMF)
    60         {
       
    61         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
    62         if (ret == XA_RESULT_PARAMETER_INVALID)
       
    63             {
       
    64             DEBUG_API("<-XAStreamInformationItfImpl_QueryMediaContainerInformation");
       
    65             return ret;
       
    66             }
       
    67         ret = XAStreamInformationItfAdapt_QueryMediaContainerInformation(
       
    68                 impl->adapCtx, &(info->containerType),
       
    69                 &(info->mediaDuration), &(info->numStreams));
       
    70         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
    71         }
       
    72     else
       
    73         {
    60         {
    74         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
    61         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
    75         if (ret == XA_RESULT_PARAMETER_INVALID)
    62         if (ret == XA_RESULT_PARAMETER_INVALID)
    76             {
    63             {
    77             DEBUG_API("<-XAStreamInformationItfImpl_QueryMediaContainerInformation");
    64             DEBUG_API("<-XAStreamInformationItfImpl_QueryMediaContainerInformation");
    79             }
    66             }
    80         ret = XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
    67         ret = XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
    81                 impl->adapCtx, &(info->containerType),
    68                 impl->adapCtx, &(info->containerType),
    82                 &(info->mediaDuration), &(info->numStreams));
    69                 &(info->mediaDuration), &(info->numStreams));
    83         XAAdaptationBase_ThreadExit(impl->adapCtx);
    70         XAAdaptationBase_ThreadExit(impl->adapCtx);
    84         ;
       
    85         }
    71         }
    86 
    72 
    87     DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
    73     DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
    88     return ret;
    74     return ret;
    89     }
    75     }
    99         /* invalid parameter */
    85         /* invalid parameter */
   100         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    86         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   101         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
    87         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
   102         return XA_RESULT_PARAMETER_INVALID;
    88         return XA_RESULT_PARAMETER_INVALID;
   103         }
    89         }
   104     if (impl->adapCtx->fwtype == FWMgrFWGST)
    90     if (impl->adapCtx->fwtype == FWMgrFWMMF)
   105         {
       
   106         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
   107         if (ret == XA_RESULT_PARAMETER_INVALID)
       
   108             {
       
   109             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamType");
       
   110             return ret;
       
   111             }
       
   112 
       
   113         ret = XAStreamInformationItfAdapt_QueryStreamType(impl->adapCtx,
       
   114                 streamIndex, domain);
       
   115 
       
   116         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
   117         }
       
   118     else
       
   119         {
    91         {
   120         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
    92         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   121         if (ret == XA_RESULT_PARAMETER_INVALID)
    93         if (ret == XA_RESULT_PARAMETER_INVALID)
   122             {
    94             {
   123             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamType");
    95             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamType");
   126 
    98 
   127         ret = XAStreamInformationItfAdaptMMF_QueryStreamType(impl->adapCtx,
    99         ret = XAStreamInformationItfAdaptMMF_QueryStreamType(impl->adapCtx,
   128                 streamIndex, domain);
   100                 streamIndex, domain);
   129 
   101 
   130         XAAdaptationBase_ThreadExit(impl->adapCtx);
   102         XAAdaptationBase_ThreadExit(impl->adapCtx);
   131         ;
   103         }
   132         }DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
   104     DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
   133     return ret;
   105     return ret;
   134     }
   106     }
   135 
   107 
   136 XAresult XAStreamInformationItfImpl_QueryStreamInformation(
   108 XAresult XAStreamInformationItfImpl_QueryStreamInformation(
   137         XAStreamInformationItf self, XAuint32 streamIndex, void * info)
   109         XAStreamInformationItf self, XAuint32 streamIndex, void * info)
   145         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   117         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   146         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
   118         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
   147         return XA_RESULT_PARAMETER_INVALID;
   119         return XA_RESULT_PARAMETER_INVALID;
   148         }
   120         }
   149 
   121 
   150     if (impl->adapCtx->fwtype == FWMgrFWGST)
   122     if (impl->adapCtx->fwtype == FWMgrFWMMF)
   151         {
       
   152         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
   153         if (ret == XA_RESULT_PARAMETER_INVALID)
       
   154             {
       
   155             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamInformation");
       
   156             return ret;
       
   157             }
       
   158 
       
   159         ret = XAStreamInformationItfAdapt_QueryStreamInformation(
       
   160                 impl->adapCtx, streamIndex, info);
       
   161 
       
   162         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
   163         }
       
   164     else
       
   165         {
   123         {
   166         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   124         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   167         if (ret == XA_RESULT_PARAMETER_INVALID)
   125         if (ret == XA_RESULT_PARAMETER_INVALID)
   168             {
   126             {
   169             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamInformation");
   127             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamInformation");
   172 
   130 
   173         ret = XAStreamInformationItfAdaptMMF_QueryStreamInformation(
   131         ret = XAStreamInformationItfAdaptMMF_QueryStreamInformation(
   174                 impl->adapCtx, streamIndex, info);
   132                 impl->adapCtx, streamIndex, info);
   175 
   133 
   176         XAAdaptationBase_ThreadExit(impl->adapCtx);
   134         XAAdaptationBase_ThreadExit(impl->adapCtx);
   177         ;
       
   178         }
   135         }
   179 
   136 
   180     DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
   137     DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
   181     return ret;
   138     return ret;
   182     }
   139     }
   194         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   151         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   195         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
   152         DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
   196         return XA_RESULT_PARAMETER_INVALID;
   153         return XA_RESULT_PARAMETER_INVALID;
   197         }
   154         }
   198 
   155 
   199     if (impl->adapCtx->fwtype == FWMgrFWGST)
   156     if (impl->adapCtx->fwtype == FWMgrFWMMF)
   200         {
       
   201         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
   202         if (ret == XA_RESULT_PARAMETER_INVALID)
       
   203             {
       
   204             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamName");
       
   205             return ret;
       
   206             }
       
   207 
       
   208         ret = XAStreamInformationItfAdapt_QueryStreamName(impl->adapCtx,
       
   209                 streamIndex, pNameSize, pName);
       
   210 
       
   211         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
   212         }
       
   213     else
       
   214         {
   157         {
   215         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   158         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   216         if (ret == XA_RESULT_PARAMETER_INVALID)
   159         if (ret == XA_RESULT_PARAMETER_INVALID)
   217             {
   160             {
   218             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamName");
   161             DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamName");
   221 
   164 
   222         ret = XAStreamInformationItfAdaptMMF_QueryStreamName(impl->adapCtx,
   165         ret = XAStreamInformationItfAdaptMMF_QueryStreamName(impl->adapCtx,
   223                 streamIndex, pNameSize, pName);
   166                 streamIndex, pNameSize, pName);
   224 
   167 
   225         XAAdaptationBase_ThreadExit(impl->adapCtx);
   168         XAAdaptationBase_ThreadExit(impl->adapCtx);
   226         ;
   169         }
   227         }DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
   170     DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
   228     return ret;
   171     return ret;
   229     }
   172     }
   230 
   173 
   231 XAresult XAStreamInformationItfImpl_RegisterStreamChangeCallback(
   174 XAresult XAStreamInformationItfImpl_RegisterStreamChangeCallback(
   232         XAStreamInformationItf self, xaStreamEventChangeCallback callback,
   175         XAStreamInformationItf self, xaStreamEventChangeCallback callback,
   274             {
   217             {
   275             DEBUG_API("<-XAStreamInformationItfImpl_QueryActiveStreams");
   218             DEBUG_API("<-XAStreamInformationItfImpl_QueryActiveStreams");
   276             return ret;
   219             return ret;
   277             }
   220             }
   278 
   221 
   279         ret = XAStreamInformationItfAdapt_QueryActiveStreams(impl->adapCtx,
       
   280                 numStreams, activeStreams);
       
   281 
       
   282         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
   283         }
       
   284     else
       
   285         {
       
   286         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
   287         if (ret == XA_RESULT_PARAMETER_INVALID)
       
   288             {
       
   289             DEBUG_API("<-XAStreamInformationItfImpl_QueryActiveStreams");
       
   290             return ret;
       
   291             }
       
   292 
       
   293         ret = XAStreamInformationItfAdaptMMF_QueryActiveStreams(
   222         ret = XAStreamInformationItfAdaptMMF_QueryActiveStreams(
   294                 impl->adapCtx, numStreams, activeStreams);
   223                 impl->adapCtx, numStreams, activeStreams);
   295 
   224 
   296         XAAdaptationBase_ThreadExit(impl->adapCtx);
   225         XAAdaptationBase_ThreadExit(impl->adapCtx);
   297         ;
       
   298         }
   226         }
   299 
   227 
   300     DEBUG_API("-<XAStreamInformationItfImpl_QueryActiveStreams");
   228     DEBUG_API("-<XAStreamInformationItfImpl_QueryActiveStreams");
   301     return ret;
   229     return ret;
   302     }
   230     }
   314         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   242         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   315         DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
   243         DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
   316         return XA_RESULT_PARAMETER_INVALID;
   244         return XA_RESULT_PARAMETER_INVALID;
   317         }
   245         }
   318 
   246 
   319     if (impl->adapCtx->fwtype == FWMgrFWGST)
   247     if (impl->adapCtx->fwtype == FWMgrFWMMF)
   320         {
       
   321         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
       
   322         if (ret == XA_RESULT_PARAMETER_INVALID)
       
   323             {
       
   324             DEBUG_API("<-XAStreamInformationItfImpl_SetActiveStream");
       
   325             return ret;
       
   326             }
       
   327 
       
   328         ret = XAStreamInformationItfAdapt_SetActiveStream(impl->adapCtx,
       
   329                 streamNum, active, commitNow);
       
   330 
       
   331         XAAdaptationBase_ThreadExit(impl->adapCtx);
       
   332         }
       
   333     else
       
   334         {
   248         {
   335         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   249         ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
   336         if (ret == XA_RESULT_PARAMETER_INVALID)
   250         if (ret == XA_RESULT_PARAMETER_INVALID)
   337             {
   251             {
   338             DEBUG_API("<-XAStreamInformationItfImpl_SetActiveStream");
   252             DEBUG_API("<-XAStreamInformationItfImpl_SetActiveStream");
   341 
   255 
   342         ret = XAStreamInformationItfAdaptMMF_SetActiveStream(impl->adapCtx,
   256         ret = XAStreamInformationItfAdaptMMF_SetActiveStream(impl->adapCtx,
   343                 streamNum, active, commitNow);
   257                 streamNum, active, commitNow);
   344 
   258 
   345         XAAdaptationBase_ThreadExit(impl->adapCtx);
   259         XAAdaptationBase_ThreadExit(impl->adapCtx);
   346         ;
       
   347         }
   260         }
   348 
   261 
   349     DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
   262     DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
   350     return ret;
   263     return ret;
   351     }
   264     }