Mercurial > mplayer.hg
annotate loader/dshow/DS_Filter.c @ 33263:5f527a9a9521
Add an exit function.
This function will allow performing clean-up operations.
(MPlayer calls guiDone() before exiting, but only if the GUI has been
initialized, i.e. if guiInit() has been called successfully. Any
exit_player()/exit_player_with_rc() after GUI's cfg_read() until
guiInit(), or any exit_player() during guiInit() itself will end the GUI
without calling guiDone(). This exit function will at least handle
abortions during guiInit() itself. It will be called twice in case of an
guiExit() after GUI initialization - first directly, next by guiDone()
via MPlayer's exit_player_with_rc().)
author | ib |
---|---|
date | Tue, 03 May 2011 12:19:22 +0000 |
parents | c121d03db8b9 |
children |
rev | line source |
---|---|
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9967
diff
changeset
|
1 /* |
18783 | 2 * Modified for use with MPlayer, detailed changelog at |
3 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9967
diff
changeset
|
4 */ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9967
diff
changeset
|
5 |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
6 #include "config.h" |
1545 | 7 #include "DS_Filter.h" |
30824 | 8 #include "graph.h" |
30170
008338d7679f
Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents:
29263
diff
changeset
|
9 #include "loader/drv.h" |
008338d7679f
Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents:
29263
diff
changeset
|
10 #include "loader/com.h" |
168 | 11 #include <stdio.h> |
12 #include <string.h> | |
7386 | 13 #include <stdlib.h> |
30170
008338d7679f
Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents:
29263
diff
changeset
|
14 #include "loader/win32.h" // printf macro |
1545 | 15 |
168 | 16 typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**); |
17 | |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
18 #ifndef WIN32_LOADER |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
19 const GUID IID_IUnknown = |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
20 { |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
21 0x00000000, 0x0000, 0x0000, |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
22 {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
23 }; |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
24 const GUID IID_IClassFactory = |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
25 { |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
26 0x00000001, 0x0000, 0x0000, |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
27 {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
28 }; |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
29 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
30 HRESULT STDCALL CoInitialize(LPVOID pvReserved); |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
31 void STDCALL CoUninitialize(void); |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
32 #endif |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
33 |
3056 | 34 static void DS_Filter_Start(DS_Filter* This) |
168 | 35 { |
3056 | 36 HRESULT hr; |
37 | |
38 //Debug printf("DS_Filter_Start(%p)\n", This); | |
8292 | 39 hr = This->m_pFilter->vt->Run(This->m_pFilter, (REFERENCE_TIME)0); |
3056 | 40 if (hr != 0) |
41 { | |
42 Debug printf("WARNING: m_Filter->Run() failed, error code %x\n", (int)hr); | |
43 } | |
168 | 44 } |
45 | |
3056 | 46 static void DS_Filter_Stop(DS_Filter* This) |
713 | 47 { |
3467 | 48 if (This->m_pAll) |
3056 | 49 { |
50 //Debug printf("DS_Filter_Stop(%p)\n", This); | |
3467 | 51 This->m_pFilter->vt->Stop(This->m_pFilter); // causes weird crash ??? FIXME |
3056 | 52 This->m_pAll->vt->Release((IUnknown*)This->m_pAll); |
53 This->m_pAll = 0; | |
54 } | |
1545 | 55 } |
56 | |
3056 | 57 void DS_Filter_Destroy(DS_Filter* This) |
1545 | 58 { |
3056 | 59 This->Stop(This); |
60 | |
61 if (This->m_pOurInput) | |
62 This->m_pOurInput->vt->Release((IUnknown*)This->m_pOurInput); | |
63 if (This->m_pInputPin) | |
64 This->m_pInputPin->vt->Disconnect(This->m_pInputPin); | |
65 if (This->m_pOutputPin) | |
66 This->m_pOutputPin->vt->Disconnect(This->m_pOutputPin); | |
67 if (This->m_pFilter) | |
68 This->m_pFilter->vt->Release((IUnknown*)This->m_pFilter); | |
69 if (This->m_pOutputPin) | |
70 This->m_pOutputPin->vt->Release((IUnknown*)This->m_pOutputPin); | |
71 if (This->m_pInputPin) | |
72 This->m_pInputPin->vt->Release((IUnknown*)This->m_pInputPin); | |
73 if (This->m_pImp) | |
74 This->m_pImp->vt->Release((IUnknown*)This->m_pImp); | |
713 | 75 |
3056 | 76 if (This->m_pOurOutput) |
77 This->m_pOurOutput->vt->Release((IUnknown*)This->m_pOurOutput); | |
78 if (This->m_pParentFilter) | |
3130 | 79 This->m_pParentFilter->vt->Release((IUnknown*)This->m_pParentFilter); |
3056 | 80 if (This->m_pSrcFilter) |
81 This->m_pSrcFilter->vt->Release((IUnknown*)This->m_pSrcFilter); | |
713 | 82 |
83 // FIXME - we are still leaving few things allocated! | |
3056 | 84 if (This->m_iHandle) |
8292 | 85 FreeLibrary((unsigned)This->m_iHandle); |
3056 | 86 |
87 free(This); | |
88 | |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
89 #ifdef WIN32_LOADER |
3056 | 90 CodecRelease(); |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
91 #else |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
92 CoUninitialize(); |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
93 #endif |
713 | 94 } |
95 | |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
96 static HRESULT STDCALL DS_Filter_CopySample(void* pUserData,IMediaSample* pSample){ |
24405 | 97 BYTE* pointer; |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
98 int len; |
25682 | 99 SampleProcUserData* pData=pUserData; |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
100 Debug printf("CopySample called(%p,%p)\n",pSample,pUserData); |
25682 | 101 if (pSample->vt->GetPointer(pSample, &pointer)) |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
102 return 1; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
103 len = pSample->vt->GetActualDataLength(pSample); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
104 if (len == 0) |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
105 len = pSample->vt->GetSize(pSample);//for iv50 |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
106 |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
107 pData->frame_pointer = pointer; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
108 pData->frame_size = len; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
109 /* |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
110 FILE* file=fopen("./uncompr.bmp", "wb"); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
111 char head[14]={0x42, 0x4D, 0x36, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00}; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
112 *(int*)(&head[2])=len+0x36; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
113 fwrite(head, 14, 1, file); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
114 fwrite(&((VIDEOINFOHEADER*)me.type.pbFormat)->bmiHeader, sizeof(BITMAPINFOHEADER), 1, file); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
115 fwrite(pointer, len, 1, file); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
116 fclose(file); |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
117 */ |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
118 return 0; |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
119 } |
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
120 |
3056 | 121 DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id, |
122 AM_MEDIA_TYPE* in_fmt, | |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
123 AM_MEDIA_TYPE* out_fmt,SampleProcUserData* pUserData) |
168 | 124 { |
3467 | 125 int init = 0; |
7472
c4434bdf6e51
tons of warning fixes, also some 10l bugfixes, including Dominik's PVA bug
arpi
parents:
7386
diff
changeset
|
126 // char eb[250]; |
3467 | 127 const char* em = NULL; |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
128 MemAllocator* tempAll; |
30824 | 129 FilterGraph* graph; |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
130 ALLOCATOR_PROPERTIES props,props1; |
25677 | 131 DS_Filter* This = malloc(sizeof(DS_Filter)); |
3056 | 132 if (!This) |
133 return NULL; | |
134 | |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
135 #ifdef WIN32_LOADER |
3056 | 136 CodecAlloc(); |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
137 #else |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
138 CoInitialize(0L); |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
8292
diff
changeset
|
139 #endif |
3056 | 140 |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
141 /* |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
142 tempAll is not used anywhere. |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
143 MemAllocatorCreate() is called to ensure that RegisterComObject for IMemoryAllocator |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
144 will be called before possible call |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
145 to CoCreateInstance(...,&IID_IMemoryAllocator,...) from binary codec. |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
146 */ |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
147 tempAll=MemAllocatorCreate(); |
3056 | 148 This->m_pFilter = NULL; |
149 This->m_pInputPin = NULL; | |
150 This->m_pOutputPin = NULL; | |
151 This->m_pSrcFilter = NULL; | |
152 This->m_pParentFilter = NULL; | |
153 This->m_pOurInput = NULL; | |
154 This->m_pOurOutput = NULL; | |
155 This->m_pAll = NULL; | |
156 This->m_pImp = NULL; | |
157 | |
158 This->Start = DS_Filter_Start; | |
159 This->Stop = DS_Filter_Stop; | |
160 | |
161 for (;;) | |
168 | 162 { |
3056 | 163 GETCLASS func; |
164 struct IClassFactory* factory = NULL; | |
165 struct IUnknown* object = NULL; | |
166 IEnumPins* enum_pins = 0; | |
167 IPin* array[256]; | |
168 ULONG fetched; | |
25679
12fcf17e83e0
Move variable declaration into block where it is used.
reimar
parents:
25678
diff
changeset
|
169 HRESULT result; |
3056 | 170 unsigned int i; |
30824 | 171 static const uint16_t filter_name[] = { 'F', 'i', 'l', 't', 'e', 'r', 0 }; |
3056 | 172 |
173 This->m_iHandle = LoadLibraryA(dllname); | |
174 if (!This->m_iHandle) | |
713 | 175 { |
3467 | 176 em = "could not open DirectShow DLL"; |
3056 | 177 break; |
713 | 178 } |
8292 | 179 func = (GETCLASS)GetProcAddress((unsigned)This->m_iHandle, "DllGetClassObject"); |
713 | 180 if (!func) |
181 { | |
3467 | 182 em = "illegal or corrupt DirectShow DLL"; |
3056 | 183 break; |
713 | 184 } |
24405 | 185 result = func(id, &IID_IClassFactory, (void*)&factory); |
1545 | 186 if (result || !factory) |
3056 | 187 { |
3467 | 188 em = "no such class object"; |
3056 | 189 break; |
190 } | |
24405 | 191 result = factory->vt->CreateInstance(factory, 0, &IID_IUnknown, (void*)&object); |
168 | 192 factory->vt->Release((IUnknown*)factory); |
1545 | 193 if (result || !object) |
3056 | 194 { |
3467 | 195 em = "class factory failure"; |
3056 | 196 break; |
197 } | |
24405 | 198 result = object->vt->QueryInterface(object, &IID_IBaseFilter, (void*)&This->m_pFilter); |
168 | 199 object->vt->Release((IUnknown*)object); |
3056 | 200 if (result || !This->m_pFilter) |
201 { | |
7386 | 202 em = "object does not provide IBaseFilter interface"; |
3056 | 203 break; |
204 } | |
30824 | 205 |
206 graph = FilterGraphCreate(); | |
207 result = This->m_pFilter->vt->JoinFilterGraph(This->m_pFilter, (IFilterGraph*)graph, filter_name); | |
208 | |
3056 | 209 // enumerate pins |
210 result = This->m_pFilter->vt->EnumPins(This->m_pFilter, &enum_pins); | |
211 if (result || !enum_pins) | |
212 { | |
3467 | 213 em = "could not enumerate pins"; |
3056 | 214 break; |
215 } | |
713 | 216 |
168 | 217 enum_pins->vt->Reset(enum_pins); |
1545 | 218 result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched); |
30474
31a00b2a621f
Release pin enumerator after we are done using it.
reimar
parents:
30170
diff
changeset
|
219 enum_pins->vt->Release(enum_pins); |
8292 | 220 Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result); |
713 | 221 |
3056 | 222 for (i = 0; i < fetched; i++) |
168 | 223 { |
24405 | 224 PIN_DIRECTION direction = -1; |
25680 | 225 array[i]->vt->QueryDirection(array[i], &direction); |
24405 | 226 if (!This->m_pInputPin && direction == PINDIR_INPUT) |
168 | 227 { |
3056 | 228 This->m_pInputPin = array[i]; |
229 This->m_pInputPin->vt->AddRef((IUnknown*)This->m_pInputPin); | |
168 | 230 } |
24405 | 231 if (!This->m_pOutputPin && direction == PINDIR_OUTPUT) |
168 | 232 { |
3056 | 233 This->m_pOutputPin = array[i]; |
234 This->m_pOutputPin->vt->AddRef((IUnknown*)This->m_pOutputPin); | |
168 | 235 } |
236 array[i]->vt->Release((IUnknown*)(array[i])); | |
237 } | |
3056 | 238 if (!This->m_pInputPin) |
239 { | |
3467 | 240 em = "could not find input pin"; |
3056 | 241 break; |
242 } | |
243 if (!This->m_pOutputPin) | |
244 { | |
3467 | 245 em = "could not find output pin"; |
3056 | 246 break; |
247 } | |
248 result = This->m_pInputPin->vt->QueryInterface((IUnknown*)This->m_pInputPin, | |
249 &IID_IMemInputPin, | |
24405 | 250 (void*)&This->m_pImp); |
713 | 251 if (result) |
3056 | 252 { |
3467 | 253 em = "could not get IMemInputPin interface"; |
3056 | 254 break; |
255 } | |
168 | 256 |
3056 | 257 This->m_pOurType = in_fmt; |
258 This->m_pDestType = out_fmt; | |
259 result = This->m_pInputPin->vt->QueryAccept(This->m_pInputPin, This->m_pOurType); | |
713 | 260 if (result) |
3056 | 261 { |
3467 | 262 em = "source format is not accepted"; |
3056 | 263 break; |
264 } | |
265 This->m_pParentFilter = CBaseFilter2Create(); | |
266 This->m_pSrcFilter = CBaseFilterCreate(This->m_pOurType, This->m_pParentFilter); | |
267 This->m_pOurInput = This->m_pSrcFilter->GetPin(This->m_pSrcFilter); | |
268 This->m_pOurInput->vt->AddRef((IUnknown*)This->m_pOurInput); | |
713 | 269 |
3056 | 270 result = This->m_pInputPin->vt->ReceiveConnection(This->m_pInputPin, |
271 This->m_pOurInput, | |
272 This->m_pOurType); | |
273 if (result) | |
274 { | |
3467 | 275 em = "could not connect to input pin"; |
3056 | 276 break; |
277 } | |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
278 result = This->m_pImp->vt->GetAllocator(This->m_pImp, &This->m_pAll); |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
279 if (result || !This->m_pAll) |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
280 { |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
281 em="error getting IMemAllocator interface"; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
282 break; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
283 } |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
284 |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
285 //Seting allocator property according to our media type |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
286 props.cBuffers=1; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
287 props.cbBuffer=This->m_pOurType->lSampleSize; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
288 props.cbAlign=1; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
289 props.cbPrefix=0; |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
290 This->m_pAll->vt->SetProperties(This->m_pAll, &props, &props1); |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
291 |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
292 //Notify remote pin about choosed allocator |
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
293 This->m_pImp->vt->NotifyAllocator(This->m_pImp, This->m_pAll, 0); |
3056 | 294 |
22398
49f01f8fbd60
Rework of copying samples from directshow codecs.
voroshil
parents:
22304
diff
changeset
|
295 This->m_pOurOutput = COutputPinCreate(This->m_pDestType,DS_Filter_CopySample,pUserData); |
3056 | 296 |
297 result = This->m_pOutputPin->vt->ReceiveConnection(This->m_pOutputPin, | |
298 (IPin*) This->m_pOurOutput, | |
299 This->m_pDestType); | |
713 | 300 if (result) |
1545 | 301 { |
3467 | 302 em = "could not connect to output pin"; |
3056 | 303 break; |
1545 | 304 } |
305 | |
3467 | 306 init++; |
3056 | 307 break; |
168 | 308 } |
22304
254733f57707
Fixed loading of VoxWare and wma9sp binary audio codecs using dshow engine.
voroshil
parents:
18783
diff
changeset
|
309 tempAll->vt->Release(tempAll); |
3056 | 310 |
3467 | 311 if (!init) |
168 | 312 { |
3056 | 313 DS_Filter_Destroy(This); |
25678
ebf1c7d24ca2
Remove result from warning string, it has no useful meaning here.
reimar
parents:
25677
diff
changeset
|
314 printf("Warning: DS_Filter() %s. (DLL=%.200s)\n", em, dllname); |
3056 | 315 This = 0; |
168 | 316 } |
3056 | 317 return This; |
168 | 318 } |