Changeset 6952 for trunk/src/quartz/main.c
- Timestamp:
- Oct 6, 2001, 10:56:18 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/quartz/main.c
r6710 r6952 1 /* 2 * Exported APIs. 3 * 4 * hidenori@a2.ctktv.ne.jp 5 */ 6 1 7 #include "config.h" 2 8 … … 5 11 #include "winbase.h" 6 12 #include "wingdi.h" 13 #include "winuser.h" 14 #include "winnls.h" 15 #include "mmsystem.h" 7 16 #include "ole2.h" 8 17 #include "wine/obj_oleaut.h" … … 10 19 #include "control.h" 11 20 #include "uuids.h" 21 #include "errors.h" 12 22 13 23 #include "debugtools.h" … … 22 32 #include "fmap2.h" 23 33 #include "seekpass.h" 34 #include "audren.h" 24 35 25 36 … … 66 77 { &CLSID_FilterMapper2, &QUARTZ_CreateFilterMapper2 }, 67 78 { &CLSID_SeekingPassThru, &QUARTZ_CreateSeekingPassThru }, 79 { &CLSID_AudioRender, &QUARTZ_CreateAudioRenderer }, 68 80 { NULL, NULL }, 69 81 }; … … 105 117 HeapFree( hDLLHeap, 0, pMem ); 106 118 } 119 120 void* QUARTZ_ReallocMem( void* pMem, DWORD dwSize ) 121 { 122 if ( pMem == NULL ) 123 return QUARTZ_AllocMem( dwSize ); 124 125 return HeapReAlloc( hDLLHeap, 0, pMem, dwSize ); 126 } 127 128 static 129 LPWSTR QUARTZ_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen ) 130 { 131 INT len; 132 133 len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen ); 134 if ( len == 0 ) 135 *lpwstr = 0; 136 return lpwstr; 137 } 138 107 139 108 140 /************************************************************************/ … … 264 296 LPVOID lpvReserved ) 265 297 { 298 TRACE("(%08x,%08lx,%p)\n",hInstDLL,fdwReason,lpvReserved); 299 266 300 switch ( fdwReason ) 267 301 { … … 337 371 } 338 372 339 340 373 /**************************************************************************/ 374 /**************************************************************************/ 375 376 /* FIXME - all string should be defined in the resource of quartz. */ 377 378 static LPCSTR hresult_to_string( HRESULT hr ) 379 { 380 switch ( hr ) 381 { 382 #define ENTRY(x) case x: return (const char*)#x 383 /* some known codes */ 384 ENTRY(S_OK); 385 ENTRY(S_FALSE); 386 ENTRY(E_FAIL); 387 ENTRY(E_POINTER); 388 ENTRY(E_NOTIMPL); 389 ENTRY(E_NOINTERFACE); 390 ENTRY(E_OUTOFMEMORY); 391 ENTRY(CLASS_E_CLASSNOTAVAILABLE); 392 ENTRY(CLASS_E_NOAGGREGATION); 393 394 /* vfwmsgs.h */ 395 ENTRY(VFW_S_NO_MORE_ITEMS); 396 ENTRY(VFW_E_BAD_KEY); 397 ENTRY(VFW_E_INVALIDMEDIATYPE); 398 ENTRY(VFW_E_INVALIDSUBTYPE); 399 ENTRY(VFW_E_NEED_OWNER); 400 ENTRY(VFW_E_ENUM_OUT_OF_SYNC); 401 ENTRY(VFW_E_ALREADY_CONNECTED); 402 ENTRY(VFW_E_FILTER_ACTIVE); 403 ENTRY(VFW_E_NO_TYPES); 404 ENTRY(VFW_E_NO_ACCEPTABLE_TYPES); 405 ENTRY(VFW_E_INVALID_DIRECTION); 406 ENTRY(VFW_E_NOT_CONNECTED); 407 ENTRY(VFW_E_NO_ALLOCATOR); 408 ENTRY(VFW_E_RUNTIME_ERROR); 409 ENTRY(VFW_E_BUFFER_NOTSET); 410 ENTRY(VFW_E_BUFFER_OVERFLOW); 411 ENTRY(VFW_E_BADALIGN); 412 ENTRY(VFW_E_ALREADY_COMMITTED); 413 ENTRY(VFW_E_BUFFERS_OUTSTANDING); 414 ENTRY(VFW_E_NOT_COMMITTED); 415 ENTRY(VFW_E_SIZENOTSET); 416 ENTRY(VFW_E_NO_CLOCK); 417 ENTRY(VFW_E_NO_SINK); 418 ENTRY(VFW_E_NO_INTERFACE); 419 ENTRY(VFW_E_NOT_FOUND); 420 ENTRY(VFW_E_CANNOT_CONNECT); 421 ENTRY(VFW_E_CANNOT_RENDER); 422 ENTRY(VFW_E_CHANGING_FORMAT); 423 ENTRY(VFW_E_NO_COLOR_KEY_SET); 424 ENTRY(VFW_E_NOT_OVERLAY_CONNECTION); 425 ENTRY(VFW_E_NOT_SAMPLE_CONNECTION); 426 ENTRY(VFW_E_PALETTE_SET); 427 ENTRY(VFW_E_COLOR_KEY_SET); 428 ENTRY(VFW_E_NO_COLOR_KEY_FOUND); 429 ENTRY(VFW_E_NO_PALETTE_AVAILABLE); 430 ENTRY(VFW_E_NO_DISPLAY_PALETTE); 431 ENTRY(VFW_E_TOO_MANY_COLORS); 432 ENTRY(VFW_E_STATE_CHANGED); 433 ENTRY(VFW_E_NOT_STOPPED); 434 ENTRY(VFW_E_NOT_PAUSED); 435 ENTRY(VFW_E_NOT_RUNNING); 436 ENTRY(VFW_E_WRONG_STATE); 437 ENTRY(VFW_E_START_TIME_AFTER_END); 438 ENTRY(VFW_E_INVALID_RECT); 439 ENTRY(VFW_E_TYPE_NOT_ACCEPTED); 440 ENTRY(VFW_E_SAMPLE_REJECTED); 441 ENTRY(VFW_E_SAMPLE_REJECTED_EOS); 442 ENTRY(VFW_S_DUPLICATE_NAME); 443 ENTRY(VFW_E_DUPLICATE_NAME); 444 ENTRY(VFW_E_TIMEOUT); 445 ENTRY(VFW_E_INVALID_FILE_FORMAT); 446 ENTRY(VFW_E_ENUM_OUT_OF_RANGE); 447 ENTRY(VFW_E_CIRCULAR_GRAPH); 448 ENTRY(VFW_E_NOT_ALLOWED_TO_SAVE); 449 ENTRY(VFW_E_TIME_ALREADY_PASSED); 450 ENTRY(VFW_E_ALREADY_CANCELLED); 451 ENTRY(VFW_E_CORRUPT_GRAPH_FILE); 452 ENTRY(VFW_E_ADVISE_ALREADY_SET); 453 ENTRY(VFW_S_STATE_INTERMEDIATE); 454 ENTRY(VFW_E_NO_MODEX_AVAILABLE); 455 ENTRY(VFW_E_NO_ADVISE_SET); 456 ENTRY(VFW_E_NO_FULLSCREEN); 457 ENTRY(VFW_E_IN_FULLSCREEN_MODE); 458 ENTRY(VFW_E_UNKNOWN_FILE_TYPE); 459 ENTRY(VFW_E_CANNOT_LOAD_SOURCE_FILTER); 460 ENTRY(VFW_S_PARTIAL_RENDER); 461 ENTRY(VFW_E_FILE_TOO_SHORT); 462 ENTRY(VFW_E_INVALID_FILE_VERSION); 463 ENTRY(VFW_S_SOME_DATA_IGNORED); 464 ENTRY(VFW_S_CONNECTIONS_DEFERRED); 465 ENTRY(VFW_E_INVALID_CLSID); 466 ENTRY(VFW_E_INVALID_MEDIA_TYPE); 467 ENTRY(VFW_E_SAMPLE_TIME_NOT_SET); 468 ENTRY(VFW_S_RESOURCE_NOT_NEEDED); 469 ENTRY(VFW_E_MEDIA_TIME_NOT_SET); 470 ENTRY(VFW_E_NO_TIME_FORMAT_SET); 471 ENTRY(VFW_E_MONO_AUDIO_HW); 472 ENTRY(VFW_S_MEDIA_TYPE_IGNORED); 473 ENTRY(VFW_E_NO_DECOMPRESSOR); 474 ENTRY(VFW_E_NO_AUDIO_HARDWARE); 475 ENTRY(VFW_S_VIDEO_NOT_RENDERED); 476 ENTRY(VFW_S_AUDIO_NOT_RENDERED); 477 ENTRY(VFW_E_RPZA); 478 ENTRY(VFW_S_RPZA); 479 ENTRY(VFW_E_PROCESSOR_NOT_SUITABLE); 480 ENTRY(VFW_E_UNSUPPORTED_AUDIO); 481 ENTRY(VFW_E_UNSUPPORTED_VIDEO); 482 ENTRY(VFW_E_MPEG_NOT_CONSTRAINED); 483 ENTRY(VFW_E_NOT_IN_GRAPH); 484 ENTRY(VFW_S_ESTIMATED); 485 ENTRY(VFW_E_NO_TIME_FORMAT); 486 ENTRY(VFW_E_READ_ONLY); 487 ENTRY(VFW_S_RESERVED); 488 ENTRY(VFW_E_BUFFER_UNDERFLOW); 489 ENTRY(VFW_E_UNSUPPORTED_STREAM); 490 ENTRY(VFW_E_NO_TRANSPORT); 491 ENTRY(VFW_S_STREAM_OFF); 492 ENTRY(VFW_S_CANT_CUE); 493 ENTRY(VFW_E_BAD_VIDEOCD); 494 ENTRY(VFW_S_NO_STOP_TIME); 495 ENTRY(VFW_E_OUT_OF_VIDEO_MEMORY); 496 ENTRY(VFW_E_VP_NEGOTIATION_FAILED); 497 ENTRY(VFW_E_DDRAW_CAPS_NOT_SUITABLE); 498 ENTRY(VFW_E_NO_VP_HARDWARE); 499 ENTRY(VFW_E_NO_CAPTURE_HARDWARE); 500 ENTRY(VFW_E_DVD_OPERATION_INHIBITED); 501 ENTRY(VFW_E_DVD_INVALIDDOMAIN); 502 ENTRY(VFW_E_DVD_NO_BUTTON); 503 ENTRY(VFW_E_DVD_GRAPHNOTREADY); 504 ENTRY(VFW_E_DVD_RENDERFAIL); 505 ENTRY(VFW_E_DVD_DECNOTENOUGH); 506 ENTRY(VFW_E_DDRAW_VERSION_NOT_SUITABLE); 507 ENTRY(VFW_E_COPYPROT_FAILED); 508 ENTRY(VFW_S_NOPREVIEWPIN); 509 ENTRY(VFW_E_TIME_EXPIRED); 510 ENTRY(VFW_S_DVD_NON_ONE_SEQUENTIAL); 511 ENTRY(VFW_E_DVD_WRONG_SPEED); 512 ENTRY(VFW_E_DVD_MENU_DOES_NOT_EXIST); 513 ENTRY(VFW_E_DVD_CMD_CANCELLED); 514 ENTRY(VFW_E_DVD_STATE_WRONG_VERSION); 515 ENTRY(VFW_E_DVD_STATE_CORRUPT); 516 ENTRY(VFW_E_DVD_STATE_WRONG_DISC); 517 ENTRY(VFW_E_DVD_INCOMPATIBLE_REGION); 518 ENTRY(VFW_E_DVD_NO_ATTRIBUTES); 519 ENTRY(VFW_E_DVD_NO_GOUP_PGC); 520 ENTRY(VFW_E_DVD_LOW_PARENTAL_LEVEL); 521 ENTRY(VFW_E_DVD_NOT_IN_KARAOKE_MODE); 522 ENTRY(VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE); 523 ENTRY(VFW_S_DVD_NOT_ACCURATE); 524 ENTRY(VFW_E_FRAME_STEP_UNSUPPORTED); 525 ENTRY(VFW_E_DVD_STREAM_DISABLED); 526 ENTRY(VFW_E_DVD_TITLE_UNKNOWN); 527 ENTRY(VFW_E_DVD_INVALID_DISC); 528 ENTRY(VFW_E_DVD_NO_RESUME_INFORMATION); 529 ENTRY(VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD); 530 ENTRY(VFW_E_PIN_ALREADY_BLOCKED); 531 ENTRY(VFW_E_CERTIFICATION_FAILURE); 532 #undef ENTRY 533 } 534 535 return NULL; 536 } 537 538 /*********************************************************************** 539 * AMGetErrorTextA (quartz.@) 540 */ 541 DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR pszbuf, DWORD dwBufLen) 542 { 543 LPCSTR lpszRes; 544 DWORD len; 545 546 lpszRes = hresult_to_string( hr ); 547 if ( lpszRes == NULL ) 548 return 0; 549 len = (DWORD)(strlen(lpszRes)+1); 550 if ( len > dwBufLen ) 551 return 0; 552 553 memcpy( pszbuf, lpszRes, len ); 554 return len; 555 } 556 557 /*********************************************************************** 558 * AMGetErrorTextW (quartz.@) 559 */ 560 DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR pwszbuf, DWORD dwBufLen) 561 { 562 CHAR szBuf[MAX_ERROR_TEXT_LEN+1]; 563 DWORD dwLen; 564 565 dwLen = AMGetErrorTextA(hr,szBuf,MAX_ERROR_TEXT_LEN); 566 if ( dwLen == 0 ) 567 return 0; 568 szBuf[dwLen] = 0; 569 570 QUARTZ_strncpyAtoW( pwszbuf, szBuf, dwBufLen ); 571 572 return lstrlenW( pwszbuf ); 573 }
Note:
See TracChangeset
for help on using the changeset viewer.