annotate loader/dshow/cmediasample.c @ 1728:014b29286ec4

Remove superfluous 'const' parameter attributes to fix some compiler warnings when compiling with mediaLib.
author jkeil
date Tue, 28 Aug 2001 15:37:24 +0000
parents da26060c81ef
children ce45cce7f7a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
1 #include "cmediasample.h"
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
2 #include <wine/winerror.h>
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
3 #include <stdio.h>
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
4 #include <string.h>
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
5
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
6 static long STDCALL CMediaSample_QueryInterface(IUnknown * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
7 /* [in] */ IID* iid,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
8 /* [iid_is][out] */ void **ppv)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
9 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
10 Debug printf("CMediaSample_QueryInterface() called\n");
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
11 if (!ppv)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
12 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
13 if (!memcmp(iid, &IID_IUnknown, 16))
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
14 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
15 *ppv=(void*)This;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
16 This->vt->AddRef(This);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
17 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
18 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
19 if (!memcmp(iid, &IID_IMediaSample, 16))
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
20 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
21 *ppv=(void*)This;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
22 This->vt->AddRef(This);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
23 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
24 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
25 return E_NOINTERFACE;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
26 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
27
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
28 static long STDCALL CMediaSample_AddRef(IUnknown* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
29 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
30 Debug printf("CMediaSample_AddRef() called\n");
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
31 ((CMediaSample*)This)->refcount++;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
32 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
33 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
34
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
35 static long STDCALL CMediaSample_Release(IUnknown* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
36 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
37 Debug printf("%p: CMediaSample_Release() called, new refcount %d\n",
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
38 This, ((CMediaSample*)This)->refcount-1);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
39 CMediaSample* parent=(CMediaSample*)This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
40 if (--((CMediaSample*)This)->refcount==0)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
41 parent->all->vt->ReleaseBuffer((IMemAllocator*)(parent->all),
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
42 (IMediaSample*)This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
43 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
44 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
45
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
46 static HRESULT STDCALL CMediaSample_GetPointer(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
47 /* [out] */ BYTE **ppBuffer)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
48 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
49 Debug printf("%p: CMediaSample_GetPointer() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
50 if (!ppBuffer)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
51 return E_INVALIDARG;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
52 *ppBuffer=(BYTE *)((CMediaSample*)This)->block;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
53 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
54 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
55
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
56 static long STDCALL CMediaSample_GetSize(IMediaSample * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
57 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
58 Debug printf("%p: CMediaSample_GetSize() called -> %d\n",
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
59 This, ((CMediaSample*)This)->size);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
60 return ((CMediaSample*)This)->size;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
61 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
62
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
63 static HRESULT STDCALL CMediaSample_GetTime(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
64 /* [out] */ REFERENCE_TIME *pTimeStart,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
65 /* [out] */ REFERENCE_TIME *pTimeEnd)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
66 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
67 Debug printf("%p: CMediaSample_GetTime() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
68 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
69 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
70
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
71 static HRESULT STDCALL CMediaSample_SetTime(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
72 /* [in] */ REFERENCE_TIME *pTimeStart,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
73 /* [in] */ REFERENCE_TIME *pTimeEnd)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
74 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
75 Debug printf("%p: CMediaSample_SetTime() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
76 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
77 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
78
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
79 static HRESULT STDCALL CMediaSample_IsSyncPoint(IMediaSample * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
80 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
81 Debug printf("%p: CMediaSample_IsSyncPoint() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
82 if (((CMediaSample*)This)->isSyncPoint)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
83 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
84 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
85 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
86
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
87 static HRESULT STDCALL CMediaSample_SetSyncPoint(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
88 long bIsSyncPoint)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
89 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
90 Debug printf("%p: CMediaSample_SetSyncPoint() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
91 ((CMediaSample*)This)->isSyncPoint=bIsSyncPoint;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
92 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
93 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
94
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
95 static HRESULT STDCALL CMediaSample_IsPreroll(IMediaSample * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
96 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
97 Debug printf("%p: CMediaSample_IsPreroll() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
98
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
99 if (((CMediaSample*)This)->isPreroll)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
100 return 0;//S_OK
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
101
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
102 return 1;//S_FALSE
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
103 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
104
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
105 static HRESULT STDCALL CMediaSample_SetPreroll(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
106 long bIsPreroll)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
107 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
108 Debug printf("%p: CMediaSample_SetPreroll() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
109 ((CMediaSample*)This)->isPreroll=bIsPreroll;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
110 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
111 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
112
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
113 static long STDCALL CMediaSample_GetActualDataLength(IMediaSample * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
114 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
115 Debug printf("%p: CMediaSample_GetActualDataLength() called -> %d\n", This, ((CMediaSample*)This)->actual_size);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
116 return ((CMediaSample*)This)->actual_size;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
117 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
118
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
119 static HRESULT STDCALL CMediaSample_SetActualDataLength(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
120 long __MIDL_0010)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
121 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
122 Debug printf("%p: CMediaSample_SetActualDataLength(%ld) called\n", This, __MIDL_0010);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
123 if (__MIDL_0010 > ((CMediaSample*)This)->size)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
124 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
125 printf("%p: ERROR: CMediaSample buffer overflow\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
126 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
127 ((CMediaSample*)This)->actual_size=__MIDL_0010;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
128 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
129 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
130
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
131 static HRESULT STDCALL CMediaSample_GetMediaType(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
132 AM_MEDIA_TYPE **ppMediaType)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
133 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
134 Debug printf("%p: CMediaSample_GetMediaType() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
135 if(!ppMediaType)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
136 return E_INVALIDARG;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
137 if(!((CMediaSample*)This)->type_valid)
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
138 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
139 *ppMediaType=0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
140 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
141 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
142 AM_MEDIA_TYPE& t=((CMediaSample*)This)->media_type;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
143 // if(t.pbFormat)CoTaskMemFree(t.pbFormat);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
144 (*ppMediaType)=(AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
145 memcpy(*ppMediaType, &t, sizeof(AM_MEDIA_TYPE));
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
146 (*ppMediaType)->pbFormat=(char*)CoTaskMemAlloc(t.cbFormat);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
147 memcpy((*ppMediaType)->pbFormat, t.pbFormat, t.cbFormat);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
148 // *ppMediaType=0; //media type was not changed
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
149 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
150 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
151
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
152 static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
153 AM_MEDIA_TYPE *pMediaType)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
154 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
155 Debug printf("%p: CMediaSample_SetMediaType() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
156 if (!pMediaType)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
157 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
158 AM_MEDIA_TYPE& t = ((CMediaSample*)This)->media_type;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
159 if (t.pbFormat)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
160 CoTaskMemFree(t.pbFormat);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
161 t = *pMediaType;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
162 t.pbFormat = (char*)CoTaskMemAlloc(t.cbFormat);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
163 memcpy(t.pbFormat, pMediaType->pbFormat, t.cbFormat);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
164 ((CMediaSample*)This)->type_valid=1;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
165
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
166 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
167 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
168
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
169 static HRESULT STDCALL CMediaSample_IsDiscontinuity(IMediaSample * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
170 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
171 Debug printf("%p: CMediaSample_IsDiscontinuity() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
172 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
173 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
174
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
175 static HRESULT STDCALL CMediaSample_SetDiscontinuity(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
176 long bDiscontinuity)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
177 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
178 Debug printf("%p: CMediaSample_SetDiscontinuity() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
179 return E_NOTIMPL;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
180 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
181
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
182 static HRESULT STDCALL CMediaSample_GetMediaTime(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
183 /* [out] */ LONGLONG *pTimeStart,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
184 /* [out] */ LONGLONG *pTimeEnd)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
185 {
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
186 Debug printf("%p: CMediaSample_GetMediaTime() called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
187 return E_NOTIMPL;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
188 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
189
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
190 static HRESULT STDCALL CMediaSample_SetMediaTime(IMediaSample * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
191 /* [in] */ LONGLONG *pTimeStart,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
192 /* [in] */ LONGLONG *pTimeEnd)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
193 {
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
194 Debug printf("%p: CMediaSample_SetMediaTime() called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
195 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
196 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
197
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
198 CMediaSample::CMediaSample(IMemAllocator* allocator, long _size)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
199 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
200 vt = new IMediaSample_vt;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
201
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
202 vt->QueryInterface = CMediaSample_QueryInterface;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
203 vt->AddRef = CMediaSample_AddRef;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
204 vt->Release = CMediaSample_Release;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
205 vt->GetPointer = CMediaSample_GetPointer;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
206 vt->GetSize = CMediaSample_GetSize;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
207 vt->GetTime = CMediaSample_GetTime;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
208 vt->SetTime = CMediaSample_SetTime;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
209 vt->IsSyncPoint = CMediaSample_IsSyncPoint;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
210 vt->SetSyncPoint = CMediaSample_SetSyncPoint;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
211 vt->IsPreroll = CMediaSample_IsPreroll;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
212 vt->SetPreroll = CMediaSample_SetPreroll;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
213 vt->GetActualDataLength = CMediaSample_GetActualDataLength;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
214 vt->SetActualDataLength = CMediaSample_SetActualDataLength;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
215 vt->GetMediaType = CMediaSample_GetMediaType;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
216 vt->SetMediaType = CMediaSample_SetMediaType;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
217 vt->IsDiscontinuity = CMediaSample_IsDiscontinuity;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
218 vt->SetDiscontinuity = CMediaSample_SetDiscontinuity;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
219 vt->GetMediaTime = CMediaSample_GetMediaTime;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
220 vt->SetMediaTime = CMediaSample_SetMediaTime;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
221
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
222 all = allocator;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
223 size = _size;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
224 refcount = 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
225 actual_size = 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
226 media_type.pbFormat = 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
227 isPreroll = 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
228 type_valid = 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
229 own_block = new char[size];
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
230 block = own_block;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
231 Debug printf("%p: Creating media sample with size %ld, buffer %p\n",
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
232 this, _size, block);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
233 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
234
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
235 CMediaSample::~CMediaSample()
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
236 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
237 Debug printf("%p: CMediaSample::~CMediaSample() called\n", this);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
238 if (!vt)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
239 printf("Second delete of CMediaSample()!!|\n");
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
240 delete vt;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
241 delete own_block;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
242 if (media_type.pbFormat)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
243 CoTaskMemFree(media_type.pbFormat);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
244 }