|
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_MEM_BUFFER_H |
|
19 #define TMS_MEM_BUFFER_H |
|
20 |
|
21 #include <tmsbuffer.h> |
|
22 |
|
23 namespace TMS { |
|
24 |
|
25 // TMSMemBuffer class |
|
26 class TMSMemBuffer : public TMSBuffer |
|
27 { |
|
28 public: |
|
29 ~TMSMemBuffer(); |
|
30 |
|
31 static gint Create(guint size, TMSBuffer*& tmsbuffer); |
|
32 static gint Create(guint size, guint8* dataptr, TMSBuffer*& tmsbuffer); |
|
33 |
|
34 // Implementation of TMSBuffer interface begins |
|
35 virtual gint GetType(TMSBufferType& buftype); |
|
36 /** |
|
37 Gets the timestamp on the Buffer so that the framework can |
|
38 determine the time at which this buffer has to be rendered |
|
39 by the output device sink. |
|
40 |
|
41 @param ts |
|
42 timestamp in microseconds |
|
43 |
|
44 */ |
|
45 virtual gint GetTimeStamp(guint64& ts); |
|
46 |
|
47 /** |
|
48 Sets the timestamp on the Buffer so that the framework can |
|
49 determine the time at which this buffer has to be rendered |
|
50 by the output device sink. |
|
51 |
|
52 @param ts |
|
53 timestamp in milliseconds |
|
54 |
|
55 */ |
|
56 virtual gint SetTimeStamp(const guint64 ts); |
|
57 |
|
58 /** |
|
59 Gets the size of data in the buffer specified by the client. |
|
60 |
|
61 @param size |
|
62 size of data in bytes |
|
63 |
|
64 */ |
|
65 virtual gint GetDataSize(guint& size); |
|
66 |
|
67 /** |
|
68 Sets the size of data in the buffer after the client |
|
69 fill it. |
|
70 |
|
71 @param size |
|
72 size of data in bytes |
|
73 |
|
74 */ |
|
75 virtual gint SetDataSize(const guint size); |
|
76 |
|
77 /** |
|
78 Gets the pointer to the memory location associated with this |
|
79 buffer where the data is stored. |
|
80 |
|
81 @param bufptr |
|
82 ptr to the data stored in the buffer. |
|
83 |
|
84 */ |
|
85 virtual gint GetDataPtr(guint8*& bufptr); |
|
86 |
|
87 private: |
|
88 TMSMemBuffer(); |
|
89 gint PostConstruct(guint size); |
|
90 |
|
91 private: |
|
92 guint iBufferSize; |
|
93 guint iTimeStamp; |
|
94 guint8* iDataPtr; |
|
95 gboolean iOwnsBuffer; |
|
96 }; |
|
97 |
|
98 } //namespace TMS |
|
99 |
|
100 #endif //TMS_MEM_BUFFER_H |