Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
4.8 KiB

  1. /****************************************************************************
  2. Task State : MCIAVI has a separate background task for every open
  3. instance of mciavi. The task handle and task state are stored in
  4. the per-instance data structure. The task can be in one of four
  5. states.
  6. TASKABORT : Set by the AVI task when it fails to open the requested
  7. file during initialisation.
  8. TASKINIT : This is the initial task state set when the
  9. instance data structure is initialized in mwOpenDevice()
  10. before the actual task is created by mmTaskCreate().
  11. After the task is created, mwOpenDevice() waits until
  12. the task state changes to TASKIDLE before returning
  13. success so that the background task is definitely initialized
  14. after an open call.
  15. TASKIDLE : The task sets the state to TASKIDLE and blocks whenever
  16. there is nothing to do. When the task wakes, the state is either
  17. TASKCLOSE if the instance is being closed or else TASKBUSY
  18. if the task is to begin recording or playback of the file.
  19. TASKCLOSE : mwCloseDevice() stops playback or recording which forces
  20. the task state to TASKIDLE and then sets the state to TASKCLOSE and
  21. wakes the task so that the task will destroy itself.
  22. TASKSTARTING: The task is in this state when it is initializing for
  23. playback, but hasn't started yet. This is used so that the calling
  24. task can wait for play to start before returning "no error" as the
  25. result of an MCI play command.
  26. TASKCUEING: The task is in this state when it is reading extra
  27. records and buffering up audio before actually starting to play.
  28. TASKPAUSED: The task is in this state while it is paused.
  29. TASKPLAYING: The task is in this state during playback
  30. ****************************************************************************/
  31. #define TASKABORT 0
  32. #define TASKBEINGCREATED 1
  33. #define TASKINIT 2
  34. #define TASKIDLE 3
  35. #define TASKSTARTING 4
  36. #define TASKCUEING 5
  37. #define TASKPLAYING 6
  38. #define TASKPAUSED 7
  39. #define TASKCLOSE 8
  40. #define TASKCLOSED 9
  41. // 9
  42. // 10
  43. #define TASKREADINDEX 11
  44. #define TASKRELOAD 12
  45. /* A function back in device.c */
  46. DWORD mciaviTaskMessage(NPMCIGRAPHIC npMCI, int msg);
  47. void NEAR PASCAL ShowStage(NPMCIGRAPHIC npMCI);
  48. //
  49. // call this to RTL to AVIFile.
  50. //
  51. BOOL FAR InitAVIFile(NPMCIGRAPHIC npMCI);
  52. BOOL FAR FreeAVIFile(NPMCIGRAPHIC npMCI);
  53. /* Functions in avitask.c */
  54. void FAR PASCAL _LOADDS mciaviTask(DWORD dwInst);
  55. void FAR PASCAL mciaviTaskCleanup(NPMCIGRAPHIC npMCI);
  56. void NEAR PASCAL mciaviMessage(NPMCIGRAPHIC npMCI, UINT msg);
  57. /* Functions in aviplay.c */
  58. UINT NEAR PASCAL mciaviPlayFile(NPMCIGRAPHIC npMCI);
  59. /* Functions in avidraw.c */
  60. /* !!! Should this be externally visible? */
  61. BOOL NEAR PASCAL DoStreamUpdate(NPMCIGRAPHIC npMCI, BOOL fPaint);
  62. void NEAR PASCAL StreamInvalidate(NPMCIGRAPHIC npMCI, LPRECT prc);
  63. UINT NEAR PASCAL PrepareDC(NPMCIGRAPHIC npMCI);
  64. void NEAR PASCAL UnprepareDC(NPMCIGRAPHIC npMCI);
  65. BOOL FAR PASCAL DrawBegin(NPMCIGRAPHIC npMCI, BOOL FAR *fRestart);
  66. void NEAR PASCAL DrawEnd(NPMCIGRAPHIC npMCI);
  67. BOOL NEAR PASCAL DisplayVideoFrame(NPMCIGRAPHIC npMCI, BOOL fHurryUp);
  68. BOOL NEAR PASCAL ProcessPaletteChange(NPMCIGRAPHIC npMCI, DWORD cksize);
  69. /* Functions in avisound.c */
  70. BOOL NEAR PASCAL PlayRecordAudio(NPMCIGRAPHIC npMCI, BOOL FAR *pfHurryUp,
  71. BOOL FAR *pfPlayedAudio);
  72. BOOL NEAR PASCAL KeepPlayingAudio(NPMCIGRAPHIC npMCI);
  73. BOOL NEAR PASCAL HandleAudioChunk(NPMCIGRAPHIC npMCI);
  74. DWORD FAR PASCAL SetUpAudio(NPMCIGRAPHIC npMCI, BOOL fPlaying);
  75. DWORD FAR PASCAL CleanUpAudio(NPMCIGRAPHIC npMCI);
  76. void FAR PASCAL BuildVolumeTable(NPMCIGRAPHIC npMCI);
  77. BOOL FAR PASCAL StealWaveDevice(NPMCIGRAPHIC npMCI);
  78. BOOL FAR PASCAL GiveWaveDevice(NPMCIGRAPHIC npMCI);
  79. #define WM_AUDIO_ON WM_USER+100
  80. #define WM_AUDIO_OFF WM_USER+101
  81. #ifdef WIN32
  82. #define WM_AVISWP WM_USER+102
  83. #endif
  84. // in hmemcpy.asm
  85. #ifndef WIN32
  86. LPVOID FAR PASCAL MemCopy(LPVOID dest, LPVOID source, LONG count);
  87. #else
  88. #define MemCopy memmove
  89. #endif // WIN16
  90. #define GET_BYTE() (*((BYTE _huge *) (npMCI->lp))++)
  91. #ifdef WIN32
  92. #define GET_WORD() (*((UNALIGNED WORD _huge *) (npMCI->lp))++)
  93. #define GET_DWORD() (*((UNALIGNED DWORD _huge *) (npMCI->lp))++)
  94. #define PEEK_DWORD() (*((UNALIGNED DWORD _huge *) (npMCI->lp)))
  95. #else
  96. #define GET_WORD() (*((WORD _huge *) (npMCI->lp))++)
  97. #define GET_DWORD() (*((DWORD _huge *) (npMCI->lp))++)
  98. #define PEEK_DWORD() (*((DWORD _huge *) (npMCI->lp)))
  99. #endif
  100. #define SKIP_BYTES(nBytes) ((npMCI->lp) += (nBytes))
  101. #define Now() (timeGetTime())
  102. void NEAR PASCAL aviTaskYield(void);
  103. BOOL FAR PASCAL ReadIndex(NPMCIGRAPHIC npMCI);
  104. LONG NEAR PASCAL FindPrevKeyFrame(NPMCIGRAPHIC npMCI, STREAMINFO *psi, LONG lFrame);
  105. LONG NEAR PASCAL FindNextKeyFrame(NPMCIGRAPHIC npMCI, STREAMINFO *psi, LONG lFrame);
  106.