|
1 /* |
|
2 * Copyright (c) 2007 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: Plugin interface to be implemented in order to get transcoding |
|
15 * functionality |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef MCCTRANSCODER_H |
|
21 #define MCCTRANSCODER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32std.h> |
|
26 #include <mmccevents.h> |
|
27 |
|
28 // CLASS DECLARATION |
|
29 class CMccTranscoderImpl; |
|
30 |
|
31 // CONSTS |
|
32 |
|
33 // Plugin Interface UID |
|
34 #define KMmfUidPluginInterfaceMccTranscoder 0x10282898 |
|
35 |
|
36 /** |
|
37 * Class for setting up codec values for transcoding. |
|
38 */ |
|
39 class TMccTranscoderCodecInfo |
|
40 { |
|
41 public: |
|
42 TUint32 iBitrate; |
|
43 TReal iFramerate; |
|
44 TUint32 iVideoWidth; |
|
45 TUint32 iVideoHeight; |
|
46 TUint32 iSamplingFreq; |
|
47 TBuf8<256> iMimeType; |
|
48 TUid iFourCC; |
|
49 TUint32 iReserved1; |
|
50 TUint32 iReserved2; |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Class for setting up transcoding. |
|
55 */ |
|
56 class TMccTranscodeFileMsg |
|
57 { |
|
58 public: |
|
59 |
|
60 TFileName iSourceFile; |
|
61 |
|
62 TFileName iDesFile; |
|
63 |
|
64 TUint32 iQuality; |
|
65 |
|
66 TMccTranscoderCodecInfo iVideoCodec; |
|
67 |
|
68 TMccTranscoderCodecInfo iAudioCodec; |
|
69 }; |
|
70 |
|
71 typedef TPckgBuf<TMccTranscodeFileMsg> TMccTranscodeFileMsgBuffer; |
|
72 |
|
73 |
|
74 /** |
|
75 * Observer interface for clients to receive events from transcoder. |
|
76 */ |
|
77 class MMccTranscoderObserver |
|
78 { |
|
79 public: |
|
80 |
|
81 /** |
|
82 * Callback function to receive transcoder events |
|
83 * @param aEvent Received transcoder events |
|
84 */ |
|
85 virtual void MccTranscoderEventReceived( TMccEvent& aEvent ) = 0; |
|
86 }; |
|
87 |
|
88 /** |
|
89 * MCC subsystem transcoder interface. Class is used for transcoding audio and video |
|
90 * files from one codec to another. Transcoding can be also done with old codec in order |
|
91 * to change bitrate. |
|
92 */ |
|
93 class CMccTranscoder : public CBase |
|
94 { |
|
95 public: // Constructors and destructor |
|
96 /** |
|
97 * Two-phased constructor. |
|
98 */ |
|
99 static CMccTranscoder* NewL(); |
|
100 |
|
101 /** |
|
102 * Destructor. |
|
103 */ |
|
104 virtual ~CMccTranscoder(); |
|
105 |
|
106 public: // New functions |
|
107 |
|
108 /** |
|
109 * Registers observer for transcoding events. |
|
110 * @param aObserver observer for transcoding events. |
|
111 */ |
|
112 virtual void RegisterEventObserver( MMccTranscoderObserver& aObserver ); |
|
113 |
|
114 /** |
|
115 * Unregisters observer for transcoding events. |
|
116 */ |
|
117 virtual void UnregisterEventObserver(); |
|
118 |
|
119 /** |
|
120 * Starts transcoding of media file. |
|
121 * @param aSessionId session identifier for transcoding, updated on return |
|
122 * @param aVal TMccTranscodeFileMsgBuffer containing transcode parameters |
|
123 */ |
|
124 virtual void TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal ); |
|
125 |
|
126 /** |
|
127 * Cancels transcoding of media file. |
|
128 * @param aSessionId session identifier for transcoding |
|
129 */ |
|
130 virtual void CancelTranscodeFileL( TUint32 aSessionId ); |
|
131 |
|
132 private: |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 CMccTranscoder(); |
|
137 |
|
138 /** |
|
139 * By default Symbian 2nd phase constructor is private. |
|
140 * |
|
141 * @param aSource Source of the data for the payload format plugin |
|
142 */ |
|
143 void ConstructL(); |
|
144 |
|
145 private: // data |
|
146 CMccTranscoderImpl* iTranscoderImpl; |
|
147 |
|
148 private: // Friend classes |
|
149 |
|
150 #ifdef EUNIT_TEST |
|
151 friend class UT_CMccTranscoder; |
|
152 #endif |
|
153 |
|
154 }; |
|
155 |
|
156 #endif |