os/mm/mmlibs/mmfw/inc/mmf/server/mmfurl.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
#ifndef __MMFURL_H_
sl@0
    18
#define __MMFURL_H_
sl@0
    19
sl@0
    20
#include <mmf/server/mmfdatasource.h>
sl@0
    21
#include <mmf/server/mmfdatasink.h>
sl@0
    22
#include <s32mem.h>
sl@0
    23
sl@0
    24
sl@0
    25
/**
sl@0
    26
@publishedAll
sl@0
    27
@released
sl@0
    28
sl@0
    29
Concrete implementation of a URL data source.
sl@0
    30
sl@0
    31
This class is used only to pass information regarding the URL and IAP into the
sl@0
    32
controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource
sl@0
    33
APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
sl@0
    34
sl@0
    35
The configuration data for this class is an externalized CMMFUrlParams object.
sl@0
    36
sl@0
    37
@see    CMMFUrlParams
sl@0
    38
*/
sl@0
    39
class CMMFUrlSource : public CBase, public MDataSource
sl@0
    40
	{
sl@0
    41
public:
sl@0
    42
	static MDataSource* NewSourceL();
sl@0
    43
	
sl@0
    44
	/**
sl@0
    45
	Destructor.
sl@0
    46
	*/
sl@0
    47
	virtual ~CMMFUrlSource();
sl@0
    48
sl@0
    49
	/**
sl@0
    50
	Returns the URL string.
sl@0
    51
sl@0
    52
	For example:
sl@0
    53
	@code
sl@0
    54
	http://www.symbian.com/clip/mpg
sl@0
    55
	@endcode
sl@0
    56
sl@0
    57
	@return The URL string.
sl@0
    58
	@since	7.0s
sl@0
    59
	*/
sl@0
    60
	const TDesC& Url() const {return *iUrl;}
sl@0
    61
sl@0
    62
	/**
sl@0
    63
	Indicates whether the IAP ID should be used.
sl@0
    64
sl@0
    65
	@return A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId
sl@0
    66
	        should be used. EFalse if the default IAPId should be used.
sl@0
    67
sl@0
    68
	@since	7.0s
sl@0
    69
	*/
sl@0
    70
	TBool UseIAPId() const {return iUseIAPId;}
sl@0
    71
sl@0
    72
	/**
sl@0
    73
	Returns the Internet Access Point ID.
sl@0
    74
sl@0
    75
	@return The IAP ID.
sl@0
    76
	@since	7.0s
sl@0
    77
	*/
sl@0
    78
	TInt IAPId() const {return iIAPId;}
sl@0
    79
sl@0
    80
	TFourCC SourceDataTypeCode(TMediaId aMediaId);
sl@0
    81
	TInt SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/);
sl@0
    82
	void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/);
sl@0
    83
	void BufferEmptiedL(CMMFBuffer* aBuffer);
sl@0
    84
	TBool CanCreateSourceBuffer();
sl@0
    85
	CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference);
sl@0
    86
	CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer& /*aSinkBuffer*/, TBool &aReference);
sl@0
    87
	TInt SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
sl@0
    88
	void SourceThreadLogoff();
sl@0
    89
	void NegotiateSourceL(MDataSink& /* aDataSink*/);
sl@0
    90
	TBool SourceSampleConvert();
sl@0
    91
	void SourcePrimeL();
sl@0
    92
	void SourcePlayL();
sl@0
    93
	void SourcePauseL();
sl@0
    94
	void SourceStopL();
sl@0
    95
	void SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
sl@0
    96
	void SourceCustomCommand(TMMFMessage& aMessage);
sl@0
    97
sl@0
    98
private:
sl@0
    99
	CMMFUrlSource();
sl@0
   100
	void ConstructSourceL(const TDesC8& aInitData);
sl@0
   101
private:
sl@0
   102
	HBufC* iUrl;
sl@0
   103
	TBool iUseIAPId;
sl@0
   104
	TInt iIAPId;
sl@0
   105
	};
sl@0
   106
sl@0
   107
sl@0
   108
sl@0
   109
/**
sl@0
   110
@publishedAll
sl@0
   111
@released
sl@0
   112
sl@0
   113
Concrete implementation of a URL data sink.
sl@0
   114
sl@0
   115
This class is used only to pass information regarding the URL and IAP into the
sl@0
   116
controller plugin.  IT CANNOT BE USED TO WRITE DATA TO A URL.  Each of the MDataSink
sl@0
   117
APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
sl@0
   118
sl@0
   119
The configuration data for this class is an externalized CMMFUrlParams object.
sl@0
   120
sl@0
   121
@see    CMMFUrlParams
sl@0
   122
*/
sl@0
   123
class CMMFUrlSink : public CBase, public MDataSink
sl@0
   124
	{
sl@0
   125
public:
sl@0
   126
	static MDataSink* NewSinkL();
sl@0
   127
	virtual ~CMMFUrlSink();
sl@0
   128
sl@0
   129
	/**
sl@0
   130
	Returns the URL string.
sl@0
   131
sl@0
   132
	For example:
sl@0
   133
	@code
sl@0
   134
	http://www.symbian.com/clip/mpg
sl@0
   135
	@endcode
sl@0
   136
sl@0
   137
	@return The URL string.
sl@0
   138
sl@0
   139
	@since  7.0s
sl@0
   140
	*/
sl@0
   141
	const TDesC& Url() const {return *iUrl;}
sl@0
   142
sl@0
   143
	/**
sl@0
   144
	Indicates whether the IAP ID should be used.
sl@0
   145
sl@0
   146
	@return A boolean indicating if the supplied IAP ID should be used. ETrue if the supplied ID
sl@0
   147
	        should be used, EFalse if the default IAP ID should be used.
sl@0
   148
sl@0
   149
	@since	7.0s
sl@0
   150
	*/
sl@0
   151
	TBool UseIAPId() const {return iUseIAPId;}
sl@0
   152
sl@0
   153
	/**
sl@0
   154
	Returns the Internet Access Point ID.
sl@0
   155
sl@0
   156
	@return The IAP ID.
sl@0
   157
sl@0
   158
	@since  7.0s
sl@0
   159
	*/
sl@0
   160
	TInt IAPId() const {return iIAPId;}
sl@0
   161
sl@0
   162
	TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/);
sl@0
   163
	TInt SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/);
sl@0
   164
	void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/);
sl@0
   165
	void BufferFilledL(CMMFBuffer* aBuffer);
sl@0
   166
	TBool CanCreateSinkBuffer();
sl@0
   167
	CMMFBuffer* CreateSinkBufferL(TMediaId /*aMediaId*/, TBool &aReference);
sl@0
   168
	TInt SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
sl@0
   169
	void SinkThreadLogoff();
sl@0
   170
	void NegotiateL(MDataSource& /* aDataSource*/);
sl@0
   171
	void SinkPrimeL();
sl@0
   172
	void SinkPlayL();
sl@0
   173
	void SinkPauseL();
sl@0
   174
	void SinkStopL();
sl@0
   175
	void SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
sl@0
   176
	void SinkCustomCommand(TMMFMessage& aMessage);
sl@0
   177
sl@0
   178
private:
sl@0
   179
	CMMFUrlSink();
sl@0
   180
	void ConstructSinkL(const TDesC8& aInitData);
sl@0
   181
private:
sl@0
   182
	HBufC* iUrl;
sl@0
   183
	TBool iUseIAPId;
sl@0
   184
	TInt iIAPId;
sl@0
   185
	};
sl@0
   186
sl@0
   187
sl@0
   188
sl@0
   189
#endif