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.

125 lines
2.5 KiB

  1. #include <precomp.h>
  2. // IID_IProperty
  3. IID IID_IProperty =
  4. { /* 4e94d3e0-793e-11d0-8ef0-00a0c90541f4 */
  5. 0x4e94d3e0,
  6. 0x793e,
  7. 0x11d0,
  8. {0x8e, 0xf0, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0xf4}
  9. };
  10. // default implementations for SetNetworkInterface
  11. HRESULT STDMETHODCALLTYPE SendMediaStream::SetNetworkInterface(IUnknown *pUnknown)
  12. {
  13. HRESULT hr=S_OK;
  14. IRTPSend *pRTPSend=NULL;
  15. if (m_DPFlags & DPFLAG_STARTED_SEND)
  16. {
  17. return DPR_IO_PENDING; // anything better to return ?
  18. }
  19. if (pUnknown != NULL)
  20. {
  21. hr = pUnknown->QueryInterface(IID_IRTPSend, (void**)&pRTPSend);
  22. }
  23. if (SUCCEEDED(hr))
  24. {
  25. if (m_pRTPSend)
  26. {
  27. m_pRTPSend->Release();
  28. }
  29. m_pRTPSend = pRTPSend;
  30. ZeroMemory(&m_RTPStats,sizeof(m_RTPStats)); // reset network stats
  31. }
  32. return hr;
  33. }
  34. HRESULT SendMediaStream::SetFlowSpec()
  35. {
  36. HRESULT hr = DPR_NOT_CONFIGURED;
  37. IRTPSession *pRtpSession;
  38. if (m_pDP->m_bDisableRSVP)
  39. return S_OK;
  40. if ((m_DPFlags & DPFLAG_CONFIGURED_SEND) && (m_pRTPSend))
  41. {
  42. m_pRTPSend->QueryInterface(IID_IRTPSession, (void**)&pRtpSession);
  43. pRtpSession->SetSendFlowspec(&m_flowspec);
  44. pRtpSession->Release();
  45. hr = DPR_SUCCESS;
  46. }
  47. return hr;
  48. }
  49. HRESULT RecvMediaStream::SetFlowSpec()
  50. {
  51. HRESULT hr = DPR_NOT_CONFIGURED;
  52. IRTPSession *pSession=NULL;
  53. if (m_pDP->m_bDisableRSVP)
  54. return S_OK;
  55. if ((m_DPFlags & DPFLAG_CONFIGURED_RECV) && (m_pIRTPRecv))
  56. {
  57. // the following is bogus for two reasons
  58. // 1. when we go multipoint, we really need to set
  59. // set the WinsockQos based on the total number
  60. // of incoming sessions.
  61. // 2. The RTP interfaces will eventually be made
  62. // so that RTP Session and RTPRecv objects are
  63. // distinct. So QI will fail.
  64. hr = m_pIRTPRecv->QueryInterface(IID_IRTPSession, (void**)&pSession);
  65. if (SUCCEEDED(hr))
  66. {
  67. pSession->SetRecvFlowspec(&m_flowspec);
  68. pSession->Release();
  69. hr = DPR_SUCCESS;
  70. }
  71. }
  72. return hr;
  73. }
  74. HRESULT STDMETHODCALLTYPE RecvMediaStream::SetNetworkInterface(IUnknown *pUnknown)
  75. {
  76. HRESULT hr=S_OK;
  77. IRTPRecv *pRTPRecv=NULL;
  78. // don't try to do change the RTP interface while in mid-stream
  79. if (m_DPFlags & DPFLAG_STARTED_RECV)
  80. {
  81. return DPR_IO_PENDING; // anything better to return ?
  82. }
  83. if (pUnknown)
  84. {
  85. hr = pUnknown->QueryInterface(IID_IRTPRecv, (void**)&pRTPRecv);
  86. }
  87. if (SUCCEEDED(hr))
  88. {
  89. if (m_pIRTPRecv)
  90. {
  91. m_pIRTPRecv->Release();
  92. }
  93. m_pIRTPRecv = pRTPRecv;
  94. }
  95. return hr;
  96. }