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.

90 lines
2.6 KiB

  1. //==========================================================================;
  2. // MSVidEncoder.h : Declaration of the CMSVidEncoder
  3. // copyright (c) Microsoft Corp. 1998-1999.
  4. /////////////////////////////////////////////////////////////////////////////
  5. #pragma once
  6. #ifndef __MSVidEncoder_H_
  7. #define __MSVidEncoder_H_
  8. #include <algorithm>
  9. #include <tchar.h>
  10. #include <objectwithsiteimplsec.h>
  11. #include "segimpl.h"
  12. #include "encoderimpl.h"
  13. #include <strmif.h>
  14. #include "seg.h"
  15. typedef CComQIPtr<ITuner> PQMSVidEncoder;
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CMSVidEncoder
  18. class ATL_NO_VTABLE __declspec(uuid("BB530C63-D9DF-4b49-9439-63453962E598")) CEncoder :
  19. public CComObjectRootEx<CComSingleThreadModel>,
  20. public CComCoClass<CEncoder, &__uuidof(CEncoder)>,
  21. public IObjectWithSiteImplSec<CEncoder>,
  22. public ISupportErrorInfo,
  23. public IConnectionPointContainerImpl<CEncoder>,
  24. public IMSVidGraphSegmentImpl<CEncoder, MSVidSEG_XFORM, &GUID_NULL>,
  25. public IMSVidEncoderImpl<CEncoder, &LIBID_MSVidCtlLib, &GUID_NULL, IMSVidEncoder>
  26. {
  27. public:
  28. CEncoder() : m_iEncoder(-1), m_iDemux(-1) {
  29. }
  30. REGISTER_AUTOMATION_OBJECT(IDS_PROJNAME,
  31. IDS_REG_ENCODER_PROGID,
  32. IDS_REG_ENCODER_DESC,
  33. LIBID_MSVidCtlLib,
  34. __uuidof(CEncoder));
  35. DECLARE_PROTECT_FINAL_CONSTRUCT()
  36. BEGIN_COM_MAP(CEncoder)
  37. COM_INTERFACE_ENTRY(IMSVidGraphSegment)
  38. COM_INTERFACE_ENTRY(IMSVidEncoder)
  39. COM_INTERFACE_ENTRY(IDispatch)
  40. COM_INTERFACE_ENTRY(IObjectWithSite)
  41. COM_INTERFACE_ENTRY(IMSVidFeature)
  42. COM_INTERFACE_ENTRY(IMSVidDevice)
  43. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  44. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  45. COM_INTERFACE_ENTRY(IPersist)
  46. END_COM_MAP()
  47. BEGIN_CATEGORY_MAP(CEncoder)
  48. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  49. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  50. IMPLEMENTED_CATEGORY(CATID_PersistsToPropertyBag)
  51. END_CATEGORY_MAP()
  52. BEGIN_CONNECTION_POINT_MAP(CEncoder)
  53. END_CONNECTION_POINT_MAP()
  54. // ISupportsErrorInfo
  55. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  56. public:
  57. PQCreateDevEnum m_pSystemEnum;
  58. int m_iEncoder;
  59. int m_iDemux;
  60. HRESULT Unload(void);
  61. STDMETHOD(get_AudioEncoderInterface)(/*[out, retval]*/ IUnknown **ppEncInt);
  62. STDMETHOD(get_VideoEncoderInterface)(/*[out, retval]*/ IUnknown **ppEncInt);
  63. // IMSVidGraphSegment
  64. STDMETHOD(Build)();
  65. STDMETHOD(PreRun)();
  66. STDMETHOD(put_Container)(IMSVidGraphSegmentContainer *pCtl);
  67. // IMSVidDevice
  68. STDMETHOD(get_Name)(BSTR * Name);
  69. protected:
  70. CComQIPtr<IVideoEncoder> m_qiVidEnc;
  71. CComQIPtr<IEncoderAPI> m_qiAudEnc;
  72. };
  73. #endif //__MSVidEncoder_H_