|
1 /* |
|
2 * Copyright (c) 2005 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 |
|
19 |
|
20 |
|
21 // MCE API |
|
22 |
|
23 |
|
24 //#include <MCEManager.h> |
|
25 #include <MCESession.h> |
|
26 #include <MCEMediaStream.h> |
|
27 //#include <MCEOneWayStream.h> |
|
28 #include <MCEVideoStream.h> |
|
29 #include <MCEMediaSource.h> |
|
30 #include <MCEMicSource.h> |
|
31 #include <MCEMediaSink.h> |
|
32 #include <MCERtpSink.h> |
|
33 #include <MCERtpSource.h> |
|
34 #include <MCEFileSource.h> |
|
35 #include <MCESpeakerSink.h> |
|
36 |
|
37 #include "CMCETestUIEngine.h" |
|
38 #include "MCETestUIEngineConstants.h" |
|
39 #include "CMCETestUIEngineVideoSource.h" |
|
40 |
|
41 #include "TMCETestUIEngineCmdBase.h" |
|
42 #include "TMCETestUIEngineCmdEnableAudioSource.h" |
|
43 #include "TMCETestUIEngineCmdDisableAudioSource.h" |
|
44 |
|
45 // ============================ MEMBER FUNCTIONS =============================== |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CMCETestUIEngineVideoSource::NewL() |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CMCETestUIEngineVideoSource* CMCETestUIEngineVideoSource::NewL( |
|
52 CMCETestUIEngine& aEngine, |
|
53 CMceMediaSource& aSource ) |
|
54 { |
|
55 |
|
56 CMCETestUIEngineVideoSource* self = |
|
57 new (ELeave) CMCETestUIEngineVideoSource( aEngine, |
|
58 aSource ); |
|
59 CleanupStack::PushL( self ); |
|
60 self->ConstructL(); |
|
61 CleanupStack::Pop( self ); |
|
62 return self; |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CMCETestUIEngineVideoSource::CMCETestUIEngineVideoSource |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CMCETestUIEngineVideoSource::CMCETestUIEngineVideoSource( |
|
70 CMCETestUIEngine& aEngine, |
|
71 CMceMediaSource& aSource ) |
|
72 : iEngine( aEngine ), |
|
73 iSource( aSource ) |
|
74 { |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CMCETestUIEngineVideoSource::ConstructL() |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 void CMCETestUIEngineVideoSource::ConstructL() |
|
82 { |
|
83 return; |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CMCETestUIEngineVideoSource::~CMCETestUIEngineVideoSource |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 EXPORT_C CMCETestUIEngineVideoSource::~CMCETestUIEngineVideoSource() |
|
91 { |
|
92 iCommands.ResetAndDestroy(); |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CMCETestUIEngineVideoSource::GetCommands |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 const RPointerArray<TMCETestUIEngineCmdBase>& |
|
100 CMCETestUIEngineVideoSource::GetCommandsL() |
|
101 { |
|
102 iCommands.ResetAndDestroy(); |
|
103 |
|
104 if ( iSource.IsEnabled() ) |
|
105 { |
|
106 iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoSource( |
|
107 iEngine, *this ) ); |
|
108 } |
|
109 else |
|
110 { |
|
111 iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoSource( |
|
112 iEngine, *this ) ); |
|
113 } |
|
114 if(iSource.Type() == KMceFileSource) |
|
115 { |
|
116 iCommands.Append( new (ELeave) TMCETestUIEngineCmdVideoTranscode( |
|
117 iEngine, *this ) ); |
|
118 iCommands.Append( new (ELeave) TMCETestUIEngineCmdVideoCancelTranscode( |
|
119 iEngine, *this ) ); |
|
120 } |
|
121 return iCommands; |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CMCETestUIEngineVideoSource::Type |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 EXPORT_C TMceSourceType CMCETestUIEngineVideoSource::Type() const |
|
129 { |
|
130 return iSource.Type();; |
|
131 } |
|
132 |
|
133 |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CMCETestUIEngineVideoSource::State |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 EXPORT_C const TDesC16& CMCETestUIEngineVideoSource::State() const |
|
140 { |
|
141 if ( iSource.IsEnabled() ) |
|
142 { |
|
143 return KSourceStateEnabled; |
|
144 } |
|
145 return KSourceStateDisabled; |
|
146 } |
|
147 |
|
148 |
|
149 // ----------------------------------------------------------------------------- |
|
150 // CMCETestUIEngineVideoSource::Source |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 EXPORT_C CMceMediaSource& CMCETestUIEngineVideoSource::Source() |
|
154 { |
|
155 return iSource; |
|
156 } |
|
157 |