|
1 /* |
|
2 * Copyright (c) 2006-2008 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: Interface for connecting media-engines into nat framework. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_MEDIA_WRAPPER_H |
|
22 #define M_MEDIA_WRAPPER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "natfwconnectivityapidefs.h" |
|
26 |
|
27 #include "natfwmediawrapperobserver.h" |
|
28 |
|
29 class TInetAddr; |
|
30 class RSocketServ; |
|
31 |
|
32 /** |
|
33 * Media Wrapper Interface |
|
34 * |
|
35 * Interface for connecting different media-engines into nat framework. |
|
36 * |
|
37 * @lib socketmediaconnwrapper.dll |
|
38 * @since S60 v3.2 |
|
39 */ |
|
40 class MNATFWMediaWrapper |
|
41 { |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Enables wrapper to forward packets from mediaengine to connection |
|
47 * multiplexer. |
|
48 * |
|
49 * @since S60 v3.2 |
|
50 * @param aState The sending state |
|
51 * @return void |
|
52 */ |
|
53 virtual void SetReceivingStateForMuxWrapper( |
|
54 TNATFWStreamingState aState ) = 0; |
|
55 |
|
56 /** |
|
57 * Send data to connected media engine. |
|
58 * |
|
59 * @since S60 v3.2 |
|
60 * @param aStreamPortion a reference to buffer to be sent |
|
61 * @return void |
|
62 */ |
|
63 virtual void SendL( const TDesC8& aStreamPortion ) = 0; |
|
64 |
|
65 /** |
|
66 * Returns The stream ID which wrapper is associated with |
|
67 * |
|
68 * @since S60 v3.2 |
|
69 * @return ID which wrapper is associated with |
|
70 */ |
|
71 virtual TUint StreamId() = 0; |
|
72 |
|
73 /** |
|
74 * Register media observer. |
|
75 * |
|
76 * @since S60 v3.2 |
|
77 * @param aObserver media observer |
|
78 * @param aServer socket server handle |
|
79 * @param aLocalAddr wrapper's local address |
|
80 * @return void |
|
81 */ |
|
82 virtual void RegisterMediaWrapperObserverL( |
|
83 MNATFWMediaWrapperObserver* aObserver, |
|
84 const RSocketServ& aServer, |
|
85 const TInetAddr& aLocalAddr ) = 0; |
|
86 |
|
87 /** |
|
88 * Closes wrapper instance by deleting it. |
|
89 * |
|
90 * Implementing class MUST call its destructor on this method and free |
|
91 * allocated heap. Usually this is done by "delete this". |
|
92 * |
|
93 * @since S60 v3.2 |
|
94 * @return void |
|
95 */ |
|
96 virtual void Close() = 0; |
|
97 |
|
98 /** |
|
99 * Gets wrapper's local and remote addresses |
|
100 * |
|
101 * @since S60 v3.2 |
|
102 * @param aLocalAddr wrapper's local address |
|
103 * @param aRemoteAddr wrapper's remote address |
|
104 * @return void |
|
105 */ |
|
106 virtual void GetAddresses( |
|
107 TInetAddr& aLocalAddr, |
|
108 TInetAddr& aRemoteAddr ) = 0; |
|
109 }; |
|
110 |
|
111 |
|
112 #endif // M_MEDIA_WRAPPER_H |