khronosfws/openmax_al/src/adptcommon/xaadptbasectx.h
changeset 25 6f7ceef7b1d1
parent 21 2ed61feeead6
child 33 5e8b14bae8c3
equal deleted inserted replaced
21:2ed61feeead6 25:6f7ceef7b1d1
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors: 
    13 *
    13  *
    14 * Description: 
    14  * Description: Base Adaptation Macros common between adaptations.
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 #ifndef XAADPTBASECTX_H_
    18 #ifndef XAADPTBASECTX_H_
    19 #define XAADPTBASECTX_H_
    19 #define XAADPTBASECTX_H_
    20 
    20 
    21 #include <glib.h>
    21 #include <glib.h>
    25 #include "xacapabilitiesmgr.h"
    25 #include "xacapabilitiesmgr.h"
    26 #include "xaplatform.h"
    26 #include "xaplatform.h"
    27 /* ENUMERATIONS */
    27 /* ENUMERATIONS */
    28 
    28 
    29 /**
    29 /**
    30 GLOBAL ENUMERATIONS
    30  GLOBAL ENUMERATIONS
    31  */
    31  */
    32 
    32 
    33 typedef enum {
    33 typedef enum
       
    34     {
    34     XAMediaPlayerAdaptation = 0,
    35     XAMediaPlayerAdaptation = 0,
    35     XAMediaRecorderAdaptation,
    36     XAMediaRecorderAdaptation,
    36     XARadioAdaptation,
    37     XARadioAdaptation,
    37     XACameraAdaptation,
    38     XACameraAdaptation,
    38     XAOutputMixAdaptation,
    39     XAOutputMixAdaptation,
    39     XAVibraAdaptation,
    40     XAVibraAdaptation,
    40     XALedArrayAdaptation,
    41     XALedArrayAdaptation,
    41     XAMDAdaptation,
    42     XAMDAdaptation,
    42     XAEngineAdaptation
    43     XAEngineAdaptation
    43 }AdaptationContextIDS;
    44     } AdaptationContextIDS;
    44 
    45 
    45 #define XA_ADAPT_PU_INTERVAL 50                     /* position update interval */
    46 #define XA_ADAPT_PU_INTERVAL 50                     /* position update interval */
    46 #define XA_ADAPT_ASYNC_TIMEOUT 3000                 /* timeout to wait async events */
    47 #define XA_ADAPT_ASYNC_TIMEOUT 3000                 /* timeout to wait async events */
    47 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000           /* timeout to wait async events */
    48 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000           /* timeout to wait async events */
    48 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000   /* timeout to wait async events */
    49 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000   /* timeout to wait async events */
    61 /* TYPEDEFS */
    62 /* TYPEDEFS */
    62 
    63 
    63 #define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
    64 #define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
    64 #define RADIO_DEFAULT_FREQ 88000000
    65 #define RADIO_DEFAULT_FREQ 88000000
    65 
    66 
    66 
       
    67 /* TYPEDEFS */
    67 /* TYPEDEFS */
    68 
    68 
    69 /* Adaptation device IDs */
    69 /* Adaptation device IDs */
    70 //#define XA_ADAPTID_ALSASRC          0xAD7E5001  //Krishna commented
    70 #define XA_ADAPTID_DEVSOUNDSRC      0xAD7E5001
    71 #define XA_ADAPTID_DEVSOUNDSRC          0xAD7E5001
       
    72 //#define XA_ADAPTID_ALSASINK         0xAD7E5002
       
    73 #define XA_ADAPTID_DEVSOUNDSINK     0xAD7E5002
    71 #define XA_ADAPTID_DEVSOUNDSINK     0xAD7E5002
    74 #define XA_ADAPTID_AUTOAUDIOSINK    0xAD7E5003
    72 #define XA_ADAPTID_AUTOAUDIOSINK    0xAD7E5003
    75 #define XA_ADAPTID_AUDIOTESTSRC     0xAD7E5004
    73 #define XA_ADAPTID_AUDIOTESTSRC     0xAD7E5004
    76 #define XA_ADAPTID_AUTOVIDEOSINK    0xAD7E5005
    74 #define XA_ADAPTID_AUTOVIDEOSINK    0xAD7E5005
    77 #define XA_ADAPTID_VIDEOTESTSRC     0xAD7E5006
    75 #define XA_ADAPTID_VIDEOTESTSRC     0xAD7E5006
    84 #define XA_ADAPTID_VIBRA            0xAD7E500C
    82 #define XA_ADAPTID_VIBRA            0xAD7E500C
    85 #define XA_ADAPTID_LEDARRAY         0xAD7E500D
    83 #define XA_ADAPTID_LEDARRAY         0xAD7E500D
    86 
    84 
    87 #define XA_ADAPTID_RAWVIDEO         0xAD7E500E
    85 #define XA_ADAPTID_RAWVIDEO         0xAD7E500E
    88 
    86 
    89 //#define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_ALSASINK
       
    90 #define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_DEVSOUNDSINK
    87 #define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_DEVSOUNDSINK
    91 
    88 
    92 #ifdef XA_USE_TEST_PLUGINS
    89 #ifdef XA_USE_TEST_PLUGINS
    93 #define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_AUDIOTESTSRC
    90 #define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_AUDIOTESTSRC
    94 #else
    91 #else
    95 #define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_DEVSOUNDSRC
    92 #define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_DEVSOUNDSRC
    96 #endif
    93 #endif
    97 
       
    98 
    94 
    99 #define XA_ADAPT_OGGPROFILE_UNKNOWN 0x1
    95 #define XA_ADAPT_OGGPROFILE_UNKNOWN 0x1
   100 
    96 
   101 #define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8   0x1
    97 #define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8   0x1
   102 #define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16  0x2
    98 #define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16  0x2
   119 #define XA_ADAPT_VOLUME_MUTE_CHANGED 0xfc         	/* mute changed */
   115 #define XA_ADAPT_VOLUME_MUTE_CHANGED 0xfc         	/* mute changed */
   120 #define XA_ADAPT_VULOME_STEREOPOSITION_CHANGED  0xfd /* stereo position changed */
   116 #define XA_ADAPT_VULOME_STEREOPOSITION_CHANGED  0xfd /* stereo position changed */
   121 
   117 
   122 /* Adaptation event structure */
   118 /* Adaptation event structure */
   123 typedef struct XAAdaptEvent_
   119 typedef struct XAAdaptEvent_
   124 {
   120     {
   125     XAAdaptEventTypes  eventtype; /* what kind of event, e.g. playitf event  */
   121     XAAdaptEventTypes eventtype; /* what kind of event, e.g. playitf event  */
   126     XAuint8            eventid;   /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
   122     XAuint8 eventid; /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
   127     XAuint32           datasize;  /* event data size */
   123     XAuint32 datasize; /* event data size */
   128     void*              data;      /* event data if needed */
   124     void* data; /* event data if needed */
   129 } XAAdaptEvent;
   125     } XAAdaptEvent;
   130 
   126 
   131 /* Forward declaration of adaptation basecontext */
   127 /* Forward declaration of adaptation basecontext */
   132 typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
   128 typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
   133 
   129 
   134 /*
   130 /*
   135  * Structure that holds all common variables for every
   131  * Structure that holds all common variables for every
   136  * Gst-Adaptation context structures.
   132  * Gst-Adaptation context structures.
   137  */
   133  */
   138 typedef struct XAAdaptationBaseCtx_
   134 typedef struct XAAdaptationBaseCtx_
   139 {
   135     {
   140 /*     Common Variables for all adaptation elements */
   136     /*     Common Variables for all adaptation elements */
   141     XAuint32        ctxId;
   137     XAuint32 ctxId;
   142     GArray*         evtHdlrs;     /*array of event handlers */
   138     GArray* evtHdlrs; /*array of event handlers */
   143     FrameworkMap*   fwkmapper;
   139     FrameworkMap* fwkmapper;
   144     FWMgrFwType     fwtype;
   140     FWMgrFwType fwtype;
   145     XACapabilities* capslist;
   141     XACapabilities* capslist;
   146     
       
   147 } XAAdaptationBaseCtx_;
       
   148 
   142 
       
   143     } XAAdaptationBaseCtx_;
   149 
   144 
   150 /* Adaptation event callback */
   145 /* Adaptation event callback */
   151 typedef void (*xaAdaptEventHandler) ( void *pHandlerCtx, XAAdaptEvent* event );
   146 typedef void (*xaAdaptEventHandler)(void *pHandlerCtx, XAAdaptEvent* event);
   152 
   147 
   153 typedef struct XAAdaptEvtHdlr_
   148 typedef struct XAAdaptEvtHdlr_
   154 {
   149     {
   155     xaAdaptEventHandler handlerfunc;    /* function handling the callback */
   150     xaAdaptEventHandler handlerfunc; /* function handling the callback */
   156     void               *handlercontext; /* context of handler */
   151     void *handlercontext; /* context of handler */
   157     XAuint32            eventtypes;     /* what kind of events this handles */
   152     XAuint32 eventtypes; /* what kind of events this handles */
   158 } XAAdaptEvtHdlr;
   153     } XAAdaptEvtHdlr;
   159 
       
   160 
       
   161 
       
   162 
   154 
   163 /* FUNCTIONS */
   155 /* FUNCTIONS */
   164 XAresult XAAdaptationBase_Init( XAAdaptationBaseCtx* pSelf, XAuint32 ctxId );
   156 XAresult XAAdaptationBase_Init(XAAdaptationBaseCtx* pSelf, XAuint32 ctxId);
   165 XAresult XAAdaptationBase_PostInit( XAAdaptationBaseCtx* ctx );
   157 XAresult XAAdaptationBase_PostInit(XAAdaptationBaseCtx* ctx);
   166 XAresult XAAdaptationBase_AddEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler,
   158 XAresult XAAdaptationBase_AddEventHandler(XAAdaptationBaseCtx* ctx,
   167                                     XAuint32 evtTypes,void *pHandlerCtx );
   159         xaAdaptEventHandler evtHandler, XAuint32 evtTypes, void *pHandlerCtx);
   168 XAresult XAAdaptationBase_RemoveEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler );
   160 XAresult XAAdaptationBase_RemoveEventHandler(XAAdaptationBaseCtx* ctx,
   169 void XAAdaptationBase_SendAdaptEvents(XAAdaptationBaseCtx* ctx, XAAdaptEvent* event);
   161         xaAdaptEventHandler evtHandler);
       
   162 void XAAdaptationBase_SendAdaptEvents(XAAdaptationBaseCtx* ctx,
       
   163         XAAdaptEvent* event);
   170 XAresult XAAdaptationBase_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
   164 XAresult XAAdaptationBase_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
   171 XAresult XAAdaptationBase_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
   165 XAresult XAAdaptationBase_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
   172 void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx );
   166 void XAAdaptationBase_Free(XAAdaptationBaseCtx* ctx);
   173 
   167 
   174 #endif /* XAADPTBASE_H_ */
   168 #endif /* XAADPTBASECTX_H_ */