os/mm/mmlibs/mmfw/inc/mmf/server/Mmfclip.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
#ifndef __MMFCLIP_H_
sl@0
    17
#define __MMFCLIP_H_
sl@0
    18
sl@0
    19
#include <mmf/server/mmfdatasource.h>
sl@0
    20
#include <mmf/server/mmfdatasink.h>
sl@0
    21
#include <mmf/server/mmfbuffer.h>
sl@0
    22
#include <mmf/common/mmfutilities.h>
sl@0
    23
sl@0
    24
/**
sl@0
    25
@publishedAll
sl@0
    26
@released
sl@0
    27
sl@0
    28
Abstract class to represent a source or sink that contains a multimedia clip (i.e. not a stream or hardware device).
sl@0
    29
sl@0
    30
Typical examples are a file or an area of memory (descriptor).
sl@0
    31
*/
sl@0
    32
class CMMFClip : public CBase, public MDataSource, public MDataSink
sl@0
    33
	{
sl@0
    34
public :
sl@0
    35
	//asynchronous Read/WriteBufferLs
sl@0
    36
sl@0
    37
	/**
sl@0
    38
	Reads aLength number of bytes of data from the offset, aPosition into the buffer, aBuffer.
sl@0
    39
	Intended for asynchronous usage.
sl@0
    40
sl@0
    41
	This is a virtual function that each derived class must implement.
sl@0
    42
sl@0
    43
	@param  aLength
sl@0
    44
	        The number of bytes to read.
sl@0
    45
	@param  aBuffer
sl@0
    46
	        The buffer to read the data into.
sl@0
    47
	@param  aPosition
sl@0
    48
	        The offset from which to start reading.
sl@0
    49
	@param  aConsumer
sl@0
    50
	        The sink of tha data read from the clip. Will be informed of read if not NULL.
sl@0
    51
	*/
sl@0
    52
	virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) = 0 ;
sl@0
    53
sl@0
    54
	/**
sl@0
    55
	Writes aLength number of bytes of data from the offset, aPosition from the buffer, aBuffer.
sl@0
    56
	Intended for asynchronous usage.
sl@0
    57
sl@0
    58
	This is a virtual function that each derived class must implement.
sl@0
    59
sl@0
    60
	@param  aLength
sl@0
    61
	        The number of bytes to write.
sl@0
    62
	@param  aBuffer
sl@0
    63
	        The buffer to write the data into.
sl@0
    64
	@param  aPosition
sl@0
    65
	        The offset from which to start writing.
sl@0
    66
	@param  aSupplier
sl@0
    67
	        The source of the data writen to the clip. Will be informed of write if not NULL.
sl@0
    68
	*/
sl@0
    69
	virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) = 0 ;
sl@0
    70
sl@0
    71
	/**
sl@0
    72
	Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
sl@0
    73
	Intended for asynchronous usage.
sl@0
    74
sl@0
    75
	This is a virtual function that each derived class must implement.
sl@0
    76
sl@0
    77
	@param  aBuffer
sl@0
    78
	        The buffer to read the data into.
sl@0
    79
	@param  aPosition
sl@0
    80
	        The offset from which to start reading.
sl@0
    81
	@param  aConsumer
sl@0
    82
	        The sink of tha data read from the clip. Will be informed of read if not NULL.
sl@0
    83
	*/
sl@0
    84
	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) = 0 ;
sl@0
    85
sl@0
    86
	/**
sl@0
    87
	Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
sl@0
    88
	Intended for asynchronous usage.
sl@0
    89
sl@0
    90
	This is a virtual function that each derived class must implement.
sl@0
    91
sl@0
    92
	@param  aBuffer
sl@0
    93
	        The buffer to write the data into.
sl@0
    94
	@param  aPosition
sl@0
    95
	        The offset from which to start writing.
sl@0
    96
	@param  aSupplier
sl@0
    97
	        The source of the data writen to the clip. Will be informed of write if not NULL.
sl@0
    98
	*/
sl@0
    99
	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) = 0 ;
sl@0
   100
sl@0
   101
	//synchronous Read/WriteBufferLs
sl@0
   102
sl@0
   103
	/**
sl@0
   104
	Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
sl@0
   105
	Intended for synchronous usage.
sl@0
   106
sl@0
   107
	This is a virtual function that each derived class must implement.
sl@0
   108
sl@0
   109
	@param  aBuffer
sl@0
   110
	        The buffer to read the data into.
sl@0
   111
	@param  aPosition
sl@0
   112
	        The offset from which to start reading.
sl@0
   113
	*/
sl@0
   114
	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) = 0 ;
sl@0
   115
sl@0
   116
	/**
sl@0
   117
	Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
sl@0
   118
	Intended for synchronous usage.
sl@0
   119
sl@0
   120
	This is a virtual function that each derived class must implement.
sl@0
   121
sl@0
   122
	@param  aBuffer
sl@0
   123
	        The buffer to write the data into.
sl@0
   124
	@param  aPosition
sl@0
   125
	        The offset from which to start writing.
sl@0
   126
	*/
sl@0
   127
	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) = 0 ;
sl@0
   128
sl@0
   129
	/**
sl@0
   130
	Returns the amount of space available for the clip.
sl@0
   131
sl@0
   132
	This is a virtual function that each derived class must implement.
sl@0
   133
sl@0
   134
	@return The amount of space available.
sl@0
   135
	*/
sl@0
   136
	virtual TInt64 BytesFree() = 0 ;
sl@0
   137
sl@0
   138
	/**
sl@0
   139
	Returns the size of the clip in bytes.
sl@0
   140
sl@0
   141
	This is a virtual function that each derived class must implement.
sl@0
   142
sl@0
   143
	@return	The size of the clip.
sl@0
   144
	*/
sl@0
   145
	virtual TInt Size() = 0 ;
sl@0
   146
sl@0
   147
	/**
sl@0
   148
	Deletes the clip. 
sl@0
   149
sl@0
   150
	This should be overriden in the derived	classes, the default version returns KErrNotSupported.
sl@0
   151
sl@0
   152
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   153
	        another of the system-wide error codes.
sl@0
   154
	*/
sl@0
   155
	virtual TInt Delete()	{return KErrNotSupported;}
sl@0
   156
sl@0
   157
	/**
sl@0
   158
	Sets the size of the clip. This should be overriden in the derived
sl@0
   159
	classes, the default version returns KErrNotSupported.
sl@0
   160
sl@0
   161
	@param  aSize
sl@0
   162
	        The size of the clip.
sl@0
   163
sl@0
   164
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   165
	        another of the system-wide error codes.
sl@0
   166
	*/
sl@0
   167
	inline virtual TInt SetSize(TInt aSize);
sl@0
   168
sl@0
   169
protected :
sl@0
   170
	/**
sl@0
   171
	Protected constructor.
sl@0
   172
sl@0
   173
	@param  aSourceType
sl@0
   174
	        The source type.
sl@0
   175
	@param  aSinkType
sl@0
   176
	        The sink type.
sl@0
   177
	*/
sl@0
   178
	CMMFClip( TUid aSourceType, TUid aSinkType ) : MDataSource( aSourceType ), MDataSink( aSinkType ) {}
sl@0
   179
	} ;
sl@0
   180
sl@0
   181
inline TInt CMMFClip::SetSize(TInt /*aSize*/)
sl@0
   182
{
sl@0
   183
	return KErrNotSupported;
sl@0
   184
}
sl@0
   185
sl@0
   186
sl@0
   187
#endif