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.

143 lines
5.7 KiB

  1. //==========================================================================;
  2. // MSVidSBESource.h : Declaration of the CMSVidStreamBufferSource class
  3. // copyright (c) Microsoft Corp. 1998-1999.
  4. //==========================================================================;
  5. #ifndef __MSVIDSTREAMBUFFERSOURCE_H_
  6. #define __MSVIDSTREAMBUFFERSOURCE_H_
  7. #pragma once
  8. #include <algorithm>
  9. #include <dvdmedia.h>
  10. #include <objectwithsiteimplsec.h>
  11. #include <bcasteventimpl.h>
  12. #include "pbsegimpl.h"
  13. #include "fileplaybackimpl.h"
  14. #include "seg.h"
  15. #include <dvdmedia.h>
  16. #include "sbesourcecp.h"
  17. #include "resource.h" // main symbols
  18. #include "sbe.h"
  19. typedef CComQIPtr<IStreamBufferMediaSeeking> PQISBEMSeeking;
  20. typedef CComQIPtr<IFileSourceFilter> QIFileSource;
  21. class ATL_NO_VTABLE __declspec(uuid("AD8E510D-217F-409b-8076-29C5E73B98E8")) CMSVidStreamBufferSource:
  22. public CComObjectRootEx<CComSingleThreadModel>,
  23. public CComCoClass<CMSVidStreamBufferSource, &__uuidof(CMSVidStreamBufferSource)>,
  24. public IObjectWithSiteImplSec<CMSVidStreamBufferSource>,
  25. public ISupportErrorInfo,
  26. public IBroadcastEventImpl<CMSVidStreamBufferSource>,
  27. public IConnectionPointContainerImpl<CMSVidStreamBufferSource>,
  28. public CProxy_StreamBufferSourceEvent<CMSVidStreamBufferSource>,
  29. public IMSVidPBGraphSegmentImpl<CMSVidStreamBufferSource, MSVidSEG_SOURCE, &GUID_NULL>,
  30. public IMSVidFilePlaybackImpl<CMSVidStreamBufferSource, &LIBID_MSVidCtlLib, &GUID_NULL, IMSVidStreamBufferSource>,
  31. public IProvideClassInfo2Impl<&CLSID_MSVidStreamBufferSource, &IID_IMSVidStreamBufferSourceEvent, &LIBID_MSVidCtlLib>
  32. {
  33. public:
  34. CMSVidStreamBufferSource() : m_dwEventCookie(0) {
  35. m_fEnableResetOnStop = true;
  36. }
  37. virtual ~CMSVidStreamBufferSource() {}
  38. REGISTER_AUTOMATION_OBJECT(IDS_PROJNAME,
  39. IDS_REG_MSVIDSTREAMBUFFERSOURCE_PROGID,
  40. IDS_REG_MSVIDSTREAMBUFFERSOURCE_DESC,
  41. LIBID_MSVidCtlLib,
  42. __uuidof(CMSVidStreamBufferSource));
  43. DECLARE_PROTECT_FINAL_CONSTRUCT()
  44. BEGIN_COM_MAP(CMSVidStreamBufferSource)
  45. COM_INTERFACE_ENTRY(IMSVidStreamBufferSource)
  46. COM_INTERFACE_ENTRY(IDispatch)
  47. COM_INTERFACE_ENTRY(IObjectWithSite)
  48. COM_INTERFACE_ENTRY(IBroadcastEvent)
  49. COM_INTERFACE_ENTRY(IMSVidGraphSegment)
  50. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  51. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  52. COM_INTERFACE_ENTRY(IMSVidPlayback)
  53. COM_INTERFACE_ENTRY(IMSVidInputDevice)
  54. COM_INTERFACE_ENTRY(IMSVidDevice)
  55. COM_INTERFACE_ENTRY(IPersist)
  56. COM_INTERFACE_ENTRY(IProvideClassInfo2)
  57. COM_INTERFACE_ENTRY(IProvideClassInfo)
  58. END_COM_MAP()
  59. BEGIN_CATEGORY_MAP(CMSVidStreamBufferSource)
  60. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  61. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  62. IMPLEMENTED_CATEGORY(CATID_PersistsToPropertyBag)
  63. END_CATEGORY_MAP()
  64. BEGIN_CONNECTION_POINT_MAP(CMSVidStreamBufferSource)
  65. CONNECTION_POINT_ENTRY(IID_IMSVidStreamBufferSourceEvent)
  66. END_CONNECTION_POINT_MAP()
  67. // ISupportsErrorInfo
  68. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  69. protected:
  70. QIFileSource m_spFileSource;
  71. DSFilterList m_decFilters;
  72. PQBroadcastEvent m_pBcast;
  73. DWORD m_dwEventCookie;
  74. public:
  75. STDMETHOD(PostStop)();
  76. // DON'T addref the container. we're guaranteed nested lifetimes
  77. // and an addref creates circular refcounts so we never unload.
  78. CComBSTR __declspec(property(get=GetName)) m_Name;
  79. CComBSTR GetName(void) {
  80. CString csName;
  81. if(m_iReader != -1){
  82. csName = (m_Filters[m_iReader]).GetName();
  83. }
  84. if (csName.IsEmpty()) {
  85. csName = _T("Stream Buffer Source");
  86. }
  87. return CComBSTR(csName);
  88. }
  89. STDMETHOD(Unload)(void);
  90. // IMSVidGraphSegment
  91. STDMETHOD(put_Init)(IUnknown *pInit);
  92. STDMETHOD(Build)();
  93. STDMETHOD(put_Container)(IMSVidGraphSegmentContainer *pVal);
  94. STDMETHOD(OnEventNotify)(long lEvent, LONG_PTR lParam1, LONG_PTR lParam2);
  95. STDMETHOD(Decompose)();
  96. // IMSVidDevice
  97. STDMETHOD(get_Name)(BSTR * Name);
  98. // IMSVidInputDevice
  99. STDMETHOD(IsViewable)(VARIANT* pv, VARIANT_BOOL *pfViewable);
  100. STDMETHOD(View)(VARIANT* pv);
  101. // IMSVidPlayback
  102. // IMSVidPlayback
  103. STDMETHOD(get_RecordingAttribute)(/*[out, retval]*/ IUnknown **pRecordingAttribute);
  104. STDMETHOD(CurrentRatings)(/*[out, retval]*/ EnTvRat_System *pEnSystem, /*[out, retval]*/ EnTvRat_GenericLevel *pEnRating, /*[out, retval]*/ LONG *plbfEnAttr); //attrs are bitfields of BfEnTvRat_GenericAttributes
  105. STDMETHOD(MaxRatingsLevel)(/*[in]*/ EnTvRat_System enSystem, /*[in]*/ EnTvRat_GenericLevel enRating, /*[in]*/ LONG lbfEnAttr);
  106. STDMETHOD(put_BlockUnrated)(/*[in]*/ VARIANT_BOOL bBlock);
  107. STDMETHOD(put_UnratedDelay)(/*[in]*/ long dwDelay);
  108. STDMETHOD(get_Start)(/*[out, retval]*/long *lStart);
  109. ///////////////////////////////////////////////////////////////////////////////////////////
  110. // IMSVidPlaybackimpl
  111. ///////////////////////////////////////////////////////////////////////////////////////////
  112. STDMETHOD(get_Length)(/*[out, retval]*/long *lLength);
  113. STDMETHOD(get_CurrentPosition)(/*[out,retval]*/long *lPosition);
  114. STDMETHOD(put_CurrentPosition)(/*[in]*/long lPosition);
  115. STDMETHOD(put_PositionMode)(/*[in]*/PositionModeList lPositionMode);
  116. STDMETHOD(get_PositionMode)(/*[out,retval]*/PositionModeList* lPositionMode);
  117. STDMETHOD(put_Rate)(double lRate);
  118. STDMETHOD(get_Rate)(double *plRate);
  119. STDMETHOD(get_CanStep)(VARIANT_BOOL fBackwards, VARIANT_BOOL *pfCan);
  120. STDMETHOD(Step)(long lStep);
  121. STDMETHOD(PreRun)();
  122. // IBroadcastEvent
  123. STDMETHOD(Fire)(GUID gEventID);
  124. STDMETHOD(get_SBESource)(/*[out, retval]*/ IUnknown **sbeFilter);
  125. };
  126. #endif