Source code of Windows XP (NT5)
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.

152 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. Confvid.h
  5. Abstract:
  6. Definitions for video streams
  7. Author:
  8. Mu Han (muhan) 15-September-1998
  9. --*/
  10. #ifndef __CONFVID_H_
  11. #define __CONFVID_H_
  12. const DWORD g_dwVideoThreadPriority = THREAD_PRIORITY_NORMAL;
  13. const DWORD g_dwVideoChannels = 1;
  14. const DWORD g_dwVideoSampleRateHigh = 8;
  15. const DWORD g_dwVideoSampleRateLow = 5;
  16. const int CIFWIDTH = 0x160;
  17. const int CIFHEIGHT = 0x120;
  18. const int QCIFWIDTH = 0xb0;
  19. const int QCIFHEIGHT = 0x90;
  20. // This is the lowest bitrate we will use.
  21. const int BITRATELOWERLIMIT = 4000;
  22. // This is the threshold for sending a flow control command.
  23. const int BITRATEDELTA = 2000;
  24. // This is increment we use for adjust back to normal.
  25. const int BITRATEINC = 1000;
  26. const DWORD VIDEO_INITIAL_ADJUSTMENT_THRESHOLD = 12000;
  27. const float VIDEO_INITIAL_ADJUSTMENT = 0.8f;
  28. const int IFRAMEINTERVAL = 15000; // in miliseconds.
  29. typedef enum _ENCODERCOMMAND
  30. {
  31. EC_BITRATE,
  32. EC_IFRAME
  33. } ENCODERCOMMAND, *PENCODERCOMMAND;
  34. class CStreamVideoRecv : public CH323MSPStream
  35. {
  36. public:
  37. CStreamVideoRecv();
  38. HRESULT Configure(
  39. IN HANDLE htChannel,
  40. IN STREAMSETTINGS &StreamSettings
  41. );
  42. protected:
  43. HRESULT SetUpFilters();
  44. HRESULT SetUpInternalFilters();
  45. HRESULT ConnectTerminal(
  46. IN ITTerminal * pITTerminal
  47. );
  48. HRESULT ConfigureRTPFilter(
  49. IN IBaseFilter * pIBaseFilter
  50. );
  51. HRESULT HandlePacketReceiveLoss(
  52. IN DWORD dwLossRate
  53. );
  54. protected:
  55. DWORD m_dwCurrentBitRate;
  56. DWORD m_dwProposedBitRate;
  57. DWORD m_dwLastIFrameRequestedTime;
  58. DWORD m_dwIFramePending;
  59. };
  60. class CStreamVideoSend : public CH323MSPStream
  61. {
  62. public:
  63. CStreamVideoSend();
  64. HRESULT Configure(
  65. IN HANDLE htChannel,
  66. IN STREAMSETTINGS &StreamSettings
  67. );
  68. HRESULT ShutDown ();
  69. HRESULT SendIFrame();
  70. HRESULT ChangeMaxBitRate(
  71. IN DWORD dwMaxBitRate
  72. );
  73. protected:
  74. HRESULT CheckTerminalTypeAndDirection(
  75. IN ITTerminal * pTerminal
  76. );
  77. HRESULT SetUpFilters();
  78. HRESULT ConnectTerminal(
  79. IN ITTerminal * pITTerminal
  80. );
  81. HRESULT CStreamVideoSend::CreateSendFilters(
  82. IN IPin *pCapturePin
  83. );
  84. HRESULT CStreamVideoSend::ConnectPreview(
  85. IN IPin *pPreviewInputPin
  86. );
  87. HRESULT ConfigureVideoCaptureTerminal(
  88. IN ITTerminalControl* pTerminal,
  89. OUT IPin ** ppIPin
  90. );
  91. HRESULT FindPreviewInputPin(
  92. IN ITTerminalControl* pTerminal,
  93. OUT IPin ** ppIpin
  94. );
  95. HRESULT ConfigureRTPFilter(
  96. IN IBaseFilter * pIBaseFilter
  97. );
  98. HRESULT HandlePacketTransmitLoss(
  99. IN DWORD dwLossRate
  100. );
  101. protected:
  102. IBaseFilter * m_pIEncoderFilter;
  103. DWORD m_dwCurrentBitRate;
  104. DWORD m_dwProposedBitRate;
  105. DWORD m_dwLastIFrameSentTime;
  106. DWORD m_dwIFramePending;
  107. };
  108. #endif