Changeset 6710 for trunk/src/quartz/ifgraph.c
- Timestamp:
- Sep 15, 2001, 11:28:23 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/quartz/ifgraph.c
r6649 r6710 1 /* $Id: ifgraph.c,v 1.3 2001-09-05 13:36:35 bird Exp $ */2 1 /* 3 2 * Implementation of IFilterGraph. … … 20 19 #include "control.h" 21 20 #include "uuids.h" 21 #include "vfwmsgs.h" 22 #include "wine/unicode.h" 22 23 23 24 #include "debugtools.h" … … 26 27 #include "quartz_private.h" 27 28 #include "fgraph.h" 29 #include "enumunk.h" 30 31 32 static HRESULT CFilterGraph_DisconnectAllPins( IBaseFilter* pFilter ) 33 { 34 IEnumPins* pEnum = NULL; 35 IPin* pPin; 36 IPin* pConnTo; 37 ULONG cFetched; 38 HRESULT hr; 39 40 hr = IBaseFilter_EnumPins( pFilter, &pEnum ); 41 if ( FAILED(hr) ) 42 return hr; 43 if ( pEnum == NULL ) 44 return E_FAIL; 45 46 while ( 1 ) 47 { 48 pPin = NULL; 49 cFetched = 0; 50 hr = IEnumPins_Next( pEnum, 1, &pPin, &cFetched ); 51 if ( FAILED(hr) ) 52 break; 53 if ( hr != NOERROR || pPin == NULL || cFetched != 1 ) 54 { 55 hr = NOERROR; 56 break; 57 } 58 59 pConnTo = NULL; 60 hr = IPin_ConnectedTo(pPin,&pConnTo); 61 if ( hr == NOERROR && pConnTo != NULL ) 62 { 63 IPin_Disconnect(pPin); 64 IPin_Disconnect(pConnTo); 65 IPin_Release(pConnTo); 66 } 67 68 IPin_Release( pPin ); 69 } 70 71 IEnumPins_Release( pEnum ); 72 73 return hr; 74 } 75 76 77 /****************************************************************************/ 28 78 29 79 static HRESULT WINAPI 30 80 IFilterGraph2_fnQueryInterface(IFilterGraph2* iface,REFIID riid,void** ppobj) 31 81 { 32 33 34 35 36 82 CFilterGraph_THIS(iface,fgraph); 83 84 TRACE("(%p)->()\n",This); 85 86 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 37 87 } 38 88 … … 40 90 IFilterGraph2_fnAddRef(IFilterGraph2* iface) 41 91 { 42 43 44 45 46 92 CFilterGraph_THIS(iface,fgraph); 93 94 TRACE("(%p)->()\n",This); 95 96 return IUnknown_AddRef(This->unk.punkControl); 47 97 } 48 98 … … 50 100 IFilterGraph2_fnRelease(IFilterGraph2* iface) 51 101 { 52 53 54 55 56 102 CFilterGraph_THIS(iface,fgraph); 103 104 TRACE("(%p)->()\n",This); 105 106 return IUnknown_Release(This->unk.punkControl); 57 107 } 58 108 … … 60 110 IFilterGraph2_fnAddFilter(IFilterGraph2* iface,IBaseFilter* pFilter, LPCWSTR pName) 61 111 { 62 CFilterGraph_THIS(iface,fgraph); 63 64 FIXME( "(%p)->() stub!\n", This ); 65 return E_NOTIMPL; 112 CFilterGraph_THIS(iface,fgraph); 113 FILTER_INFO info; 114 HRESULT hr; 115 HRESULT hrSucceeded = S_OK; 116 QUARTZ_CompListItem* pItem; 117 int i,iLen; 118 119 TRACE( "(%p)->(%p,%s)\n",This,pFilter,debugstr_w(pName) ); 120 121 QUARTZ_CompList_Lock( This->m_pFilterList ); 122 123 if ( pName != NULL ) 124 { 125 pItem = QUARTZ_CompList_SearchData( 126 This->m_pFilterList, 127 pName, sizeof(WCHAR)*(strlenW(pName)+1) ); 128 if ( pItem == NULL ) 129 goto name_ok; 130 131 hrSucceeded = VFW_S_DUPLICATE_NAME; 132 133 iLen = strlenW(pName); 134 if ( iLen > 32 ) 135 iLen = 32; 136 memcpy( info.achName, pName, sizeof(WCHAR)*iLen ); 137 info.achName[iLen] = 0; 138 } 139 else 140 { 141 ZeroMemory( &info, sizeof(info) ); 142 hr = IBaseFilter_QueryFilterInfo( pFilter, &info ); 143 if ( FAILED(hr) ) 144 goto end; 145 146 iLen = strlenW(info.achName); 147 pItem = QUARTZ_CompList_SearchData( 148 This->m_pFilterList, 149 info.achName, sizeof(WCHAR)*(iLen+1) ); 150 if ( pItem == NULL ) 151 { 152 pName = info.achName; 153 goto name_ok; 154 } 155 } 156 157 /* generate modified names for this filter.. */ 158 iLen = strlenW(info.achName); 159 if ( iLen > 32 ) 160 iLen = 32; 161 info.achName[iLen++] = ' '; 162 163 for ( i = 0; i <= 99; i++ ) 164 { 165 info.achName[iLen+0] = (i%10) + '0'; 166 info.achName[iLen+1] = ((i/10)%10) + '0'; 167 info.achName[iLen+2] = 0; 168 pItem = QUARTZ_CompList_SearchData( 169 This->m_pFilterList, 170 info.achName, sizeof(WCHAR)*(iLen+3) ); 171 if ( pItem == NULL ) 172 { 173 pName = info.achName; 174 goto name_ok; 175 } 176 } 177 178 hr = ( pName == NULL ) ? E_FAIL : VFW_E_DUPLICATE_NAME; 179 goto end; 180 181 name_ok: 182 /* register this filter. */ 183 hr = QUARTZ_CompList_AddComp( 184 This->m_pFilterList, (IUnknown*)pFilter, 185 pName, sizeof(WCHAR)*(strlenW(pName)+1) ); 186 if ( FAILED(hr) ) 187 goto end; 188 189 hr = IBaseFilter_JoinFilterGraph(pFilter,(IFilterGraph*)iface,pName); 190 if ( FAILED(hr) ) 191 { 192 QUARTZ_CompList_RemoveComp( 193 This->m_pFilterList,(IUnknown*)pFilter); 194 goto end; 195 } 196 197 EnterCriticalSection( &This->m_csGraphVersion ); 198 This->m_lGraphVersion ++; 199 LeaveCriticalSection( &This->m_csGraphVersion ); 200 201 hr = hrSucceeded; 202 end: 203 QUARTZ_CompList_Unlock( This->m_pFilterList ); 204 205 return hr; 66 206 } 67 207 … … 69 209 IFilterGraph2_fnRemoveFilter(IFilterGraph2* iface,IBaseFilter* pFilter) 70 210 { 71 CFilterGraph_THIS(iface,fgraph); 72 73 FIXME( "(%p)->() stub!\n", This ); 74 return E_NOTIMPL; 211 CFilterGraph_THIS(iface,fgraph); 212 QUARTZ_CompListItem* pItem; 213 HRESULT hr = NOERROR; 214 215 TRACE( "(%p)->(%p)\n",This,pFilter ); 216 217 QUARTZ_CompList_Lock( This->m_pFilterList ); 218 219 pItem = QUARTZ_CompList_SearchComp( 220 This->m_pFilterList, (IUnknown*)pFilter ); 221 if ( pItem != NULL ) 222 { 223 CFilterGraph_DisconnectAllPins(pFilter); 224 hr = IBaseFilter_JoinFilterGraph( 225 pFilter, NULL, QUARTZ_CompList_GetDataPtr(pItem) ); 226 QUARTZ_CompList_RemoveComp( 227 This->m_pFilterList, (IUnknown*)pFilter ); 228 } 229 230 EnterCriticalSection( &This->m_csGraphVersion ); 231 This->m_lGraphVersion ++; 232 LeaveCriticalSection( &This->m_csGraphVersion ); 233 234 QUARTZ_CompList_Unlock( This->m_pFilterList ); 235 236 return hr; 75 237 } 76 238 … … 78 240 IFilterGraph2_fnEnumFilters(IFilterGraph2* iface,IEnumFilters** ppEnum) 79 241 { 80 CFilterGraph_THIS(iface,fgraph); 81 82 FIXME( "(%p)->() stub!\n", This ); 83 return E_NOTIMPL; 242 CFilterGraph_THIS(iface,fgraph); 243 HRESULT hr; 244 245 TRACE( "(%p)->(%p)\n",This,ppEnum ); 246 247 QUARTZ_CompList_Lock( This->m_pFilterList ); 248 249 hr = QUARTZ_CreateEnumUnknown( 250 &IID_IEnumFilters, (void**)ppEnum, This->m_pFilterList ); 251 252 QUARTZ_CompList_Unlock( This->m_pFilterList ); 253 254 return hr; 84 255 } 85 256 … … 87 258 IFilterGraph2_fnFindFilterByName(IFilterGraph2* iface,LPCWSTR pName,IBaseFilter** ppFilter) 88 259 { 89 CFilterGraph_THIS(iface,fgraph); 90 91 FIXME( "(%p)->() stub!\n", This ); 92 return E_NOTIMPL; 260 CFilterGraph_THIS(iface,fgraph); 261 QUARTZ_CompListItem* pItem; 262 HRESULT hr = E_FAIL; 263 264 TRACE( "(%p)->(%s,%p)\n",This,debugstr_w(pName),ppFilter ); 265 266 if ( ppFilter == NULL ) 267 return E_POINTER; 268 *ppFilter = NULL; 269 270 QUARTZ_CompList_Lock( This->m_pFilterList ); 271 272 pItem = QUARTZ_CompList_SearchData( 273 This->m_pFilterList, 274 pName, sizeof(WCHAR)*(strlenW(pName)+1) ); 275 if ( pItem != NULL ) 276 { 277 *ppFilter = (IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem); 278 hr = NOERROR; 279 } 280 281 QUARTZ_CompList_Unlock( This->m_pFilterList ); 282 283 return hr; 93 284 } 94 285 … … 96 287 IFilterGraph2_fnConnectDirect(IFilterGraph2* iface,IPin* pOut,IPin* pIn,const AM_MEDIA_TYPE* pmt) 97 288 { 98 CFilterGraph_THIS(iface,fgraph); 99 100 FIXME( "(%p)->() stub!\n", This ); 101 return E_NOTIMPL; 289 CFilterGraph_THIS(iface,fgraph); 290 IPin* pConnTo; 291 PIN_INFO infoIn; 292 PIN_INFO infoOut; 293 FILTER_INFO finfoIn; 294 FILTER_INFO finfoOut; 295 HRESULT hr; 296 297 TRACE( "(%p)->(%p,%p,%p)\n",This,pOut,pIn,pmt ); 298 299 infoIn.pFilter = NULL; 300 infoOut.pFilter = NULL; 301 finfoIn.pGraph = NULL; 302 finfoOut.pGraph = NULL; 303 304 QUARTZ_CompList_Lock( This->m_pFilterList ); 305 306 hr = IPin_QueryPinInfo(pIn,&infoIn); 307 if ( FAILED(hr) ) 308 goto end; 309 hr = IPin_QueryPinInfo(pOut,&infoOut); 310 if ( FAILED(hr) ) 311 goto end; 312 if ( infoIn.pFilter == NULL || infoOut.pFilter == NULL || 313 infoIn.dir != PINDIR_INPUT || infoOut.dir != PINDIR_OUTPUT ) 314 { 315 hr = E_FAIL; 316 goto end; 317 } 318 319 hr = IBaseFilter_QueryFilterInfo(infoIn.pFilter,&finfoIn); 320 if ( FAILED(hr) ) 321 goto end; 322 hr = IBaseFilter_QueryFilterInfo(infoOut.pFilter,&finfoOut); 323 if ( FAILED(hr) ) 324 goto end; 325 if ( finfoIn.pGraph != ((IFilterGraph*)iface) || 326 finfoOut.pGraph != ((IFilterGraph*)iface) ) 327 { 328 hr = E_FAIL; 329 goto end; 330 } 331 332 pConnTo = NULL; 333 hr = IPin_ConnectedTo(pIn,&pConnTo); 334 if ( FAILED(hr) ) 335 goto end; 336 if ( pConnTo != NULL ) 337 { 338 IPin_Release(pConnTo); 339 goto end; 340 } 341 342 pConnTo = NULL; 343 hr = IPin_ConnectedTo(pOut,&pConnTo); 344 if ( FAILED(hr) ) 345 goto end; 346 if ( pConnTo != NULL ) 347 { 348 IPin_Release(pConnTo); 349 goto end; 350 } 351 352 hr = IPin_Connect(pIn,pOut,pmt); 353 if ( FAILED(hr) ) 354 goto end; 355 hr = IPin_Connect(pOut,pIn,pmt); 356 if ( FAILED(hr) ) 357 { 358 IPin_Disconnect(pIn); 359 goto end; 360 } 361 362 EnterCriticalSection( &This->m_csGraphVersion ); 363 This->m_lGraphVersion ++; 364 LeaveCriticalSection( &This->m_csGraphVersion ); 365 366 end: 367 QUARTZ_CompList_Unlock( This->m_pFilterList ); 368 369 if ( infoIn.pFilter != NULL ) 370 IBaseFilter_Release(infoIn.pFilter); 371 if ( infoOut.pFilter != NULL ) 372 IBaseFilter_Release(infoOut.pFilter); 373 if ( finfoIn.pGraph != NULL ) 374 IFilterGraph_Release(finfoIn.pGraph); 375 if ( finfoOut.pGraph != NULL ) 376 IFilterGraph_Release(finfoOut.pGraph); 377 378 return hr; 102 379 } 103 380 … … 105 382 IFilterGraph2_fnReconnect(IFilterGraph2* iface,IPin* pPin) 106 383 { 107 CFilterGraph_THIS(iface,fgraph); 108 109 FIXME( "(%p)->() stub!\n", This ); 110 return E_NOTIMPL; 384 CFilterGraph_THIS(iface,fgraph); 385 386 FIXME( "(%p)->(%p) stub!\n",This,pPin ); 387 388 EnterCriticalSection( &This->m_csGraphVersion ); 389 This->m_lGraphVersion ++; 390 LeaveCriticalSection( &This->m_csGraphVersion ); 391 392 return E_NOTIMPL; 111 393 } 112 394 … … 114 396 IFilterGraph2_fnDisconnect(IFilterGraph2* iface,IPin* pPin) 115 397 { 116 CFilterGraph_THIS(iface,fgraph); 117 118 FIXME( "(%p)->() stub!\n", This ); 119 return E_NOTIMPL; 398 CFilterGraph_THIS(iface,fgraph); 399 400 FIXME( "(%p)->(%p) stub!\n",This,pPin ); 401 402 EnterCriticalSection( &This->m_csGraphVersion ); 403 This->m_lGraphVersion ++; 404 LeaveCriticalSection( &This->m_csGraphVersion ); 405 406 return E_NOTIMPL; 120 407 } 121 408 … … 123 410 IFilterGraph2_fnSetDefaultSyncSource(IFilterGraph2* iface) 124 411 { 125 126 127 128 412 CFilterGraph_THIS(iface,fgraph); 413 414 FIXME( "(%p)->() stub!\n", This ); 415 return E_NOTIMPL; 129 416 } 130 417 … … 132 419 IFilterGraph2_fnConnect(IFilterGraph2* iface,IPin* pOut,IPin* pIn) 133 420 { 134 CFilterGraph_THIS(iface,fgraph); 135 136 FIXME( "(%p)->() stub!\n", This ); 137 return E_NOTIMPL; 421 CFilterGraph_THIS(iface,fgraph); 422 HRESULT hr; 423 424 TRACE( "(%p)->(%p,%p)\n",This,pOut,pIn ); 425 426 /* At first, try to connect directly. */ 427 hr = IFilterGraph_ConnectDirect(iface,pOut,pIn,NULL); 428 if ( hr == NOERROR ) 429 return NOERROR; 430 431 /* FIXME - try to connect indirectly. */ 432 FIXME( "(%p)->(%p,%p) stub!\n",This,pOut,pIn ); 433 434 435 return E_NOTIMPL; 138 436 } 139 437 … … 141 439 IFilterGraph2_fnRender(IFilterGraph2* iface,IPin* pOut) 142 440 { 143 144 145 FIXME( "(%p)->() stub!\n", This);146 441 CFilterGraph_THIS(iface,fgraph); 442 443 FIXME( "(%p)->(%p) stub!\n",This,pOut ); 444 return E_NOTIMPL; 147 445 } 148 446 … … 150 448 IFilterGraph2_fnRenderFile(IFilterGraph2* iface,LPCWSTR lpFileName,LPCWSTR lpPlayList) 151 449 { 152 CFilterGraph_THIS(iface,fgraph); 153 154 FIXME( "(%p)->() stub!\n", This ); 155 return E_NOTIMPL; 450 CFilterGraph_THIS(iface,fgraph); 451 HRESULT hr; 452 IBaseFilter* pFilter = NULL; 453 IEnumPins* pEnum = NULL; 454 IPin* pPin; 455 ULONG cFetched; 456 PIN_DIRECTION dir; 457 ULONG cTryToRender; 458 ULONG cActRender; 459 460 TRACE( "(%p)->(%s,%s)\n",This, 461 debugstr_w(lpFileName),debugstr_w(lpPlayList) ); 462 463 if ( lpPlayList != NULL ) 464 return E_INVALIDARG; 465 466 pFilter = NULL; 467 hr = IFilterGraph2_AddSourceFilter(iface,lpFileName,NULL,&pFilter); 468 if ( FAILED(hr) ) 469 goto end; 470 if ( pFilter == NULL ) 471 { 472 hr = E_FAIL; 473 goto end; 474 } 475 pEnum = NULL; 476 hr = IBaseFilter_EnumPins( pFilter, &pEnum ); 477 if ( FAILED(hr) ) 478 goto end; 479 if ( pEnum == NULL ) 480 { 481 hr = E_FAIL; 482 goto end; 483 } 484 485 cTryToRender = 0; 486 cActRender = 0; 487 488 while ( 1 ) 489 { 490 pPin = NULL; 491 cFetched = 0; 492 hr = IEnumPins_Next( pEnum, 1, &pPin, &cFetched ); 493 if ( FAILED(hr) ) 494 goto end; 495 if ( hr != NOERROR || pPin == NULL || cFetched != 1 ) 496 { 497 hr = NOERROR; 498 break; 499 } 500 hr = IPin_QueryDirection( pPin, &dir ); 501 if ( hr == NOERROR && dir == PINDIR_OUTPUT ) 502 { 503 cTryToRender ++; 504 hr = IFilterGraph2_Render( iface, pPin ); 505 if ( hr == NOERROR ) 506 cActRender ++; 507 } 508 IPin_Release( pPin ); 509 } 510 511 if ( hr == NOERROR ) 512 { 513 if ( cTryToRender > cActRender ) 514 hr = VFW_S_PARTIAL_RENDER; 515 if ( cActRender == 0 ) 516 hr = E_FAIL; 517 } 518 519 end: 520 if ( pEnum != NULL ) 521 IEnumPins_Release( pEnum ); 522 if ( pFilter != NULL ) 523 IBaseFilter_Release( pFilter ); 524 525 return hr; 156 526 } 157 527 … … 159 529 IFilterGraph2_fnAddSourceFilter(IFilterGraph2* iface,LPCWSTR lpFileName,LPCWSTR lpFilterName,IBaseFilter** ppBaseFilter) 160 530 { 161 CFilterGraph_THIS(iface,fgraph); 162 163 FIXME( "(%p)->() stub!\n", This ); 164 return E_NOTIMPL; 531 CFilterGraph_THIS(iface,fgraph); 532 533 FIXME( "(%p)->(%s,%s,%p) stub!\n",This, 534 debugstr_w(lpFileName),debugstr_w(lpFilterName),ppBaseFilter ); 535 return E_NOTIMPL; 165 536 } 166 537 … … 168 539 IFilterGraph2_fnSetLogFile(IFilterGraph2* iface,DWORD_PTR hFile) 169 540 { 170 171 172 173 541 CFilterGraph_THIS(iface,fgraph); 542 543 FIXME( "(%p)->() stub!\n", This ); 544 return E_NOTIMPL; 174 545 } 175 546 … … 177 548 IFilterGraph2_fnAbort(IFilterGraph2* iface) 178 549 { 179 180 181 182 183 184 550 CFilterGraph_THIS(iface,fgraph); 551 552 /* undoc. */ 553 554 FIXME( "(%p)->() stub!\n", This ); 555 return E_NOTIMPL; 185 556 } 186 557 … … 188 559 IFilterGraph2_fnShouldOperationContinue(IFilterGraph2* iface) 189 560 { 190 191 192 193 194 195 561 CFilterGraph_THIS(iface,fgraph); 562 563 /* undoc. */ 564 565 FIXME( "(%p)->() stub!\n", This ); 566 return E_NOTIMPL; 196 567 } 197 568 … … 199 570 IFilterGraph2_fnAddSourceFilterForMoniker(IFilterGraph2* iface,IMoniker* pMon,IBindCtx* pCtx,LPCWSTR pFilterName,IBaseFilter** ppFilter) 200 571 { 201 202 203 204 572 CFilterGraph_THIS(iface,fgraph); 573 574 FIXME( "(%p)->() stub!\n", This ); 575 return E_NOTIMPL; 205 576 } 206 577 … … 208 579 IFilterGraph2_fnReconnectEx(IFilterGraph2* iface,IPin* pPin,const AM_MEDIA_TYPE* pmt) 209 580 { 210 CFilterGraph_THIS(iface,fgraph); 211 212 FIXME( "(%p)->() stub!\n", This ); 213 return E_NOTIMPL; 581 CFilterGraph_THIS(iface,fgraph); 582 583 FIXME( "(%p)->(%p,%p) stub!\n",This,pPin,pmt ); 584 585 EnterCriticalSection( &This->m_csGraphVersion ); 586 This->m_lGraphVersion ++; 587 LeaveCriticalSection( &This->m_csGraphVersion ); 588 589 return E_NOTIMPL; 214 590 } 215 591 … … 217 593 IFilterGraph2_fnRenderEx(IFilterGraph2* iface,IPin* pPin,DWORD dwParam1,DWORD* pdwParam2) 218 594 { 219 220 221 222 FIXME( "(%p)->() stub!\n", This);223 595 CFilterGraph_THIS(iface,fgraph); 596 597 /* undoc. */ 598 FIXME( "(%p)->(%p,%08lx,%p) stub!\n",This,pPin,dwParam1,pdwParam2); 599 return E_NOTIMPL; 224 600 } 225 601 … … 229 605 static ICOM_VTABLE(IFilterGraph2) ifgraph = 230 606 { 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 607 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 608 /* IUnknown fields */ 609 IFilterGraph2_fnQueryInterface, 610 IFilterGraph2_fnAddRef, 611 IFilterGraph2_fnRelease, 612 /* IFilterGraph fields */ 613 IFilterGraph2_fnAddFilter, 614 IFilterGraph2_fnRemoveFilter, 615 IFilterGraph2_fnEnumFilters, 616 IFilterGraph2_fnFindFilterByName, 617 IFilterGraph2_fnConnectDirect, 618 IFilterGraph2_fnReconnect, 619 IFilterGraph2_fnDisconnect, 620 IFilterGraph2_fnSetDefaultSyncSource, 621 /* IGraphBuilder fields */ 622 IFilterGraph2_fnConnect, 623 IFilterGraph2_fnRender, 624 IFilterGraph2_fnRenderFile, 625 IFilterGraph2_fnAddSourceFilter, 626 IFilterGraph2_fnSetLogFile, 627 IFilterGraph2_fnAbort, 628 IFilterGraph2_fnShouldOperationContinue, 629 /* IFilterGraph2 fields */ 630 IFilterGraph2_fnAddSourceFilterForMoniker, 631 IFilterGraph2_fnReconnectEx, 632 IFilterGraph2_fnRenderEx, 257 633 }; 258 634 259 void CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg ) 260 { 261 TRACE("(%p)\n",pfg); 262 ICOM_VTBL(&pfg->fgraph) = &ifgraph; 263 } 635 HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg ) 636 { 637 TRACE("(%p)\n",pfg); 638 ICOM_VTBL(&pfg->fgraph) = &ifgraph; 639 640 pfg->m_pFilterList = QUARTZ_CompList_Alloc(); 641 if ( pfg->m_pFilterList == NULL ) 642 return E_OUTOFMEMORY; 643 644 return NOERROR; 645 } 646 647 void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg ) 648 { 649 QUARTZ_CompListItem* pItem; 650 651 TRACE("(%p)\n",pfg); 652 653 /* remove all filters... */ 654 while ( 1 ) 655 { 656 pItem = QUARTZ_CompList_GetFirst( pfg->m_pFilterList ); 657 if ( pItem == NULL ) 658 break; 659 IFilterGraph2_fnRemoveFilter( 660 (IFilterGraph2*)(&pfg->fgraph), 661 (IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem) ); 662 } 663 664 QUARTZ_CompList_Free( pfg->m_pFilterList ); 665 }
Note:
See TracChangeset
for help on using the changeset viewer.