os/mm/mmlibs/mmfw/src/Plugin/StdSourceAndSink/mmfurl.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 1997-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 #include <e32std.h>
    18 #include <mmf/common/mmffourcc.h>
    19 #include <mmf/common/mmfcontrollerframeworkbase.h>
    20 #include "mmfurl.h"
    21 
    22 
    23 MDataSource* CMMFUrlSource::NewSourceL()
    24 	{
    25 	CMMFUrlSource* self = new(ELeave) CMMFUrlSource;
    26 	return STATIC_CAST(MDataSource*, self);
    27 	}
    28 
    29 CMMFUrlSource::CMMFUrlSource() :
    30 	MDataSource(KUidMmfUrlSource)
    31 	{
    32 	}
    33 
    34 void CMMFUrlSource::ConstructSourceL(const TDesC8& aInitData)
    35 	{
    36 	RDesReadStream stream(aInitData);
    37 	CleanupClosePushL(stream);
    38 
    39 	CMMFUrlParams* params = CMMFUrlParams::NewLC(stream);
    40 
    41 	iUrl = params->Url().AllocL();
    42 	iIAPId = params->IAPId();
    43 	iUseIAPId = params->UseIAPId();
    44 
    45 	CleanupStack::PopAndDestroy(2);//params, stream
    46 	}
    47 
    48 CMMFUrlSource::~CMMFUrlSource()
    49 	{
    50 	delete iUrl;
    51 	}
    52 
    53 TFourCC CMMFUrlSource::SourceDataTypeCode(TMediaId /*aMediaId*/)
    54 	{
    55 	return KMMFFourCCCodeNULL;
    56 	}
    57 
    58 TInt CMMFUrlSource::SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/)
    59 	{
    60 	return KErrNotSupported;
    61 	}
    62 
    63 void CMMFUrlSource::FillBufferL(CMMFBuffer* /*aBuffer*/, MDataSink* /*aConsumer*/,TMediaId /*aMediaId*/)
    64 	{
    65 	User::Leave(KErrNotSupported);
    66 	}
    67 
    68 void CMMFUrlSource::BufferEmptiedL(CMMFBuffer* /*aBuffer*/)
    69 	{
    70 	User::Leave(KErrNotSupported);
    71 	}
    72 
    73 TBool CMMFUrlSource::CanCreateSourceBuffer()
    74 	{
    75 	return EFalse;
    76 	}
    77 
    78 CMMFBuffer* CMMFUrlSource::CreateSourceBufferL(TMediaId /*aMediaId*/, TBool& /*aReference*/)
    79 	{
    80 	User::Leave(KErrNotSupported);
    81 	return NULL;
    82 	}
    83 
    84 CMMFBuffer* CMMFUrlSource::CreateSourceBufferL(TMediaId /*aMediaId*/, CMMFBuffer& /*aSinkBuffer*/, TBool& /*aReference*/)
    85 	{
    86 	User::Leave(KErrNotSupported);
    87 	return NULL;
    88 	}
    89 
    90 TInt CMMFUrlSource::SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/)
    91 	{
    92 	return KErrNotSupported;
    93 	}
    94 
    95 void CMMFUrlSource::SourceThreadLogoff()
    96 	{
    97 	}
    98 
    99 void CMMFUrlSource::NegotiateSourceL(MDataSink& /* aDataSink*/)
   100 	{
   101 	User::Leave(KErrNotSupported);
   102 	}
   103 
   104 TBool CMMFUrlSource::SourceSampleConvert()
   105 	{
   106 	return EFalse;
   107 	}
   108 
   109 void CMMFUrlSource::SourcePrimeL()
   110 	{
   111 	User::Leave(KErrNotSupported);
   112 	}
   113 
   114 void CMMFUrlSource::SourcePlayL()
   115 	{
   116 	User::Leave(KErrNotSupported);
   117 	}
   118 
   119 void CMMFUrlSource::SourcePauseL()
   120 	{
   121 	User::Leave(KErrNotSupported);
   122 	}
   123 
   124 void CMMFUrlSource::SourceStopL()
   125 	{
   126 	User::Leave(KErrNotSupported);
   127 	}
   128 
   129 void CMMFUrlSource::SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/)
   130 	{
   131 	}
   132 
   133 void CMMFUrlSource::SourceCustomCommand(TMMFMessage& aMessage)
   134 	{
   135 	aMessage.Complete(KErrNotSupported);
   136 	}
   137 
   138 
   139 
   140 
   141 MDataSink* CMMFUrlSink::NewSinkL()
   142 	{
   143 	CMMFUrlSink* self = new(ELeave) CMMFUrlSink;
   144 	return STATIC_CAST(MDataSink*, self);
   145 	}
   146 
   147 CMMFUrlSink::CMMFUrlSink() :
   148 	MDataSink(KUidMmfUrlSink)
   149 	{
   150 	}
   151 
   152 void CMMFUrlSink::ConstructSinkL(const TDesC8& aInitData)
   153 	{
   154 	RDesReadStream stream(aInitData);
   155 	CleanupClosePushL(stream);
   156 
   157 	CMMFUrlParams* params = CMMFUrlParams::NewLC(stream);
   158 
   159 	iUrl = params->Url().AllocL();
   160 	iIAPId = params->IAPId();
   161 	iUseIAPId = params->UseIAPId();
   162 
   163 	CleanupStack::PopAndDestroy(2);//params, stream
   164 	}
   165 
   166 CMMFUrlSink::~CMMFUrlSink()
   167 	{
   168 	delete iUrl;
   169 	}
   170 
   171 TFourCC CMMFUrlSink::SinkDataTypeCode(TMediaId /*aMediaId*/)
   172 	{
   173 	return KMMFFourCCCodeNULL;
   174 	}
   175 
   176 TInt CMMFUrlSink::SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/)
   177 	{
   178 	return KErrNotSupported;
   179 	}
   180 
   181 void CMMFUrlSink::EmptyBufferL(CMMFBuffer* /*aBuffer*/, MDataSource* /*aSupplier*/, TMediaId /*aMediaId*/)
   182 	{
   183 	User::Leave(KErrNotSupported);
   184 	}
   185 
   186 void CMMFUrlSink::BufferFilledL(CMMFBuffer* /*aBuffer*/)
   187 	{
   188 	User::Leave(KErrNotSupported);
   189 	}
   190 
   191 TBool CMMFUrlSink::CanCreateSinkBuffer()
   192 	{
   193 	return EFalse;
   194 	}
   195 
   196 CMMFBuffer* CMMFUrlSink::CreateSinkBufferL(TMediaId /*aMediaId*/, TBool& /*aReference*/)
   197 	{
   198 	User::Leave(KErrNotSupported);
   199 	return NULL;
   200 	}
   201 
   202 TInt CMMFUrlSink::SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/)
   203 	{
   204 	return KErrNotSupported;
   205 	}
   206 
   207 void CMMFUrlSink::SinkThreadLogoff()
   208 	{
   209 	}
   210 
   211 void CMMFUrlSink::NegotiateL(MDataSource& /* aDataSource*/)
   212 	{
   213 	User::Leave(KErrNotSupported);
   214 	}
   215 
   216 void CMMFUrlSink::SinkPrimeL()
   217 	{
   218 	User::Leave(KErrNotSupported);
   219 	}
   220 
   221 void CMMFUrlSink::SinkPlayL()
   222 	{
   223 	User::Leave(KErrNotSupported);
   224 	}
   225 
   226 void CMMFUrlSink::SinkPauseL()
   227 	{
   228 	User::Leave(KErrNotSupported);
   229 	}
   230 
   231 void CMMFUrlSink::SinkStopL()
   232 	{
   233 	User::Leave(KErrNotSupported);
   234 	}
   235 
   236 void CMMFUrlSink::SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/)
   237 	{
   238 	}
   239 
   240 void CMMFUrlSink::SinkCustomCommand(TMMFMessage& aMessage)
   241 	{
   242 	aMessage.Complete(KErrNotSupported);
   243 	}
   244