168
|
1 #ifndef _CMEDIASAMPLE_H
|
|
2 #define _CMEDIASAMPLE_H
|
|
3
|
|
4 #include "interfaces.h"
|
|
5 #include "guids.h"
|
|
6 #include "default.h"
|
|
7 class CMediaSample: public IMediaSample
|
|
8 {
|
|
9 IMemAllocator* all;
|
|
10 int size;
|
|
11 int actual_size;
|
|
12 char* block;
|
713
|
13 char* old_block;
|
168
|
14 int refcount;
|
|
15 int isPreroll;
|
|
16 int isSyncPoint;
|
|
17 AM_MEDIA_TYPE media_type;
|
|
18 int type_valid;
|
|
19 public:
|
|
20 CMediaSample(IMemAllocator* allocator, long _size);
|
|
21 ~CMediaSample();
|
713
|
22 void SetPointer(char* pointer) { old_block=block; block=pointer; }
|
|
23 void ResetPointer() { block=old_block; old_block=0; }
|
168
|
24
|
|
25 static long STDCALL QueryInterface (
|
|
26 IUnknown * This,
|
|
27 /* [in] */ IID* riid,
|
|
28 /* [iid_is][out] */ void **ppvObject);
|
|
29
|
|
30 static long STDCALL AddRef (
|
|
31 IUnknown * This);
|
|
32
|
|
33 static long STDCALL Release (
|
|
34 IUnknown * This);
|
|
35
|
|
36 static HRESULT STDCALL GetPointer (
|
|
37 IMediaSample * This,
|
|
38 /* [out] */ BYTE **ppBuffer);
|
|
39
|
|
40 static long STDCALL GetSize (
|
|
41 IMediaSample * This);
|
|
42
|
|
43 static HRESULT STDCALL GetTime (
|
|
44 IMediaSample * This,
|
|
45 /* [out] */ REFERENCE_TIME *pTimeStart,
|
|
46 /* [out] */ REFERENCE_TIME *pTimeEnd);
|
|
47
|
|
48 static HRESULT STDCALL SetTime (
|
|
49 IMediaSample * This,
|
|
50 /* [in] */ REFERENCE_TIME *pTimeStart,
|
|
51 /* [in] */ REFERENCE_TIME *pTimeEnd);
|
|
52
|
|
53 static HRESULT STDCALL IsSyncPoint (
|
|
54 IMediaSample * This);
|
|
55
|
|
56 static HRESULT STDCALL SetSyncPoint (
|
|
57 IMediaSample * This,
|
|
58 long bIsSyncPoint);
|
|
59
|
|
60 static HRESULT STDCALL IsPreroll (
|
|
61 IMediaSample * This);
|
|
62
|
|
63 static HRESULT STDCALL SetPreroll (
|
|
64 IMediaSample * This,
|
|
65 long bIsPreroll);
|
|
66
|
|
67 static long STDCALL GetActualDataLength (
|
|
68 IMediaSample * This);
|
|
69
|
|
70 static HRESULT STDCALL SetActualDataLength (
|
|
71 IMediaSample * This,
|
|
72 long __MIDL_0010);
|
|
73
|
|
74 static HRESULT STDCALL GetMediaType (
|
|
75 IMediaSample * This,
|
|
76 AM_MEDIA_TYPE **ppMediaType);
|
|
77
|
|
78 static HRESULT STDCALL SetMediaType (
|
|
79 IMediaSample * This,
|
|
80 AM_MEDIA_TYPE *pMediaType);
|
|
81
|
|
82 static HRESULT STDCALL IsDiscontinuity (
|
|
83 IMediaSample * This);
|
|
84
|
|
85 static HRESULT STDCALL SetDiscontinuity (
|
|
86 IMediaSample * This,
|
|
87 long bDiscontinuity);
|
|
88
|
|
89 static HRESULT STDCALL GetMediaTime (
|
|
90 IMediaSample * This,
|
|
91 /* [out] */ LONGLONG *pTimeStart,
|
|
92 /* [out] */ LONGLONG *pTimeEnd);
|
|
93
|
|
94 static HRESULT STDCALL SetMediaTime (
|
|
95 IMediaSample * This,
|
|
96 /* [in] */ LONGLONG *pTimeStart,
|
|
97 /* [in] */ LONGLONG *pTimeEnd);
|
|
98 };
|
|
99 #endif
|