|
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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMS_STREAM_BODY_IMPL_H |
|
19 #define TMS_STREAM_BODY_IMPL_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <tms.h> |
|
23 #include "tmsqueuehandler.h" |
|
24 #include "tmsstreambody.h" |
|
25 #include "tmsglobalcontext.h" |
|
26 |
|
27 namespace TMS { |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class TMSStreamObserver; |
|
31 class TMSSource; |
|
32 class TMSSink; |
|
33 class TMSForamt; |
|
34 class TMSEffect; |
|
35 class TMSCallProxy; |
|
36 class TMSStream; |
|
37 class TMSBuffer; |
|
38 class TMSFormat; |
|
39 |
|
40 // TMSStreamBodyImpl class |
|
41 class TMSStreamBodyImpl : public TMSStreamBody, |
|
42 public MQueueHandlerObserver |
|
43 { |
|
44 enum TQueueType |
|
45 { |
|
46 EMsgBufQueue, |
|
47 EMsgComQueue |
|
48 }; |
|
49 |
|
50 public: |
|
51 static gint Create(TMSCallType callType, TMSStreamType stype, |
|
52 TMSCallProxy* proxy, TMSStream& parent, |
|
53 TMSStreamBody*& bodyimpl); |
|
54 virtual ~TMSStreamBodyImpl(); |
|
55 |
|
56 // From TMSStreamBody |
|
57 virtual gint AddObserver(TMSStreamObserver& obsrvr, gpointer user_data); |
|
58 virtual gint RemoveObserver(TMSStreamObserver& obsrvr); |
|
59 virtual gint AddSource(TMSSource* source); |
|
60 virtual gint RemoveSource(TMSSource* source); |
|
61 virtual gint AddSink(TMSSink* sink); |
|
62 virtual gint RemoveSink(TMSSink* sink); |
|
63 virtual gint SetFormat(TMSFormat* format); |
|
64 virtual gint ResetFormat(TMSFormat* format); |
|
65 virtual gint AddEffect(TMSEffect* effect); |
|
66 virtual gint RemoveEffect(TMSEffect* effect); |
|
67 virtual TMSStreamState GetState(); |
|
68 virtual TMSStreamType GetStreamType(); |
|
69 virtual gint GetStreamId(); |
|
70 virtual gint Init(); |
|
71 virtual gint Pause(); |
|
72 virtual gint Start(); |
|
73 virtual gint Stop(); |
|
74 virtual void Deinit(); |
|
75 |
|
76 // From MQueueHandlerObserver |
|
77 virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data); |
|
78 |
|
79 private: |
|
80 TMSStreamBodyImpl(); |
|
81 gint PostConstruct(TMSCallType callType, TMSStreamType stype, |
|
82 TMSCallProxy* proxy, TMSStream& parent); |
|
83 |
|
84 gint CreateQueue(const gint aNumSlots); |
|
85 void ReceiveMsgQHandlerEventsL(); |
|
86 |
|
87 gint ValidateStream(); |
|
88 gint ValidateSource(TMSSource* source); |
|
89 gint ValidateSink(TMSSink* sink); |
|
90 gint ValidateFormat(TMSFormat* format); |
|
91 |
|
92 private: |
|
93 TMSCallProxy* iProxy; |
|
94 TMSStream* iParent; |
|
95 TMSCallType iCallType; |
|
96 TMSStreamType iStreamType; |
|
97 gint iStreamId; |
|
98 |
|
99 // Source |
|
100 TMSSource* iSource; |
|
101 TMSSink* iSink; |
|
102 |
|
103 // Message queue and the handler |
|
104 RMsgQueue<TmsMsgBuf> iMsgQueue; |
|
105 CQueueHandler* iMsgQHandler; |
|
106 |
|
107 // Need to make this a list |
|
108 TMSStreamObserver* iObserver; |
|
109 |
|
110 gpointer iUserData; |
|
111 RPointerArray<TMSEffect> iEffectsList; |
|
112 TMSFormat* iFormat; |
|
113 TMSGlobalContext iContext; |
|
114 TMSStreamState iStreamState; |
|
115 TMSStreamState iPrevState; |
|
116 }; |
|
117 |
|
118 } //namespace TMS |
|
119 |
|
120 #endif // TMS_STREAM_BODY_IMPL_H |
|
121 |
|
122 // End of file |