qtms/inc/qtmsmembuffer.h
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
child 59 666f9a5a90a9
equal deleted inserted replaced
55:6c1dfe4da5dd 56:63223d4fd956
     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_MEM_BUFFER_H
       
    19 #define QTMS_MEM_BUFFER_H
       
    20 
       
    21 #include <qtmsbuffer.h>
       
    22 
       
    23 // FORWARD DECLARATION
       
    24 namespace TMS
       
    25 {
       
    26 class TMSBuffer;
       
    27 }
       
    28 
       
    29 namespace QTMS
       
    30 {
       
    31 
       
    32 // QTMSMemBuffer class
       
    33 class QTMSMemBuffer: public QTMSBuffer
       
    34 {
       
    35 public:
       
    36     virtual ~QTMSMemBuffer();
       
    37 
       
    38     /**
       
    39      * Factory methods
       
    40      */
       
    41     static gint Create(QTMSBuffer*& buffer, TMS::TMSBuffer*& tmsbuffer);
       
    42 
       
    43     /**
       
    44      * Return buffer type.
       
    45      *
       
    46      * @param  buftype
       
    47      *      Type of the buffer object (QTMS_BUFFER_MEMORY).
       
    48      *
       
    49      * @return
       
    50      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
    51      *
       
    52      */
       
    53     virtual gint GetType(QTMSBufferType& buftype);
       
    54 
       
    55     /**
       
    56      Gets the timestamp on the Buffer so that the framework can
       
    57      determine the time at which this buffer has to be rendered
       
    58      by the output device sink.
       
    59 
       
    60      @param ts
       
    61      timestamp in microseconds
       
    62      */
       
    63     virtual gint GetTimeStamp(guint64& ts);
       
    64 
       
    65     /**
       
    66      Sets the timestamp on the Buffer so that the framework can
       
    67      determine the time at which this buffer has to be rendered
       
    68      by the output device sink.
       
    69 
       
    70      @param ts
       
    71      timestamp in milliseconds
       
    72      */
       
    73     virtual gint SetTimeStamp(const guint64 ts);
       
    74 
       
    75     /**
       
    76      Gets the size of data in the buffer specified by the client.
       
    77 
       
    78      @param size
       
    79      size of data in bytes
       
    80      */
       
    81     virtual gint GetDataSize(guint& size);
       
    82 
       
    83     /**
       
    84      Sets the size of data in the buffer after the client
       
    85      fill it.
       
    86 
       
    87      @param size
       
    88      size of data in bytes
       
    89      */
       
    90     virtual gint SetDataSize(const guint size);
       
    91 
       
    92     /**
       
    93      Gets the pointer to the memory location associated with this
       
    94      buffer where the data is stored.
       
    95 
       
    96      @param bufptr
       
    97      ptr to the data stored in the buffer.
       
    98      */
       
    99     virtual gint GetDataPtr(guint8*& bufptr);
       
   100 
       
   101 private:
       
   102     QTMSMemBuffer();
       
   103     gint PostConstruct(guint size, TMS::TMSBuffer*& tmsbuffer);
       
   104 
       
   105 protected:
       
   106     TMS::TMSBuffer* iTmsBuffer;
       
   107 
       
   108 private:
       
   109     guint iBufferSize;
       
   110     guint64 iTimeStamp;
       
   111     guint8* iDataPtr;
       
   112     gboolean iOwnsBuffer;
       
   113 };
       
   114 
       
   115 } //namespace QTMS
       
   116 
       
   117 #endif //QTMS_MEM_BUFFER_H