1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 #include <mmf/server/mmfdatasource.h>
21 #include <mmf/server/mmfdatasink.h>
29 Concrete implementation of a URL data source.
31 This class is used only to pass information regarding the URL and IAP into the
32 controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource
33 APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
35 The configuration data for this class is an externalized CMMFUrlParams object.
39 class CMMFUrlSource : public CBase, public MDataSource
42 static MDataSource* NewSourceL();
47 virtual ~CMMFUrlSource();
50 Returns the URL string.
54 http://www.symbian.com/clip/mpg
57 @return The URL string.
60 const TDesC& Url() const {return *iUrl;}
63 Indicates whether the IAP ID should be used.
65 @return A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId
66 should be used. EFalse if the default IAPId should be used.
70 TBool UseIAPId() const {return iUseIAPId;}
73 Returns the Internet Access Point ID.
78 TInt IAPId() const {return iIAPId;}
80 TFourCC SourceDataTypeCode(TMediaId aMediaId);
81 TInt SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/);
82 void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/);
83 void BufferEmptiedL(CMMFBuffer* aBuffer);
84 TBool CanCreateSourceBuffer();
85 CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference);
86 CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer& /*aSinkBuffer*/, TBool &aReference);
87 TInt SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
88 void SourceThreadLogoff();
89 void NegotiateSourceL(MDataSink& /* aDataSink*/);
90 TBool SourceSampleConvert();
95 void SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
96 void SourceCustomCommand(TMMFMessage& aMessage);
100 void ConstructSourceL(const TDesC8& aInitData);
113 Concrete implementation of a URL data sink.
115 This class is used only to pass information regarding the URL and IAP into the
116 controller plugin. IT CANNOT BE USED TO WRITE DATA TO A URL. Each of the MDataSink
117 APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
119 The configuration data for this class is an externalized CMMFUrlParams object.
123 class CMMFUrlSink : public CBase, public MDataSink
126 static MDataSink* NewSinkL();
127 virtual ~CMMFUrlSink();
130 Returns the URL string.
134 http://www.symbian.com/clip/mpg
137 @return The URL string.
141 const TDesC& Url() const {return *iUrl;}
144 Indicates whether the IAP ID should be used.
146 @return A boolean indicating if the supplied IAP ID should be used. ETrue if the supplied ID
147 should be used, EFalse if the default IAP ID should be used.
151 TBool UseIAPId() const {return iUseIAPId;}
154 Returns the Internet Access Point ID.
160 TInt IAPId() const {return iIAPId;}
162 TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/);
163 TInt SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/);
164 void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/);
165 void BufferFilledL(CMMFBuffer* aBuffer);
166 TBool CanCreateSinkBuffer();
167 CMMFBuffer* CreateSinkBufferL(TMediaId /*aMediaId*/, TBool &aReference);
168 TInt SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
169 void SinkThreadLogoff();
170 void NegotiateL(MDataSource& /* aDataSource*/);
175 void SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
176 void SinkCustomCommand(TMMFMessage& aMessage);
180 void ConstructSinkL(const TDesC8& aInitData);