1 /****************************************************************************
3 * $Id: rmaformt.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * RealMedia Architecture Broadcast Format Plug-in Interfaces.
24 * Forward declarations of some interfaces defined here-in.
26 typedef _INTERFACE IRMAFileFormatObject IRMAFileFormatObject
;
27 typedef _INTERFACE IRMABroadcastFormatObject IRMABroadcastFormatObject
;
28 typedef _INTERFACE IRMAFormatResponse IRMAFormatResponse
;
29 typedef _INTERFACE IRMAFileObject IRMAFileObject
;
30 typedef _INTERFACE IRMANetworkServices IRMANetworkServices
;
31 typedef _INTERFACE IRMAPacket IRMAPacket
;
32 typedef _INTERFACE IRMAValues IRMAValues
;
33 typedef _INTERFACE IRMAPacketTimeOffsetHandler IRMAPacketTimeOffsetHandler
;
34 typedef _INTERFACE IRMAPacketTimeOffsetHandlerResponse
35 IRMAPacketTimeOffsetHandlerResponse
;
36 typedef _INTERFACE IRMALiveFileFormatInfo IRMALiveFileFormatInfo
;
39 /****************************************************************************
43 * IRMAFileFormatObject
47 * Object that allows a Controller to communicate with a specific
48 * File Format plug-in session
50 * IID_IRMAFileFormatObject:
52 * {00000F00-0901-11d1-8B06-00A024406D59}
55 DEFINE_GUID(IID_IRMAFileFormatObject
, 0x00000F00, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
56 0xa0, 0x24, 0x40, 0x6d, 0x59);
59 #define INTERFACE IRMAFileFormatObject
61 DECLARE_INTERFACE_(IRMAFileFormatObject
, IUnknown
)
66 STDMETHOD(QueryInterface
) (THIS_
70 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
72 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
75 * IRMAFileFormatObject methods
78 /************************************************************************
80 * IRMAFileFormatObject::GetFileFormatInfo
82 * Returns information vital to the instantiation of file format
85 STDMETHOD(GetFileFormatInfo
)(THIS_
86 REF(const char**) /*OUT*/ pFileMimeTypes
,
87 REF(const char**) /*OUT*/ pFileExtensions
,
88 REF(const char**) /*OUT*/ pFileOpenNames
91 STDMETHOD(InitFileFormat
)
93 IRMARequest
* /*IN*/ pRequest
,
94 IRMAFormatResponse
* /*IN*/ pFormatResponse
,
95 IRMAFileObject
* /*IN*/ pFileObject
) PURE
;
97 STDMETHOD(GetFileHeader
) (THIS
) PURE
;
99 STDMETHOD(GetStreamHeader
) (THIS_
100 UINT16 unStreamNumber
) PURE
;
102 STDMETHOD(GetPacket
) (THIS_
103 UINT16 unStreamNumber
) PURE
;
105 STDMETHOD(Seek
) (THIS_
106 ULONG32 ulOffset
) PURE
;
108 STDMETHOD(Close
) (THIS
) PURE
;
112 /****************************************************************************
116 * IRMABroadcastFormatObject
120 * Object that allows a Controller to communicate with a specific
121 * Broadcast Format plug-in session
123 * IID_IRMABroadcastFormatObject:
125 * {00000F01-0901-11d1-8B06-00A024406D59}
128 DEFINE_GUID(IID_IRMABroadcastFormatObject
, 0x00000F01, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
129 0xa0, 0x24, 0x40, 0x6d, 0x59);
132 #define INTERFACE IRMABroadcastFormatObject
134 DECLARE_INTERFACE_(IRMABroadcastFormatObject
, IUnknown
)
139 STDMETHOD(QueryInterface
) (THIS_
143 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
145 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
148 * IRMABroadcastFormatObject methods
151 /************************************************************************
153 * IRMABroadcastFormatObject::GetBroadcastFormatInfo
155 * Returns information vital to the instantiation of broadcast format
158 STDMETHOD(GetBroadcastFormatInfo
)(THIS_
159 REF(const char*) /*OUT*/ pToken
) PURE
;
161 STDMETHOD(InitBroadcastFormat
) (THIS_
162 const char* /*IN*/ pURL
,
163 IRMAFormatResponse
* /*IN*/ pFormatResponse
166 STDMETHOD(GetFileHeader
) (THIS
) PURE
;
168 STDMETHOD(GetStreamHeader
) (THIS_
169 UINT16 unStreamNumber
) PURE
;
171 STDMETHOD(StartPackets
) (THIS_
172 UINT16 unStreamNumber
) PURE
;
174 STDMETHOD(StopPackets
) (THIS_
175 UINT16 unStreamNumber
) PURE
;
179 /****************************************************************************
187 * Object that allows a specific File Format Object to communicate
190 * IID_IRMAFormatResponse:
192 * {00000F02-0901-11d1-8B06-00A024406D59}
195 DEFINE_GUID(IID_IRMAFormatResponse
, 0x00000F02, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
196 0xa0, 0x24, 0x40, 0x6d, 0x59);
199 #define INTERFACE IRMAFormatResponse
201 DECLARE_INTERFACE_(IRMAFormatResponse
, IUnknown
)
206 STDMETHOD(QueryInterface
) (THIS_
210 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
212 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
215 * IRMAFormatResponse methods
217 STDMETHOD(InitDone
) (THIS_
218 PN_RESULT status
) PURE
;
220 STDMETHOD(PacketReady
) (THIS_
222 IRMAPacket
* pPacket
) PURE
;
224 STDMETHOD(SeekDone
) (THIS_
225 PN_RESULT status
) PURE
;
227 STDMETHOD(FileHeaderReady
) (THIS_
229 IRMAValues
* pHeader
) PURE
;
231 STDMETHOD(StreamHeaderReady
) (THIS_
233 IRMAValues
* pHeader
) PURE
;
235 STDMETHOD(StreamDone
) (THIS_
236 UINT16 unStreamNumber
) PURE
;
239 /****************************************************************************
247 * Interface that modifies the behavior of an IRMAFileFormat by defining
248 * the packet format it will be creating.
250 * IID_IRMAPacketFormat:
252 * {00000F03-0901-11d1-8B06-00A024406D59}
255 DEFINE_GUID(IID_IRMAPacketFormat
, 0x00000F03, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
256 0xa0, 0x24, 0x40, 0x6d, 0x59);
259 #define INTERFACE IRMAPacketFormat
261 DECLARE_INTERFACE_(IRMAPacketFormat
, IUnknown
)
266 STDMETHOD(QueryInterface
) (THIS_
270 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
272 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
275 * IRMAPacketFormat methods
277 STDMETHOD(GetSupportedPacketFormats
)
279 REF(const char**) pFormats
) PURE
;
281 STDMETHOD(SetPacketFormat
) (THIS_
282 const char* pFormat
) PURE
;
285 /****************************************************************************
289 * IRMAPacketTimeOffsetHandler
293 * Provides methods for handling the changing of a packets timestamp.
295 * IID_IRMAPacketTimeOffsetHandler:
297 * {00000F04-0901-11d1-8B06-00A024406D59}
300 DEFINE_GUID(IID_IRMAPacketTimeOffsetHandler
, 0x00000F04, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
301 0xa0, 0x24, 0x40, 0x6d, 0x59);
304 DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandler
, IUnknown
)
309 STDMETHOD(QueryInterface
) (THIS_
313 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
315 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
318 * IRMAPacketTimeOffsetHandler methods
321 /************************************************************************
323 * IRMAPacketTimeOffsetHandler::Init
325 * Initialize the IRMAPacketTimeOffsetHandler and set the response.
326 * Implementors should look up the MimeType.
328 STDMETHOD(Init
) (THIS_
329 IRMAPacketTimeOffsetHandlerResponse
* pResponse
,
331 IUnknown
* pContext
) PURE
;
333 /************************************************************************
335 * IRMAPacketTimeOffsetHandler::SetTimeOffset
337 * Called to set the time offset. Uses a bool and a UINT32 instead
338 * of and INT32 so that the time offset wraps around after 47 days
339 * instead of 24. bPlus says whether to add or subtract.
341 STDMETHOD(SetTimeOffset
) (THIS_
345 /************************************************************************
347 * IRMAPacketTimeOffsetHandler::HandlePacket
349 * give the IRMAPacketTimeOffsetHandler a packet to modify for the
352 STDMETHOD(HandlePacket
) (THIS_
353 IRMAPacket
* pPacket
) PURE
;
357 /****************************************************************************
361 * IRMAPacketTimeOffsetHandlerResponse
365 * Provides methods for the IRMAPacketTimeOffsetHandler to respond to.
367 * IID_IRMAPacketTimeOffsetHandlerResponse:
369 * {00000F05-0901-11d1-8B06-00A024406D59}
372 DEFINE_GUID(IID_IRMAPacketTimeOffsetHandlerResponse
, 0x00000F05, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
373 0xa0, 0x24, 0x40, 0x6d, 0x59);
376 DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandlerResponse
, IUnknown
)
381 STDMETHOD(QueryInterface
) (THIS_
385 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
387 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
390 * IRMAPacketTimeOffsetHandler methods
393 /************************************************************************
395 * IRMAPacketTimeOffsetHandler::PacketReady
397 * Called by IRMAPacketTimeOffsetHandler to pass back the packet
398 * when it is done with it.
400 STDMETHOD(TimeOffsetPacketReady
) (THIS_
401 IRMAPacket
* pPacket
) PURE
;
405 /****************************************************************************
409 * IRMALiveFileFormatInfo
413 * Provides miscellaneous information needed to transmit a live stream.
414 * Optionally implemented by the file format object.
416 * IID_IRMALiveFileFormatInfo:
418 * {00000F06-0901-11d1-8B06-00A024406D59}
421 DEFINE_GUID(IID_IRMALiveFileFormatInfo
, 0x00000F06, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
422 0xa0, 0x24, 0x40, 0x6d, 0x59);
425 #define INTERFACE IRMALiveFileFormatInfo
427 DECLARE_INTERFACE_(IRMALiveFileFormatInfo
, IUnknown
)
432 STDMETHOD(QueryInterface
) (THIS_
436 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
438 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
441 * IRMALiveFileFormatInfo methods
444 /************************************************************************
446 * IRMALiveFileFormatInfo::VerifyFileCompatibility
448 * Compares two file headers and returns PNR_OK if these two
449 * files can be transmitted sequentially in a single live
452 STDMETHOD(VerifyFileCompatibility
) (THIS_
453 IRMAValues
* pFileHeader1
,
454 IRMAValues
* pFileHeader2
) PURE
;
456 /************************************************************************
458 * IRMALiveFileFormatInfo::VerifyStreamCompatibility
460 * Compares two stream headers and returns PNR_OK if these two
461 * streams can be transmitted sequentially in a single live
464 STDMETHOD(VerifyStreamCompatibility
) (THIS_
465 IRMAValues
* pStreamHeader1
,
466 IRMAValues
* pStreamHeader2
) PURE
;
468 /************************************************************************
470 * IRMALiveFileFormatInfo::IsLiveResendRequired
472 * Returns TRUE if this stream requires the latest packet to be
473 * resent periodically in a live presentation.
475 STDMETHOD_(BOOL
,IsLiveResendRequired
) (THIS_
476 UINT16 unStreamNumber
) PURE
;
478 /************************************************************************
480 * IRMALiveFileFormatInfo::GetResendBitrate
482 * If periodic live resends are required for this stream, this
483 * method returns the rate at which we should resend packets. The
484 * resend rate is measured in bits per second.
486 STDMETHOD(GetResendBitrate
) (THIS_
487 UINT16 unStreamNumber
,
488 REF(UINT32
) ulBitrate
) PURE
;
490 /************************************************************************
492 * IRMALiveFileFormatInfo::GetResendDuration
494 * If periodic live resends are required for this stream, this
495 * method returns the number of milliseconds for which this packet
498 STDMETHOD(GetResendDuration
) (THIS_
500 REF(UINT32
) ulDuration
) PURE
;
502 /************************************************************************
504 * IRMALiveFileFormatInfo::FormResendPacket
506 * Forms a live resend packet based upon the original packet passed
507 * as the first parameter. This allows the file format plugin to
508 * make resend packets distinguishable from original packets.
510 STDMETHOD(FormResendPacket
) (THIS_
511 IRMAPacket
* pOriginalPacket
,
512 REF(IRMAPacket
*) pResendPacket
) PURE
;
518 #endif /* _RMAFORMT_H_ */