19
|
1 |
/*
|
25
|
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: Base Adaptation Macros common between adaptations.
|
|
15 |
*
|
|
16 |
*/
|
19
|
17 |
|
|
18 |
#ifndef XAADPTBASECTX_H_
|
|
19 |
#define XAADPTBASECTX_H_
|
|
20 |
|
|
21 |
#include <glib.h>
|
|
22 |
#include "openmaxalwrapper.h"
|
|
23 |
#include "xaglobals.h"
|
|
24 |
#include "xaframeworkmgr.h"
|
|
25 |
#include "xacapabilitiesmgr.h"
|
|
26 |
#include "xaplatform.h"
|
|
27 |
/* ENUMERATIONS */
|
|
28 |
|
|
29 |
/**
|
25
|
30 |
GLOBAL ENUMERATIONS
|
19
|
31 |
*/
|
|
32 |
|
25
|
33 |
typedef enum
|
|
34 |
{
|
19
|
35 |
XAMediaPlayerAdaptation = 0,
|
|
36 |
XAMediaRecorderAdaptation,
|
|
37 |
XARadioAdaptation,
|
|
38 |
XACameraAdaptation,
|
|
39 |
XAOutputMixAdaptation,
|
|
40 |
XAVibraAdaptation,
|
|
41 |
XALedArrayAdaptation,
|
|
42 |
XAMDAdaptation,
|
|
43 |
XAEngineAdaptation
|
25
|
44 |
} AdaptationContextIDS;
|
19
|
45 |
|
|
46 |
#define XA_ADAPT_PU_INTERVAL 50 /* position update interval */
|
|
47 |
#define XA_ADAPT_ASYNC_TIMEOUT 3000 /* timeout to wait async events */
|
|
48 |
#define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000 /* timeout to wait async events */
|
|
49 |
#define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000 /* timeout to wait async events */
|
|
50 |
|
|
51 |
#define XA_ADAPT_POSITION_UPDATE_EVT 0xf0 /* position update event */
|
|
52 |
#define XA_ADAPT_SNAPSHOT_TAKEN 0xf1 /* snapshot taken event */
|
|
53 |
#define XA_ADAPT_SNAPSHOT_INITIATED 0xf2 /* snapshot intitiated event */
|
|
54 |
#define XA_ADAPT_MDE_TAGS_AVAILABLE 0xf3 /* metadata taglist changed */
|
|
55 |
#define XA_ADAPT_OMIX_DEVICESET_CHANGED 0xf4 /* Output mix device changed event */
|
|
56 |
#define XA_ADAPT_RADIO_FREQUENCY_CHANGED 0xf6 /* Radio frequency changed event */
|
|
57 |
#define XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED 0xf7 /* Radio frequency range changed event */
|
|
58 |
#define XA_ADAPT_RADIO_SEEK_COMPLETE 0xf8 /* Radio seek complete changed event */
|
|
59 |
#define XA_ADAPT_RDS_GET_ODA_GROUP_DONE 0xf9 /* RDS get oda group done event */
|
|
60 |
#define XA_ADAPT_BUFFERING 0xfa
|
|
61 |
#define XA_ADAPT_MDE_TAGS_WRITTEN 0xfb
|
|
62 |
/* TYPEDEFS */
|
|
63 |
|
|
64 |
#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
|
|
65 |
#define RADIO_DEFAULT_FREQ 88000000
|
33
|
66 |
#define RADIO_DEFAULT_MIN_FREQ 87500000
|
|
67 |
#define RADIO_DEFAULT_MAX_FREQ 108000000
|
19
|
68 |
|
|
69 |
/* TYPEDEFS */
|
|
70 |
|
|
71 |
/* Adaptation device IDs */
|
25
|
72 |
#define XA_ADAPTID_DEVSOUNDSRC 0xAD7E5001
|
19
|
73 |
#define XA_ADAPTID_DEVSOUNDSINK 0xAD7E5002
|
|
74 |
#define XA_ADAPTID_AUTOAUDIOSINK 0xAD7E5003
|
|
75 |
#define XA_ADAPTID_AUDIOTESTSRC 0xAD7E5004
|
|
76 |
#define XA_ADAPTID_AUTOVIDEOSINK 0xAD7E5005
|
|
77 |
#define XA_ADAPTID_VIDEOTESTSRC 0xAD7E5006
|
|
78 |
#define XA_ADAPTID_V4L2SRC 0xAD7E5007
|
|
79 |
#define XA_ADAPTID_JACKSINK 0xAD7E5008
|
|
80 |
#define XA_ADAPTID_MOTIONJPEG 0xAD7E5009
|
|
81 |
#define XA_ADAPTID_THEORA 0xAD7E500A
|
|
82 |
#define XA_ADAPTID_VORBIS 0xAD7E500B
|
|
83 |
|
|
84 |
#define XA_ADAPTID_VIBRA 0xAD7E500C
|
|
85 |
#define XA_ADAPTID_LEDARRAY 0xAD7E500D
|
|
86 |
|
|
87 |
#define XA_ADAPTID_RAWVIDEO 0xAD7E500E
|
|
88 |
|
|
89 |
#define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_DEVSOUNDSINK
|
|
90 |
|
|
91 |
#ifdef XA_USE_TEST_PLUGINS
|
|
92 |
#define XA_ADAPT_DEFAULTAUDIOINPUT XA_ADAPTID_AUDIOTESTSRC
|
|
93 |
#else
|
|
94 |
#define XA_ADAPT_DEFAULTAUDIOINPUT XA_ADAPTID_DEVSOUNDSRC
|
|
95 |
#endif
|
|
96 |
|
|
97 |
#define XA_ADAPT_OGGPROFILE_UNKNOWN 0x1
|
|
98 |
|
|
99 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8 0x1
|
|
100 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16 0x2
|
|
101 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_20 0x4
|
|
102 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_24 0x8
|
|
103 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_28 0x10
|
|
104 |
#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_32 0x20
|
|
105 |
|
|
106 |
#define XA_ADAPT_MAX_BITRATE_COUNT 10
|
|
107 |
|
|
108 |
#define XA_ADAPTID_UNINITED 0
|
|
109 |
|
21
|
110 |
#define XA_ADAPT_PLAY_STATE_CHANGED 0xf5
|
|
111 |
#define XA_ADAPT_RADIO_FREQUENCY_CHANGED 0xf6 /* Radio frequency changed event */
|
|
112 |
#define XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED 0xf7 /* Radio frequency range changed event */
|
|
113 |
#define XA_ADAPT_RADIO_SEEK_COMPLETE 0xf8 /* Radio seek complete changed event */
|
|
114 |
#define XA_ADAPT_RADIO_STEREO_STATUS_CHANGED 0xf9 /* Radio stereo status changed */
|
|
115 |
#define XA_ADAPT_RADIO_SIGNAL_STRENGTH_CHANGED 0xfa /* Radio signal status changed */
|
|
116 |
#define XA_ADAPT_VOLUME_VOLUME_CHANGED 0xfb /* volume changed */
|
|
117 |
#define XA_ADAPT_VOLUME_MUTE_CHANGED 0xfc /* mute changed */
|
|
118 |
#define XA_ADAPT_VULOME_STEREOPOSITION_CHANGED 0xfd /* stereo position changed */
|
19
|
119 |
|
|
120 |
/* Adaptation event structure */
|
|
121 |
typedef struct XAAdaptEvent_
|
25
|
122 |
{
|
|
123 |
XAAdaptEventTypes eventtype; /* what kind of event, e.g. playitf event */
|
|
124 |
XAuint8 eventid; /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
|
|
125 |
XAuint32 datasize; /* event data size */
|
|
126 |
void* data; /* event data if needed */
|
|
127 |
} XAAdaptEvent;
|
19
|
128 |
|
|
129 |
/* Forward declaration of adaptation basecontext */
|
|
130 |
typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
|
|
131 |
|
|
132 |
/*
|
|
133 |
* Structure that holds all common variables for every
|
|
134 |
* Gst-Adaptation context structures.
|
|
135 |
*/
|
|
136 |
typedef struct XAAdaptationBaseCtx_
|
25
|
137 |
{
|
|
138 |
/* Common Variables for all adaptation elements */
|
|
139 |
XAuint32 ctxId;
|
|
140 |
GArray* evtHdlrs; /*array of event handlers */
|
|
141 |
FrameworkMap* fwkmapper;
|
|
142 |
FWMgrFwType fwtype;
|
19
|
143 |
XACapabilities* capslist;
|
|
144 |
|
25
|
145 |
} XAAdaptationBaseCtx_;
|
19
|
146 |
|
|
147 |
/* Adaptation event callback */
|
25
|
148 |
typedef void (*xaAdaptEventHandler)(void *pHandlerCtx, XAAdaptEvent* event);
|
19
|
149 |
|
|
150 |
typedef struct XAAdaptEvtHdlr_
|
25
|
151 |
{
|
|
152 |
xaAdaptEventHandler handlerfunc; /* function handling the callback */
|
|
153 |
void *handlercontext; /* context of handler */
|
|
154 |
XAuint32 eventtypes; /* what kind of events this handles */
|
|
155 |
} XAAdaptEvtHdlr;
|
19
|
156 |
|
|
157 |
/* FUNCTIONS */
|
25
|
158 |
XAresult XAAdaptationBase_Init(XAAdaptationBaseCtx* pSelf, XAuint32 ctxId);
|
|
159 |
XAresult XAAdaptationBase_PostInit(XAAdaptationBaseCtx* ctx);
|
|
160 |
XAresult XAAdaptationBase_AddEventHandler(XAAdaptationBaseCtx* ctx,
|
|
161 |
xaAdaptEventHandler evtHandler, XAuint32 evtTypes, void *pHandlerCtx);
|
|
162 |
XAresult XAAdaptationBase_RemoveEventHandler(XAAdaptationBaseCtx* ctx,
|
|
163 |
xaAdaptEventHandler evtHandler);
|
|
164 |
void XAAdaptationBase_SendAdaptEvents(XAAdaptationBaseCtx* ctx,
|
|
165 |
XAAdaptEvent* event);
|
19
|
166 |
XAresult XAAdaptationBase_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
|
|
167 |
XAresult XAAdaptationBase_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
|
25
|
168 |
void XAAdaptationBase_Free(XAAdaptationBaseCtx* ctx);
|
19
|
169 |
|
25
|
170 |
#endif /* XAADPTBASECTX_H_ */
|