mmmw_plat/telephony_multimedia_service_api/inc/tmsbuffer.h
changeset 0 71ca22bcf22a
child 12 2eb3b066cc7d
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef TMS_BUFFER_H
       
    19 #define TMS_BUFFER_H
       
    20 
       
    21 #include <tms.h>
       
    22 
       
    23 namespace TMS {
       
    24 
       
    25 /**
       
    26  * TMSBuffer class
       
    27  *
       
    28  * This interface provides data buffers to TMS clients. This class allows
       
    29  * clients to allocate data by themselves or request a specific size of the
       
    30  * buffer from the factory.
       
    31  *
       
    32  * @lib tmsapi.lib
       
    33  *
       
    34  */
       
    35 class TMSBuffer
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Return buffer type.
       
    40      *
       
    41      * @param  buftype
       
    42      *      Type of the buffer object (TMS_BUFFER_MEMORY).
       
    43      *
       
    44      * @return
       
    45      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    46      *
       
    47      */
       
    48     virtual gint GetType(TMSBufferType& buftype) = 0;
       
    49 
       
    50     /**
       
    51      * Returns time stamp of the buffer so that the framework can determine
       
    52      * the time at which this buffer has to be rendered by the output device
       
    53      * sink.
       
    54      *
       
    55      * @param  ts
       
    56      *      Time stamp in microseconds.
       
    57      *
       
    58      * @return
       
    59      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    60      *
       
    61      */
       
    62     virtual gint GetTimeStamp(guint64& ts) = 0;
       
    63 
       
    64     /**
       
    65      * Sets the time stamp on the Buffer so that the framework can determine
       
    66      * the time at which this buffer has to be rendered by the output device
       
    67      * sink.
       
    68      *
       
    69      * @param  ts
       
    70      *      Time stamp in microseconds.
       
    71      *
       
    72      * @return
       
    73      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    74      *
       
    75      */
       
    76     virtual gint SetTimeStamp(const guint64 ts) = 0;
       
    77 
       
    78     /**
       
    79      * Returns size of data in the buffer.
       
    80      *
       
    81      * @param  size
       
    82      *      Size of data in the buffer.
       
    83      *
       
    84      * @return
       
    85      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    86      *
       
    87      */
       
    88     virtual gint GetDataSize(guint& size) = 0;
       
    89 
       
    90     /**
       
    91      * Set size of data in the buffer after filling in by the client.
       
    92      *
       
    93      * @param  size
       
    94      *      Size of data in the buffer.
       
    95      *
       
    96      * @return
       
    97      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    98      *
       
    99      */
       
   100     virtual gint SetDataSize(const guint size) = 0;
       
   101 
       
   102     /**
       
   103      * Return pointer to the memory location of the data associated with this
       
   104      * buffer.
       
   105      *
       
   106      * @param  bufptr
       
   107      *      Pointer to the data stored in the buffer.
       
   108      *
       
   109      * @return
       
   110      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   111      *
       
   112      */
       
   113     virtual gint GetDataPtr(guint8*& bufptr) = 0;
       
   114     };
       
   115 
       
   116 } //namespace TMS
       
   117 
       
   118 #endif //TMS_BUFFER_H