rmaformt.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:14k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /****************************************************************************
  2.  * 
  3.  *  $Id: rmaformt.h,v 1.1 2003/05/30 02:17:36 gabest Exp $
  4.  *
  5.  *  Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
  6.  *
  7.  *  http://www.real.com/devzone
  8.  *
  9.  *  This program contains proprietary 
  10.  *  information of Progressive Networks, Inc, and is licensed
  11.  *  subject to restrictions on use and distribution.
  12.  *
  13.  *
  14.  *  RealMedia Architecture Broadcast Format Plug-in Interfaces.
  15.  *
  16.  */
  17. #ifndef _RMAFORMT_H_
  18. #define _RMAFORMT_H_
  19. #include "rmafiles.h"
  20. /*
  21.  * Forward declarations of some interfaces defined here-in.
  22.  */
  23. typedef _INTERFACE IRMAFileFormatObject     IRMAFileFormatObject;
  24. typedef _INTERFACE      IRMABroadcastFormatObject   IRMABroadcastFormatObject;
  25. typedef _INTERFACE IRMAFormatResponse     IRMAFormatResponse;
  26. typedef _INTERFACE IRMAFileObject     IRMAFileObject;
  27. typedef _INTERFACE      IRMANetworkServices     IRMANetworkServices;
  28. typedef _INTERFACE      IRMAPacket                  IRMAPacket;
  29. typedef _INTERFACE      IRMAValues                  IRMAValues;
  30. typedef _INTERFACE IRMAPacketTimeOffsetHandler IRMAPacketTimeOffsetHandler;
  31. typedef _INTERFACE IRMAPacketTimeOffsetHandlerResponse
  32.     IRMAPacketTimeOffsetHandlerResponse;
  33. typedef _INTERFACE IRMALiveFileFormatInfo     IRMALiveFileFormatInfo;
  34. /****************************************************************************
  35.  * 
  36.  *  Interface:
  37.  * 
  38.  * IRMAFileFormatObject
  39.  * 
  40.  *  Purpose:
  41.  * 
  42.  * Object that allows a Controller to communicate with a specific
  43.  * File Format plug-in session
  44.  * 
  45.  *  IID_IRMAFileFormatObject:
  46.  * 
  47.  * {00000F00-0901-11d1-8B06-00A024406D59}
  48.  * 
  49.  */
  50. DEFINE_GUID(IID_IRMAFileFormatObject, 0x00000F00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  51. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  52. #undef  INTERFACE
  53. #define INTERFACE   IRMAFileFormatObject
  54. DECLARE_INTERFACE_(IRMAFileFormatObject, IUnknown)
  55. {
  56.     /*
  57.      * IUnknown methods
  58.      */
  59.     STDMETHOD(QueryInterface) (THIS_
  60. REFIID riid,
  61. void** ppvObj) PURE;
  62.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  63.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  64.     /*
  65.      * IRMAFileFormatObject methods
  66.      */
  67.     /************************************************************************
  68.      * Method:
  69.      *     IRMAFileFormatObject::GetFileFormatInfo
  70.      * Purpose:
  71.      *     Returns information vital to the instantiation of file format 
  72.      *     plugins.
  73.      */
  74.     STDMETHOD(GetFileFormatInfo)(THIS_
  75. REF(const char**) /*OUT*/ pFileMimeTypes,
  76. REF(const char**) /*OUT*/ pFileExtensions,
  77. REF(const char**) /*OUT*/ pFileOpenNames
  78. ) PURE;
  79.     STDMETHOD(InitFileFormat)
  80. (THIS_
  81.         IRMARequest* /*IN*/ pRequest, 
  82. IRMAFormatResponse* /*IN*/ pFormatResponse,
  83. IRMAFileObject* /*IN*/  pFileObject) PURE;
  84.     STDMETHOD(GetFileHeader) (THIS) PURE;
  85.     STDMETHOD(GetStreamHeader) (THIS_
  86. UINT16 unStreamNumber) PURE;
  87.     STDMETHOD(GetPacket) (THIS_
  88. UINT16 unStreamNumber) PURE;
  89.     STDMETHOD(Seek) (THIS_
  90. ULONG32 ulOffset) PURE;
  91.     STDMETHOD(Close) (THIS) PURE;
  92. };
  93. /****************************************************************************
  94.  * 
  95.  *  Interface:
  96.  * 
  97.  * IRMABroadcastFormatObject
  98.  * 
  99.  *  Purpose:
  100.  * 
  101.  * Object that allows a Controller to communicate with a specific
  102.  * Broadcast Format plug-in session
  103.  * 
  104.  *  IID_IRMABroadcastFormatObject:
  105.  * 
  106.  * {00000F01-0901-11d1-8B06-00A024406D59}
  107.  * 
  108.  */
  109. DEFINE_GUID(IID_IRMABroadcastFormatObject, 0x00000F01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  110. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  111. #undef  INTERFACE
  112. #define INTERFACE   IRMABroadcastFormatObject
  113. DECLARE_INTERFACE_(IRMABroadcastFormatObject, IUnknown)
  114. {
  115.     /*
  116.      * IUnknown methods
  117.      */
  118.     STDMETHOD(QueryInterface) (THIS_
  119. REFIID riid,
  120. void** ppvObj) PURE;
  121.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  122.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  123.     /*
  124.      * IRMABroadcastFormatObject methods
  125.      */
  126.     /************************************************************************
  127.      * Method:
  128.      *     IRMABroadcastFormatObject::GetBroadcastFormatInfo
  129.      * Purpose:
  130.      *     Returns information vital to the instantiation of broadcast format 
  131.      *     plugins.
  132.      */
  133.     STDMETHOD(GetBroadcastFormatInfo)(THIS_
  134. REF(const char*) /*OUT*/ pToken) PURE;
  135.     STDMETHOD(InitBroadcastFormat) (THIS_
  136.  const char* /*IN*/ pURL, 
  137.  IRMAFormatResponse* /*IN*/ pFormatResponse
  138. ) PURE;
  139.     STDMETHOD(GetFileHeader) (THIS) PURE;
  140.     STDMETHOD(GetStreamHeader) (THIS_
  141. UINT16 unStreamNumber) PURE;
  142.     STDMETHOD(StartPackets) (THIS_
  143. UINT16 unStreamNumber) PURE;
  144.     STDMETHOD(StopPackets) (THIS_
  145. UINT16 unStreamNumber) PURE;
  146. };
  147. /****************************************************************************
  148.  * 
  149.  *  Interface:
  150.  * 
  151.  * IRMAFormatResponse
  152.  * 
  153.  *  Purpose:
  154.  * 
  155.  * Object that allows a specific File Format Object to communicate 
  156.  * with its user
  157.  * 
  158.  *  IID_IRMAFormatResponse:
  159.  * 
  160.  * {00000F02-0901-11d1-8B06-00A024406D59}
  161.  * 
  162.  */
  163. DEFINE_GUID(IID_IRMAFormatResponse, 0x00000F02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  164. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  165. #undef  INTERFACE
  166. #define INTERFACE   IRMAFormatResponse
  167. DECLARE_INTERFACE_(IRMAFormatResponse, IUnknown)
  168. {
  169.     /*
  170.      * IUnknown methods
  171.      */
  172.     STDMETHOD(QueryInterface) (THIS_
  173. REFIID riid,
  174. void** ppvObj) PURE;
  175.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  176.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  177.     /*
  178.      * IRMAFormatResponse methods
  179.      */
  180.     STDMETHOD(InitDone) (THIS_
  181. PN_RESULT status) PURE;
  182.     STDMETHOD(PacketReady) (THIS_
  183. PN_RESULT status,
  184. IRMAPacket* pPacket) PURE;
  185.     STDMETHOD(SeekDone) (THIS_
  186. PN_RESULT status) PURE;
  187.     STDMETHOD(FileHeaderReady) (THIS_
  188. PN_RESULT status,
  189. IRMAValues* pHeader) PURE;
  190.     STDMETHOD(StreamHeaderReady) (THIS_
  191. PN_RESULT status,
  192. IRMAValues* pHeader) PURE;
  193.     STDMETHOD(StreamDone) (THIS_
  194. UINT16 unStreamNumber) PURE;
  195. };
  196. /****************************************************************************
  197.  * 
  198.  *  Interface:
  199.  * 
  200.  * IRMAPacketFormat
  201.  * 
  202.  *  Purpose:
  203.  * 
  204.  * Interface that modifies the behavior of an IRMAFileFormat by defining
  205.  * the packet format it will be creating.
  206.  * 
  207.  *  IID_IRMAPacketFormat:
  208.  * 
  209.  * {00000F03-0901-11d1-8B06-00A024406D59}
  210.  * 
  211.  */
  212. DEFINE_GUID(IID_IRMAPacketFormat, 0x00000F03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  213. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  214. #undef  INTERFACE
  215. #define INTERFACE   IRMAPacketFormat
  216. DECLARE_INTERFACE_(IRMAPacketFormat, IUnknown)
  217. {
  218.     /*
  219.      * IUnknown methods
  220.      */
  221.     STDMETHOD(QueryInterface) (THIS_
  222. REFIID riid,
  223. void** ppvObj) PURE;
  224.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  225.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  226.     /*
  227.      * IRMAPacketFormat methods
  228.      */
  229.     STDMETHOD(GetSupportedPacketFormats)
  230.      (THIS_
  231. REF(const char**) pFormats) PURE;
  232.     STDMETHOD(SetPacketFormat) (THIS_
  233. const char* pFormat) PURE;
  234. };
  235. /****************************************************************************
  236.  * 
  237.  *  Interface:
  238.  * 
  239.  * IRMAPacketTimeOffsetHandler
  240.  * 
  241.  *  Purpose:
  242.  * 
  243.  * Provides methods for handling the changing of a packets timestamp.
  244.  * 
  245.  *  IID_IRMAPacketTimeOffsetHandler:
  246.  * 
  247.  * {00000F04-0901-11d1-8B06-00A024406D59}
  248.  * 
  249.  */
  250. DEFINE_GUID(IID_IRMAPacketTimeOffsetHandler, 0x00000F04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  251. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  252. DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandler, IUnknown)
  253. {
  254.     /*
  255.      * IUnknown methods
  256.      */
  257.     STDMETHOD(QueryInterface) (THIS_
  258. REFIID riid,
  259. void** ppvObj) PURE;
  260.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  261.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  262.     /*
  263.      * IRMAPacketTimeOffsetHandler methods
  264.      */
  265.     /************************************************************************
  266.      * Method:
  267.      *     IRMAPacketTimeOffsetHandler::Init
  268.      * Purpose:
  269.      *     Initialize the IRMAPacketTimeOffsetHandler and set the response.
  270.      *      Implementors should look up the MimeType.
  271.      */
  272.     STDMETHOD(Init) (THIS_
  273. IRMAPacketTimeOffsetHandlerResponse* pResponse,
  274. IRMAValues* pHeader,
  275. IUnknown* pContext) PURE;
  276.     /************************************************************************
  277.      * Method:
  278.      *     IRMAPacketTimeOffsetHandler::SetTimeOffset
  279.      * Purpose:
  280.      *     Called to set the time offset.  Uses a bool and a UINT32 instead
  281.      *      of and INT32 so that the time offset wraps around after 47 days
  282.      *      instead of 24.  bPlus says whether to add or subtract.
  283.      */
  284.     STDMETHOD(SetTimeOffset) (THIS_
  285. UINT32 ulTimeOffset,
  286. BOOL bPlus) PURE;
  287.     /************************************************************************
  288.      * Method:
  289.      *     IRMAPacketTimeOffsetHandler::HandlePacket
  290.      * Purpose:
  291.      *     give the IRMAPacketTimeOffsetHandler a packet to modify for the
  292.      *      time offset.
  293.      */
  294.     STDMETHOD(HandlePacket) (THIS_
  295. IRMAPacket* pPacket) PURE;
  296. };
  297. /****************************************************************************
  298.  * 
  299.  *  Interface:
  300.  * 
  301.  * IRMAPacketTimeOffsetHandlerResponse
  302.  * 
  303.  *  Purpose:
  304.  * 
  305.  * Provides methods for the IRMAPacketTimeOffsetHandler to respond to.
  306.  * 
  307.  *  IID_IRMAPacketTimeOffsetHandlerResponse:
  308.  * 
  309.  * {00000F05-0901-11d1-8B06-00A024406D59}
  310.  * 
  311.  */
  312. DEFINE_GUID(IID_IRMAPacketTimeOffsetHandlerResponse, 0x00000F05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  313. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  314. DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandlerResponse, IUnknown)
  315. {
  316.     /*
  317.      * IUnknown methods
  318.      */
  319.     STDMETHOD(QueryInterface) (THIS_
  320. REFIID riid,
  321. void** ppvObj) PURE;
  322.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  323.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  324.     /*
  325.      * IRMAPacketTimeOffsetHandler methods
  326.      */
  327.     /************************************************************************
  328.      * Method:
  329.      *     IRMAPacketTimeOffsetHandler::PacketReady
  330.      * Purpose:
  331.      *     Called by IRMAPacketTimeOffsetHandler to pass back the packet 
  332.      *      when it is done with it.
  333.      */
  334.     STDMETHOD(TimeOffsetPacketReady) (THIS_
  335. IRMAPacket* pPacket) PURE;
  336. };
  337. /****************************************************************************
  338.  * 
  339.  *  Interface:
  340.  * 
  341.  * IRMALiveFileFormatInfo
  342.  * 
  343.  *  Purpose:
  344.  * 
  345.  * Provides miscellaneous information needed to transmit a live stream.
  346.  * Optionally implemented by the file format object.
  347.  * 
  348.  *  IID_IRMALiveFileFormatInfo:
  349.  * 
  350.  * {00000F06-0901-11d1-8B06-00A024406D59}
  351.  * 
  352.  */
  353. DEFINE_GUID(IID_IRMALiveFileFormatInfo, 0x00000F06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  354. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  355. #undef  INTERFACE
  356. #define INTERFACE   IRMALiveFileFormatInfo
  357. DECLARE_INTERFACE_(IRMALiveFileFormatInfo, IUnknown)
  358. {
  359.     /*
  360.      * IUnknown methods
  361.      */
  362.     STDMETHOD(QueryInterface) (THIS_
  363. REFIID riid,
  364. void** ppvObj) PURE;
  365.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  366.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  367.     /*
  368.      * IRMALiveFileFormatInfo methods
  369.      */
  370.     /************************************************************************
  371.      * Method:
  372.      *     IRMALiveFileFormatInfo::VerifyFileCompatibility
  373.      * Purpose:
  374.      *     Compares two file headers and returns PNR_OK if these two 
  375.      *     files can be transmitted sequentially in a single live 
  376.      *     presentation.
  377.      */
  378.     STDMETHOD(VerifyFileCompatibility)     (THIS_
  379.     IRMAValues* pFileHeader1,
  380.     IRMAValues* pFileHeader2) PURE;
  381.     /************************************************************************
  382.      * Method:
  383.      *     IRMALiveFileFormatInfo::VerifyStreamCompatibility
  384.      * Purpose:
  385.      *     Compares two stream headers and returns PNR_OK if these two  
  386.      *     streams can be transmitted sequentially in a single live 
  387.      *     presentation.
  388.      */
  389.     STDMETHOD(VerifyStreamCompatibility)    (THIS_
  390.     IRMAValues* pStreamHeader1,
  391.     IRMAValues* pStreamHeader2) PURE;
  392.     /************************************************************************
  393.      * Method:
  394.      *     IRMALiveFileFormatInfo::IsLiveResendRequired
  395.      * Purpose:
  396.      *     Returns TRUE if this stream requires the latest packet to be
  397.      *     resent periodically in a live presentation.
  398.      */
  399.     STDMETHOD_(BOOL,IsLiveResendRequired)   (THIS_
  400.     UINT16 unStreamNumber) PURE;
  401.     /************************************************************************
  402.      * Method:
  403.      *     IRMALiveFileFormatInfo::GetResendBitrate
  404.      * Purpose:
  405.      *     If periodic live resends are required for this stream, this
  406.      *     method returns the rate at which we should resend packets. The 
  407.      *     resend rate is measured in bits per second.
  408.      */
  409.     STDMETHOD(GetResendBitrate)     (THIS_
  410.     UINT16 unStreamNumber,
  411.     REF(UINT32) ulBitrate) PURE;
  412.     /************************************************************************
  413.      * Method:
  414.      *     IRMALiveFileFormatInfo::GetResendDuration
  415.      * Purpose:
  416.      *     If periodic live resends are required for this stream, this
  417.      *     method returns the number of milliseconds for which this packet 
  418.      *     should be resent.
  419.      */
  420.     STDMETHOD(GetResendDuration)     (THIS_
  421.     IRMAPacket* pPacket,
  422.     REF(UINT32) ulDuration) PURE;
  423.     /************************************************************************
  424.      * Method:
  425.      *     IRMALiveFileFormatInfo::FormResendPacket
  426.      * Purpose:
  427.      *     Forms a live resend packet based upon the original packet passed
  428.      *     as the first parameter. This allows the file format plugin to
  429.      *     make resend packets distinguishable from original packets.
  430.      */
  431.     STDMETHOD(FormResendPacket) (THIS_
  432. IRMAPacket* pOriginalPacket,
  433. REF(IRMAPacket*) pResendPacket) PURE;
  434. };
  435. #endif  /* _RMAFORMT_H_ */