khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.h
changeset 16 43d09473c595
parent 14 80975da52420
child 22 128eb6a32b84
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef XAADAPTATIONCONTEXTBASE_H
       
    19 #define XAADAPTATIONCONTEXTBASE_H
       
    20 
       
    21 #include <stdlib.h>
       
    22 #include "XAGlobals.h"
       
    23 #include "openmaxalwrapper.h"
       
    24 #include "OpenMAXAL_ContentPipe.h"
       
    25 #include "XAPlatform.h"
       
    26 
       
    27 /* ENUMERATIONS */
       
    28 
       
    29 typedef enum {
       
    30     XAMediaPlayerAdaptation = 0,
       
    31     XAMediaRecorderAdaptation,
       
    32     XARadioAdaptation,
       
    33     XACameraAdaptation,
       
    34     XAOutputMixAdaptation,
       
    35     XAVibraAdaptation,
       
    36     XALedArrayAdaptation,
       
    37     XAMDAdaptation,
       
    38     XAEngineAdaptation
       
    39 }AdaptationContextIDS;
       
    40 
       
    41 /**
       
    42  * enumeration for different adaptation event types.
       
    43  * add more types when needed, use single bit values.
       
    44  **/
       
    45 typedef enum {
       
    46     XA_GENERICEVENTS = 0x1,
       
    47     XA_PLAYITFEVENTS = 0x2,
       
    48     XA_RECORDITFEVENTS = 0x4,
       
    49     XA_SNAPSHOTITFEVENTS = 0x8,
       
    50     XA_OUTPUTMIXITFEVENTS = 0x10,
       
    51     XA_CAMERAITFEVENTS = 0x20,
       
    52     XA_PREFETCHITFEVENTS = 0x40,
       
    53     XA_RADIOITFEVENTS = 0x80,
       
    54     XA_RDSITFEVENTS = 0x100,
       
    55     XA_METADATAEVENTS = 0x200,
       
    56     XA_ADDMORETYPES  = 0x400
       
    57 }XAAdaptEventTypes;
       
    58 
       
    59 #define XA_ADAPT_PU_INTERVAL 50                     /* position update interval */
       
    60 #define XA_ADAPT_ASYNC_TIMEOUT 3000                 /* timeout to wait async events */
       
    61 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000           /* timeout to wait async events */
       
    62 #define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000   /* timeout to wait async events */
       
    63 
       
    64 #define XA_ADAPT_POSITION_UPDATE_EVT 0xf0           /* position update event */
       
    65 #define XA_ADAPT_SNAPSHOT_TAKEN 0xf1                /* snapshot taken event */
       
    66 #define XA_ADAPT_SNAPSHOT_INITIATED 0xf2            /* snapshot intitiated event */
       
    67 #define XA_ADAPT_MDE_TAGS_AVAILABLE 0xf3            /* metadata taglist changed */
       
    68 #define XA_ADAPT_OMIX_DEVICESET_CHANGED 0xf4        /* Output mix device changed event */
       
    69 #define XA_ADAPT_RADIO_FREQUENCY_CHANGED 0xf6       /* Radio frequency changed event */
       
    70 #define XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED 0xf7 /* Radio frequency range changed event */
       
    71 #define XA_ADAPT_RADIO_SEEK_COMPLETE 0xf8           /* Radio seek complete changed event */
       
    72 #define XA_ADAPT_RDS_GET_ODA_GROUP_DONE 0xf9        /* RDS get oda group done event */
       
    73 #define XA_ADAPT_BUFFERING 0xfa
       
    74 #define XA_ADAPT_MDE_TAGS_WRITTEN 0xfb
       
    75 /* TYPEDEFS */
       
    76 
       
    77 #define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
       
    78 #define RADIO_DEFAULT_FREQ 88000000
       
    79 
       
    80 /* Adaptation event structure */
       
    81 typedef struct XAAdaptEvent_
       
    82 {
       
    83     XAAdaptEventTypes  eventtype; /* what kind of event, e.g. playitf event  */
       
    84     XAuint8            eventid;   /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
       
    85     XAuint32           datasize;  /* event data size */
       
    86     void*              data;      /* event data if needed */
       
    87 } XAAdaptEvent;
       
    88 
       
    89 /* Adaptation event callback */
       
    90 typedef void (*xaAdaptEventHandler) ( void *pHandlerCtx, XAAdaptEvent* event );
       
    91 
       
    92 /* Forward declaration of adaptation basecontext */
       
    93 typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
       
    94 
       
    95 /* FUNCTIONS */
       
    96 XAresult XAAdaptationBase_Init( XAAdaptationBaseCtx* pSelf, XAuint32 ctxId );
       
    97 XAresult XAAdaptationBase_PostInit( XAAdaptationBaseCtx* ctx );
       
    98 XAresult XAAdaptationBase_AddEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler,
       
    99                                     XAuint32 evtTypes,void *pHandlerCtx );
       
   100 XAresult XAAdaptationBase_RemoveEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler );
       
   101 void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx );
       
   102 XAresult XAAdaptationBase_SetCPConfiguration(XAAdaptationBaseCtx* ctx, XAConfigExtensionCpKey configValue);
       
   103 
       
   104 #endif /*XAADAPTATIONCONTEXTBASE_H*/
       
   105