mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsbuffer.h
changeset 27 cbb1bfb7ebfb
child 32 edd273b3192a
equal deleted inserted replaced
25:d881023c13eb 27:cbb1bfb7ebfb
       
     1 /*
       
     2  * Copyright (c) 2010 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: QT Bindings for TMS
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef QTMS_BUFFER_H
       
    19 #define QTMS_BUFFER_H
       
    20 
       
    21 #include <qtms.h>
       
    22 #include <QObject>
       
    23 
       
    24 namespace QTMS {
       
    25 
       
    26 /**
       
    27  * QTMSBuffer class
       
    28  *
       
    29  * This interface provides data buffers to QTMS clients. This class allows
       
    30  * clients to allocate data by themselves or request a specific size of the
       
    31  * buffer from the factory.
       
    32  *
       
    33  * @lib QTMSapi.lib
       
    34  *
       
    35  */
       
    36 class QTMSBuffer : public QObject
       
    37     {
       
    38     Q_OBJECT
       
    39 public:
       
    40     /**
       
    41      * Return buffer type.
       
    42      *
       
    43      * @param  buftype
       
    44      *      Type of the buffer object (QTMS_BUFFER_MEMORY).
       
    45      *
       
    46      * @return
       
    47      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
    48      *
       
    49      */
       
    50     virtual gint GetType(QTMSBufferType& buftype)=0;
       
    51 
       
    52     /**
       
    53      * Returns time stamp of the buffer so that the framework can determine
       
    54      * the time at which this buffer has to be rendered by the output device
       
    55      * sink.
       
    56      *
       
    57      * @param  ts
       
    58      *      Time stamp in microseconds.
       
    59      *
       
    60      * @return
       
    61      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
    62      *
       
    63      */
       
    64     virtual gint GetTimeStamp(guint64& ts)=0;
       
    65 
       
    66     /**
       
    67      * Sets the time stamp on the Buffer so that the framework can determine
       
    68      * the time at which this buffer has to be rendered by the output device
       
    69      * sink.
       
    70      *
       
    71      * @param  ts
       
    72      *      Time stamp in microseconds.
       
    73      *
       
    74      * @return
       
    75      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
    76      *
       
    77      */
       
    78     virtual gint SetTimeStamp(const guint64 ts) =0;
       
    79 
       
    80     /**
       
    81      * Returns size of data in the buffer.
       
    82      *
       
    83      * @param  size
       
    84      *      Size of data in the buffer.
       
    85      *
       
    86      * @return
       
    87      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
    88      *
       
    89      */
       
    90     virtual gint GetDataSize(guint& size)=0;
       
    91 
       
    92     /**
       
    93      * Set size of data in the buffer after filling in by the client.
       
    94      *
       
    95      * @param  size
       
    96      *      Size of data in the buffer.
       
    97      *
       
    98      * @return
       
    99      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
   100      *
       
   101      */
       
   102     virtual gint SetDataSize(const guint size)=0;
       
   103 
       
   104     /**
       
   105      * Return pointer to the memory location of the data associated with this
       
   106      * buffer.
       
   107      *
       
   108      * @param  bufptr
       
   109      *      Pointer to the data stored in the buffer.
       
   110      *
       
   111      * @return
       
   112      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
   113      *
       
   114      */
       
   115     virtual gint GetDataPtr(guint8*& bufptr) =0;
       
   116     };
       
   117 
       
   118 } //namespace QTMS
       
   119 
       
   120 #endif //QTMS_BUFFER_H