os/mm/mmlibs/mmfw/src/Plugin/StdSourceAndSink/mmfurl.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/src/Plugin/StdSourceAndSink/mmfurl.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,244 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +#include <e32std.h>
    1.21 +#include <mmf/common/mmffourcc.h>
    1.22 +#include <mmf/common/mmfcontrollerframeworkbase.h>
    1.23 +#include "mmfurl.h"
    1.24 +
    1.25 +
    1.26 +MDataSource* CMMFUrlSource::NewSourceL()
    1.27 +	{
    1.28 +	CMMFUrlSource* self = new(ELeave) CMMFUrlSource;
    1.29 +	return STATIC_CAST(MDataSource*, self);
    1.30 +	}
    1.31 +
    1.32 +CMMFUrlSource::CMMFUrlSource() :
    1.33 +	MDataSource(KUidMmfUrlSource)
    1.34 +	{
    1.35 +	}
    1.36 +
    1.37 +void CMMFUrlSource::ConstructSourceL(const TDesC8& aInitData)
    1.38 +	{
    1.39 +	RDesReadStream stream(aInitData);
    1.40 +	CleanupClosePushL(stream);
    1.41 +
    1.42 +	CMMFUrlParams* params = CMMFUrlParams::NewLC(stream);
    1.43 +
    1.44 +	iUrl = params->Url().AllocL();
    1.45 +	iIAPId = params->IAPId();
    1.46 +	iUseIAPId = params->UseIAPId();
    1.47 +
    1.48 +	CleanupStack::PopAndDestroy(2);//params, stream
    1.49 +	}
    1.50 +
    1.51 +CMMFUrlSource::~CMMFUrlSource()
    1.52 +	{
    1.53 +	delete iUrl;
    1.54 +	}
    1.55 +
    1.56 +TFourCC CMMFUrlSource::SourceDataTypeCode(TMediaId /*aMediaId*/)
    1.57 +	{
    1.58 +	return KMMFFourCCCodeNULL;
    1.59 +	}
    1.60 +
    1.61 +TInt CMMFUrlSource::SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/)
    1.62 +	{
    1.63 +	return KErrNotSupported;
    1.64 +	}
    1.65 +
    1.66 +void CMMFUrlSource::FillBufferL(CMMFBuffer* /*aBuffer*/, MDataSink* /*aConsumer*/,TMediaId /*aMediaId*/)
    1.67 +	{
    1.68 +	User::Leave(KErrNotSupported);
    1.69 +	}
    1.70 +
    1.71 +void CMMFUrlSource::BufferEmptiedL(CMMFBuffer* /*aBuffer*/)
    1.72 +	{
    1.73 +	User::Leave(KErrNotSupported);
    1.74 +	}
    1.75 +
    1.76 +TBool CMMFUrlSource::CanCreateSourceBuffer()
    1.77 +	{
    1.78 +	return EFalse;
    1.79 +	}
    1.80 +
    1.81 +CMMFBuffer* CMMFUrlSource::CreateSourceBufferL(TMediaId /*aMediaId*/, TBool& /*aReference*/)
    1.82 +	{
    1.83 +	User::Leave(KErrNotSupported);
    1.84 +	return NULL;
    1.85 +	}
    1.86 +
    1.87 +CMMFBuffer* CMMFUrlSource::CreateSourceBufferL(TMediaId /*aMediaId*/, CMMFBuffer& /*aSinkBuffer*/, TBool& /*aReference*/)
    1.88 +	{
    1.89 +	User::Leave(KErrNotSupported);
    1.90 +	return NULL;
    1.91 +	}
    1.92 +
    1.93 +TInt CMMFUrlSource::SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/)
    1.94 +	{
    1.95 +	return KErrNotSupported;
    1.96 +	}
    1.97 +
    1.98 +void CMMFUrlSource::SourceThreadLogoff()
    1.99 +	{
   1.100 +	}
   1.101 +
   1.102 +void CMMFUrlSource::NegotiateSourceL(MDataSink& /* aDataSink*/)
   1.103 +	{
   1.104 +	User::Leave(KErrNotSupported);
   1.105 +	}
   1.106 +
   1.107 +TBool CMMFUrlSource::SourceSampleConvert()
   1.108 +	{
   1.109 +	return EFalse;
   1.110 +	}
   1.111 +
   1.112 +void CMMFUrlSource::SourcePrimeL()
   1.113 +	{
   1.114 +	User::Leave(KErrNotSupported);
   1.115 +	}
   1.116 +
   1.117 +void CMMFUrlSource::SourcePlayL()
   1.118 +	{
   1.119 +	User::Leave(KErrNotSupported);
   1.120 +	}
   1.121 +
   1.122 +void CMMFUrlSource::SourcePauseL()
   1.123 +	{
   1.124 +	User::Leave(KErrNotSupported);
   1.125 +	}
   1.126 +
   1.127 +void CMMFUrlSource::SourceStopL()
   1.128 +	{
   1.129 +	User::Leave(KErrNotSupported);
   1.130 +	}
   1.131 +
   1.132 +void CMMFUrlSource::SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/)
   1.133 +	{
   1.134 +	}
   1.135 +
   1.136 +void CMMFUrlSource::SourceCustomCommand(TMMFMessage& aMessage)
   1.137 +	{
   1.138 +	aMessage.Complete(KErrNotSupported);
   1.139 +	}
   1.140 +
   1.141 +
   1.142 +
   1.143 +
   1.144 +MDataSink* CMMFUrlSink::NewSinkL()
   1.145 +	{
   1.146 +	CMMFUrlSink* self = new(ELeave) CMMFUrlSink;
   1.147 +	return STATIC_CAST(MDataSink*, self);
   1.148 +	}
   1.149 +
   1.150 +CMMFUrlSink::CMMFUrlSink() :
   1.151 +	MDataSink(KUidMmfUrlSink)
   1.152 +	{
   1.153 +	}
   1.154 +
   1.155 +void CMMFUrlSink::ConstructSinkL(const TDesC8& aInitData)
   1.156 +	{
   1.157 +	RDesReadStream stream(aInitData);
   1.158 +	CleanupClosePushL(stream);
   1.159 +
   1.160 +	CMMFUrlParams* params = CMMFUrlParams::NewLC(stream);
   1.161 +
   1.162 +	iUrl = params->Url().AllocL();
   1.163 +	iIAPId = params->IAPId();
   1.164 +	iUseIAPId = params->UseIAPId();
   1.165 +
   1.166 +	CleanupStack::PopAndDestroy(2);//params, stream
   1.167 +	}
   1.168 +
   1.169 +CMMFUrlSink::~CMMFUrlSink()
   1.170 +	{
   1.171 +	delete iUrl;
   1.172 +	}
   1.173 +
   1.174 +TFourCC CMMFUrlSink::SinkDataTypeCode(TMediaId /*aMediaId*/)
   1.175 +	{
   1.176 +	return KMMFFourCCCodeNULL;
   1.177 +	}
   1.178 +
   1.179 +TInt CMMFUrlSink::SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/)
   1.180 +	{
   1.181 +	return KErrNotSupported;
   1.182 +	}
   1.183 +
   1.184 +void CMMFUrlSink::EmptyBufferL(CMMFBuffer* /*aBuffer*/, MDataSource* /*aSupplier*/, TMediaId /*aMediaId*/)
   1.185 +	{
   1.186 +	User::Leave(KErrNotSupported);
   1.187 +	}
   1.188 +
   1.189 +void CMMFUrlSink::BufferFilledL(CMMFBuffer* /*aBuffer*/)
   1.190 +	{
   1.191 +	User::Leave(KErrNotSupported);
   1.192 +	}
   1.193 +
   1.194 +TBool CMMFUrlSink::CanCreateSinkBuffer()
   1.195 +	{
   1.196 +	return EFalse;
   1.197 +	}
   1.198 +
   1.199 +CMMFBuffer* CMMFUrlSink::CreateSinkBufferL(TMediaId /*aMediaId*/, TBool& /*aReference*/)
   1.200 +	{
   1.201 +	User::Leave(KErrNotSupported);
   1.202 +	return NULL;
   1.203 +	}
   1.204 +
   1.205 +TInt CMMFUrlSink::SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/)
   1.206 +	{
   1.207 +	return KErrNotSupported;
   1.208 +	}
   1.209 +
   1.210 +void CMMFUrlSink::SinkThreadLogoff()
   1.211 +	{
   1.212 +	}
   1.213 +
   1.214 +void CMMFUrlSink::NegotiateL(MDataSource& /* aDataSource*/)
   1.215 +	{
   1.216 +	User::Leave(KErrNotSupported);
   1.217 +	}
   1.218 +
   1.219 +void CMMFUrlSink::SinkPrimeL()
   1.220 +	{
   1.221 +	User::Leave(KErrNotSupported);
   1.222 +	}
   1.223 +
   1.224 +void CMMFUrlSink::SinkPlayL()
   1.225 +	{
   1.226 +	User::Leave(KErrNotSupported);
   1.227 +	}
   1.228 +
   1.229 +void CMMFUrlSink::SinkPauseL()
   1.230 +	{
   1.231 +	User::Leave(KErrNotSupported);
   1.232 +	}
   1.233 +
   1.234 +void CMMFUrlSink::SinkStopL()
   1.235 +	{
   1.236 +	User::Leave(KErrNotSupported);
   1.237 +	}
   1.238 +
   1.239 +void CMMFUrlSink::SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/)
   1.240 +	{
   1.241 +	}
   1.242 +
   1.243 +void CMMFUrlSink::SinkCustomCommand(TMMFMessage& aMessage)
   1.244 +	{
   1.245 +	aMessage.Complete(KErrNotSupported);
   1.246 +	}
   1.247 +