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 the License "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: Common interface for sinks* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCRPACKETSINKBASE_H |
|
21 #define CCRPACKETSINKBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "CCRStreamingSession.h" |
|
26 |
|
27 // CONSTANTS |
|
28 // None |
|
29 |
|
30 // MACROS |
|
31 // None |
|
32 |
|
33 // DATA TYPES |
|
34 // None |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CCRPacketBuffer; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Interface to sink. |
|
43 * |
|
44 * @lib CommonRecordingEngine.lib |
|
45 * @since Series 60 3.0 |
|
46 */ |
|
47 class CCRPacketSinkBase : public CBase |
|
48 { |
|
49 |
|
50 public: // Constructors and destructors |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CCRPacketSinkBase(); |
|
56 |
|
57 public: // New methods |
|
58 |
|
59 /** |
|
60 * Connects the given buffer with this sink. |
|
61 * @since Series 60 3.0 |
|
62 * @param aBuffer is the buffer to connect with. |
|
63 * @param aBufId a id of the buffer. |
|
64 * @return none. |
|
65 */ |
|
66 void SetBuffer( CCRPacketBuffer* aBuffer ); |
|
67 |
|
68 /** |
|
69 * Method for setting the sdp in use. |
|
70 * @since Series 60 3.0 |
|
71 * @param aSdp is the new sdp. |
|
72 * @return none. |
|
73 */ |
|
74 virtual void SetSdpL( const TDesC8& aSdp ) = 0; |
|
75 |
|
76 /** |
|
77 * Adds packet to sink |
|
78 * @since Series 60 3.0 |
|
79 * @return none. |
|
80 */ |
|
81 virtual void NewPacketAvailable() = 0; |
|
82 |
|
83 /** |
|
84 * Buffer reset info for the sink. |
|
85 * @since Series 60 3.0 |
|
86 * @return none. |
|
87 */ |
|
88 virtual void BufferResetDone(); |
|
89 |
|
90 /** |
|
91 * Method that source uses to communicate its status. |
|
92 * @since Series 60 3.0 |
|
93 * @param aNewState is the new state of the source. |
|
94 * @return none. |
|
95 */ |
|
96 virtual void StatusChanged( MCRPacketSource::TCRPacketSourceState aNewState ); |
|
97 |
|
98 /** |
|
99 * Method that owner of sink may utilitze to distinguish between sinks. |
|
100 * @since Series 60 3.0 |
|
101 * @param none. |
|
102 * @return Id that may have been set. |
|
103 */ |
|
104 virtual CCRStreamingSession::TCRSinkId Id( void ) const; |
|
105 |
|
106 /** |
|
107 * Method for pause action for sink. |
|
108 * @since Series 60 3.0 |
|
109 * @param none. |
|
110 * @return a system wide error code. |
|
111 */ |
|
112 virtual TInt Pause(); |
|
113 |
|
114 /** |
|
115 * Method for restore action for sink. |
|
116 * @since Series 60 3.0 |
|
117 * @param none. |
|
118 * @return a system wide error code. |
|
119 */ |
|
120 virtual TInt Restore(); |
|
121 |
|
122 /** |
|
123 * Method for stopping action for sink. |
|
124 * @since Series 60 3.0 |
|
125 * @param none. |
|
126 * @return none. |
|
127 */ |
|
128 virtual void Stop(); |
|
129 |
|
130 /** |
|
131 * method for setting initial seq+ts _before_ the stream is played. |
|
132 * @since Series 60 3.0 |
|
133 * @param aAudioSeq is the initial rtp seq number for audio packets. |
|
134 * @param aAudioTS is the initial rtp timestamp number for audio packets. |
|
135 * @param aVideoSeq is the initial rtp seq number for video packets. |
|
136 * @param aVideoTS is the initial rtp timestamp number for video packets. |
|
137 * @return none. |
|
138 */ |
|
139 virtual void SetSeqAndTS( TUint& aAudioSeq, |
|
140 TUint& aAudioTS, |
|
141 TUint& aVideoSeq, |
|
142 TUint& aVideoTS ); |
|
143 |
|
144 /** |
|
145 * method for setting play range before the stream is played. |
|
146 * @param aLower is where clip range begins, in seconds. |
|
147 * @param aUpper is where clip range ends, usually clip end, in seconds. |
|
148 * @return none. |
|
149 */ |
|
150 virtual void SetRange( TReal aLower, |
|
151 TReal aUpper ); |
|
152 |
|
153 protected: // Constructors and destructors |
|
154 |
|
155 /** |
|
156 * Default constructor |
|
157 */ |
|
158 CCRPacketSinkBase( CCRStreamingSession& aSession, |
|
159 CCRStreamingSession::TCRSinkId aSinkId ); |
|
160 |
|
161 protected: // Data |
|
162 |
|
163 /** |
|
164 * Pointer to streaming session that owns us. |
|
165 */ |
|
166 CCRStreamingSession& iOwningSession; |
|
167 |
|
168 /** |
|
169 * Buffer used by sinks. |
|
170 */ |
|
171 CCRPacketBuffer* iBuffer; |
|
172 |
|
173 /** |
|
174 * Sink id, set by owner. |
|
175 */ |
|
176 const CCRStreamingSession::TCRSinkId iSinkId; |
|
177 |
|
178 }; |
|
179 |
|
180 #endif // CCRPACKETSINKBASE_H |
|
181 |
|
182 // End of File |
|