TermMgr.Idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:11k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //
  4. cpp_quote("/* Copyright (c) Microsoft Corporation. All rights reserved. */")
  5. // This file will be processed by the MIDL tool to
  6. // produce the type library (termmgr.tlb) and marshalling code.
  7. #ifndef __TERMINAL_MANAGER_IDL__
  8. #define __TERMINAL_MANAGER_IDL__
  9. // Doesn't seem to work: midl_pragma warning( disable: 2039 );
  10. import "Objsafe.idl";
  11. import "tapi3if.idl"; // for TERMINAL_STATE, etc.
  12. import "tapi3ds.idl"; // for MST interfaces
  13. import "strmif.idl";  // for IGraphBuilder, IBaseFilter, etc.
  14. import "msp.idl";     // for MSP_HANDLE
  15. typedef enum
  16. {
  17.     TMGR_TD_CAPTURE = 1,
  18.     TMGR_TD_RENDER  = 2,
  19.     TMGR_TD_BOTH    = 3
  20. } TMGR_DIRECTION;
  21. const BSTR CLSID_String_VideoSuperclass  = L"{714C6F8C-6244-4685-87B3-B91F3F9EADA7}";
  22. const BSTR CLSID_String_StreamingSuperclass = L"{214F4ACC-AE0B-4464-8405-07029003F8E2}";
  23. const BSTR CLSID_String_FileSuperclass = L"{B4790031-56DB-4d3e-88C8-6FFAAFA08A91}";
  24. //
  25. // This interface is implemented on all DirectShow terminals. It provides
  26. // methods for connection, disconnection, and dynamic filter graph control.
  27. //
  28. [
  29.     uuid( AED6483B-3304-11d2-86F1-006008B0E5D2 ),
  30.     helpstring("ITTerminalControl interface"),
  31.     dual
  32. ]
  33. interface ITTerminalControl : IUnknown
  34. {
  35.     [id(1), propget, helpstring("method get_AddressHandle")]
  36.     HRESULT AddressHandle(
  37.             [out]      MSP_HANDLE    * phtAddress
  38.             );
  39.     // enters each of the internal filters into the filter graph
  40.     // connects the internal filters together (if applicable)
  41.     // and returns a set of pins for connection
  42.     [id(2), helpstring("method ConnectTerminal")]
  43.     HRESULT ConnectTerminal(
  44.             [in]      IGraphBuilder  * pGraph,
  45.             [in]      DWORD            dwTerminalDirection,
  46.             [in, out] DWORD          * pdwNumPins,
  47.             [out]     IPin          ** ppPins
  48.             );
  49.     [id(3), helpstring("method CompleteConnectTerminal")]
  50.     HRESULT CompleteConnectTerminal(
  51.             );
  52.     // disconnects the internal filters and removes them from the filter graph
  53.     // filter graph parameter is used for validation, to make sure the terminal
  54.     // is disconnected from the same graph that it was originally connected to
  55.     [id(4), helpstring("method DisconnectTerminal")] 
  56.     HRESULT DisconnectTerminal(
  57.             [in]      IGraphBuilder  * pGraph,
  58.             [in]      DWORD            dwReserved
  59.             );
  60.     // stops the rightmost render filter in the terminal
  61.     // (needed for dynamic filter graphs)
  62.     [id(5), helpstring("method RunRenderFilter")] 
  63.     HRESULT RunRenderFilter(
  64.             );
  65.     // stops the rightmost render filter in the terminal
  66.     // (needed for dynamic filter graphs)
  67.     [id(6), helpstring("method StopRenderFilter")] 
  68.     HRESULT StopRenderFilter(
  69.             );
  70. }
  71. //
  72. // this interface is implemented by pluggable terminals
  73. //
  74. [
  75.     uuid(AED6483C-3304-11d2-86F1-006008B0E5D2),
  76.     helpstring("TAPI 3.0 ITPluggableTerminalInitialization interface"),
  77.     dual
  78. ]
  79. interface ITPluggableTerminalInitialization : IUnknown
  80. {
  81.     [id(1), helpstring("method InitializeDynamic")]
  82.     HRESULT InitializeDynamic (
  83.             [in] IID                   iidTerminalClass,
  84.             [in] DWORD                 dwMediaType,
  85.             [in] TERMINAL_DIRECTION    Direction,
  86.             [in] MSP_HANDLE            htAddress
  87.             );
  88. }
  89. [
  90.     object,
  91.     uuid(7170F2DE-9BE3-11D0-A009-00AA00B605A4),
  92.     helpstring("ITTerminalManager Interface"),
  93.     pointer_default(unique),
  94.     hidden
  95. ]
  96. interface ITTerminalManager : IUnknown
  97. {
  98.     [id(1), helpstring("method GetDynamicTerminalClasses")]
  99.     HRESULT GetDynamicTerminalClasses(
  100.             [in]      DWORD                    dwMediaTypes,
  101.             [in, out] DWORD                  * pdwNumClasses,
  102.             [out]     IID                    * pTerminalClasses
  103.             );
  104.     [id(2), helpstring("method CreateDynamicTerminal")]
  105.     HRESULT CreateDynamicTerminal(
  106.             [in]      IUnknown               * pOuterUnknown,
  107.             [in]      IID                      iidTerminalClass,
  108.             [in]      DWORD                    dwMediaType,
  109.             [in]      TERMINAL_DIRECTION       Direction,
  110.             [in]      MSP_HANDLE               htAddress,
  111.             [out]     ITTerminal            ** ppTerminal
  112.             );
  113. };
  114. [
  115.     uuid(BB33DEC6-B2C7-46E6-9ED1-498B91FA85AC),
  116.     helpstring("ITTerminalManager2 Interface"),
  117.     pointer_default(unique),
  118.     hidden
  119.     
  120. ]
  121. interface ITTerminalManager2 : ITTerminalManager
  122. {
  123.     [id(3), helpstring("method GetPluggableSuperclasses")]
  124.     HRESULT GetPluggableSuperclasses(
  125.             [in, out] DWORD                  * pdwNumSuperclasses,
  126.             [out]     IID                    * pSuperclasses
  127.             );
  128.     [id(4), helpstring("method GetPluggableTerminalClasses")]
  129.     HRESULT GetPluggableTerminalClasses(
  130.             [in]      IID                    iidSuperclass,
  131.             [in]      DWORD                  dwMediaTypes,
  132.             [in, out] DWORD                  * pdwNumClasses,
  133.             [out]     IID                    * pTerminalClasses
  134.             );
  135. };
  136. //
  137. // --- ITPluggableTerminal ---
  138. // This interface describes the registry entry for a terminal
  139. //
  140. [
  141.     object,
  142.     uuid(924A3723-A00B-4f5f-9FEE-8E9AEB9E82AA),
  143.     dual,
  144.     helpstring("ITPluggableTerminalClassRegistration Interface"),
  145.     pointer_default(unique)
  146. ]
  147. interface ITPluggableTerminalClassRegistration : IDispatch
  148. {
  149.     //
  150.     // Terminal Friendly Name
  151.     //
  152.     [id(1), propget, helpstring("property Name")]
  153.     HRESULT Name(
  154.             [out, retval] BSTR*           pName
  155.             );
  156.     [id(1), propput, helpstring("property Name")]
  157.     HRESULT Name(
  158.             [in]          BSTR            bstrName
  159.             );
  160.     //
  161.     // Company name
  162.     //
  163.     [id(2), propget, helpstring("property Company")]
  164.     HRESULT Company(
  165.             [out, retval] BSTR*          pCompany
  166.             );
  167.     [id(2), propput, helpstring("property Company")]
  168.     HRESULT Company(
  169.             [in]          BSTR            bstrCompany
  170.             );
  171.     //
  172.     // Terminal Version
  173.     //
  174.     [id(3), propget, helpstring("property Version")]
  175.     HRESULT Version(
  176.             [out, retval] BSTR*          pVersion
  177.             );
  178.     [id(3), propput, helpstring("property Version")]
  179.     HRESULT Version(
  180.             [in]          BSTR            bstrVersion
  181.             );
  182.     //
  183.     // TerminalClass
  184.     //
  185.     [id(4), propget, helpstring("property TerminalClass")]
  186.     HRESULT TerminalClass(
  187.             [out, retval] BSTR*          pTerminalClass
  188.             );
  189.     [id(4), propput, helpstring("property TerminalClass")]
  190.     HRESULT TerminalClass(
  191.             [in]          BSTR            bstrTerminalClass
  192.             );
  193.     //
  194.     // This CLSID is used to CoCreate the terminal
  195.     //
  196.     [id(5), propget, helpstring("property CLSID")]
  197.     HRESULT CLSID(
  198.             [out, retval] BSTR*          pCLSID
  199.             );
  200.     [id(5), propput, helpstring("property CLSID")]
  201.     HRESULT CLSID(
  202.             [in]          BSTR            bstrCLSID
  203.             );
  204.     //
  205.     // Direction supported by terminal
  206.     //
  207.     [id(6), propget, helpstring("property Direction")]
  208.     HRESULT Direction(
  209.             [out, retval] TMGR_DIRECTION*  pDirection
  210.             );
  211.     [id(6), propput, helpstring("property Direction")]
  212.     HRESULT Direction(
  213.             [in]          TMGR_DIRECTION   nDirection
  214.             );
  215.     //
  216.     // Media Types supported by terminal
  217.     //
  218.     [id(7), propget, helpstring("property MediaTypes")]
  219.     HRESULT MediaTypes(
  220.             [out, retval] long*  pMediaTypes
  221.             );
  222.     [id(7), propput, helpstring("property MediaTypes")]
  223.     HRESULT MediaTypes(
  224.             [in]          long   nMediaTypes
  225.             );
  226.     //
  227.     // Add terminal into the registry
  228.     // If already exist an entry for terminal
  229.     // edit this entry
  230.     //
  231.     [id(8), helpstring("method Add")]
  232.     HRESULT Add(
  233.             [in]    BSTR    bstrSuperclass
  234.             );
  235.     //
  236.     // Delete the temrinal entry from registry
  237.     //
  238.     [id(9), helpstring("method Delete")]
  239.     HRESULT Delete(
  240.             [in]    BSTR    bstrSuperclass
  241.             );
  242.     //
  243.     // Get all information from registry for
  244.     // specific terminal
  245.     //
  246.     [id(10), helpstring("method GetTerminalClassInfo")]
  247.     HRESULT GetTerminalClassInfo(
  248.             [in]    BSTR    bstrSuperclass
  249.             );
  250. };
  251. //
  252. // --- ITPluggableTerminalSuperlassRegistration ---
  253. // This interface describes the registry entry for a terminal superclass
  254. //
  255. [
  256.     object,
  257.     uuid(60D3C08A-C13E-4195-9AB0-8DE768090F25),
  258.     dual,
  259.     helpstring("ITPluggableTerminalSuperclassRegistration Interface"),
  260.     pointer_default(unique)
  261. ]
  262. interface ITPluggableTerminalSuperclassRegistration : IDispatch
  263. {
  264.     [id(1), propget, helpstring("property Name")]
  265.     HRESULT Name(
  266.             [out, retval] BSTR*          pName
  267.             );
  268.     [id(1), propput, helpstring("property Name")]
  269.     HRESULT Name(
  270.             [in]          BSTR            bstrName
  271.             );
  272.     [id(2), propget, helpstring("property CLSID")]
  273.     HRESULT CLSID(
  274.             [out, retval] BSTR*           pCLSID
  275.             );
  276.     [id(2), propput, helpstring("property CLSID")]
  277.     HRESULT CLSID(
  278.             [in]          BSTR            bstrCLSID
  279.             );
  280.     [id(3), helpstring("method Add")]
  281.     HRESULT Add(
  282.             );
  283.     [id(4), helpstring("method Delete")]
  284.     HRESULT Delete(
  285.             );
  286.     [id(5), helpstring("method GetTerminalSuperclassInfo")]
  287.     HRESULT GetTerminalSuperclassInfo(
  288.             );
  289.     [id(6), propget, helpstring("method TerminalClasses")]
  290.     HRESULT TerminalClasses(
  291.             [out, retval] VARIANT*         pTerminals
  292.             );
  293.     [id(7), helpstring("method EnumerateTerminalClasses"), hidden]
  294.     HRESULT EnumerateTerminalClasses(
  295.             [out, retval] IEnumTerminalClass** ppTerminals
  296.             );
  297. };
  298. [
  299.     uuid(28DCD85B-ACA4-11D0-A028-00AA00B605A4),
  300.     version(1.0),
  301.     helpstring("TAPI3 Terminal Manager 1.0 Type Library")
  302. ]
  303. library TERMMGRLib
  304. {
  305.     importlib("stdole2.tlb");
  306.     [
  307.         uuid(7170F2E0-9BE3-11D0-A009-00AA00B605A4),
  308.         helpstring("TAPI 3.0 TerminalManager Class"),
  309.         hidden
  310.     ]
  311.     coclass TerminalManager
  312.     {
  313.     [default] interface ITTerminalManager;
  314.     };
  315.     [
  316.         uuid(BB918E32-2A5C-4986-AB40-1686A034390A),
  317.         helpstring("PluggableTerminalSuperclass Class")
  318.     ]
  319.     coclass PluggableSuperclassRegistration
  320.     {
  321.         [default] interface ITPluggableTerminalSuperclassRegistration;
  322.     };
  323.     [
  324.         uuid(45234E3E-61CC-4311-A3AB-248082554482),
  325.         helpstring("PluggableTerminalClass Class")
  326.     ]
  327.     coclass PluggableTerminalRegistration
  328.     {
  329.         [default] interface ITPluggableTerminalClassRegistration;
  330.     };
  331. };
  332. #endif // __TERMINAL_MANAGER_IDL__