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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QTStreamingComponents.h
  3.  
  4.      Contains:   QuickTime Interfaces.
  5.  
  6.      Version:    Technology: QuickTime 6.0
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1990-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QTSTREAMINGCOMPONENTS__
  18. #define __QTSTREAMINGCOMPONENTS__
  19. #ifndef __COMPONENTS__
  20. #include "Components.h"
  21. #endif
  22. #ifndef __MACERRORS__
  23. #include "MacErrors.h"
  24. #endif
  25. #ifndef __MOVIES__
  26. #include "Movies.h"
  27. #endif
  28. #ifndef __QUICKTIMESTREAMING__
  29. #include "QuickTimeStreaming.h"
  30. #endif
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47. /*============================================================================
  48.         Stream Sourcer
  49. ============================================================================*/
  50. enum {
  51.     kQTSSourcerType             = FOUR_CHAR_CODE('srcr')
  52. };
  53. typedef ComponentInstance               QTSSourcer;
  54. enum {
  55.     kQTSSGChannelSourcerType    = FOUR_CHAR_CODE('sgch'),
  56.     kQTSMovieTrackSourcerType   = FOUR_CHAR_CODE('trak'),
  57.     kQTSPushDataSourcerType     = FOUR_CHAR_CODE('push')
  58. };
  59. /* flags for sourcer data */
  60. enum {
  61.     kQTSSourcerDataFlag_SyncSample = 0x00000001,
  62.     kQTSPushDataSourcerFlag_SampleTimeIsValid = (long)0x80000000
  63. };
  64. enum {
  65.     kQTSSourcerInitParamsVersion1 = 1
  66. };
  67. struct QTSSourcerInitParams {
  68.     SInt32                          version;
  69.     SInt32                          flags;
  70.     OSType                          dataType;
  71.     void *                          data;
  72.     UInt32                          dataLength;
  73. };
  74. typedef struct QTSSourcerInitParams     QTSSourcerInitParams;
  75. EXTERN_API_C( OSErr )
  76. QTSNewSourcer                   (void *                 params,
  77.                                  const QTSSourcerInitParams * inInitParams,
  78.                                  SInt32                 inFlags,
  79.                                  ComponentInstance *    outSourcer);
  80. /* info selectors for sourcers - get and set */
  81. enum {
  82.     kQTSInfo_Track              = FOUR_CHAR_CODE('trak'),       /* QTSTrackParams* */
  83.     kQTSInfo_Loop               = FOUR_CHAR_CODE('loop'),       /* QTSLoopParams* */
  84.     kQTSInfo_SourcerTiming      = FOUR_CHAR_CODE('stim'),       /* QTSSourcerTimingParams* */
  85.     kQTSInfo_TargetFrameRate    = FOUR_CHAR_CODE('tfps'),       /* Fixed * in frames per second */
  86.     kQTSInfo_PushData           = FOUR_CHAR_CODE('push'),       /* QTSPushDataParams* */
  87.     kQTSInfo_SourcerCallbackProc = FOUR_CHAR_CODE('scbp'),      /* QTSSourcerCallbackProcParams* */
  88.     kQTSInfo_TargetDataRate     = FOUR_CHAR_CODE('tdrt'),       /* UInt32 * in bytes per second */
  89.     kQTSInfo_AudioAutoGainOnOff = FOUR_CHAR_CODE('agc '),       /* Boolean*  - error if unavailable*/
  90.     kQTSInfo_AudioGain          = FOUR_CHAR_CODE('gain'),       /* Fixed* kFixed1 is unity gain */
  91.     kQTSInfo_CroppedInputRect   = FOUR_CHAR_CODE('crpr'),       /* Rect* - defined relative to kQTSInfo_FullInputRect below */
  92.     kQTSInfo_SpatialSettings    = FOUR_CHAR_CODE('sptl'),       /* pointer to SCSpatialSettings struct*/
  93.     kQTSInfo_TemporalSettings   = FOUR_CHAR_CODE('tprl'),       /* pointer to SCTemporalSettings struct*/
  94.     kQTSInfo_DataRateSettings   = FOUR_CHAR_CODE('drat'),       /* pointer to SCDataRateSettings struct*/
  95.     kQTSInfo_CodecFlags         = FOUR_CHAR_CODE('cflg'),       /* pointer to CodecFlags*/
  96.     kQTSInfo_CodecSettings      = FOUR_CHAR_CODE('cdec'),       /* pointer to Handle*/
  97.     kQTSInfo_ForceKeyValue      = FOUR_CHAR_CODE('ksim'),       /* pointer to long*/
  98.     kQTSInfo_SoundSampleRate    = FOUR_CHAR_CODE('ssrt'),       /* pointer to UnsignedFixed*/
  99.     kQTSInfo_SoundSampleSize    = FOUR_CHAR_CODE('ssss'),       /* pointer to short*/
  100.     kQTSInfo_SoundChannelCount  = FOUR_CHAR_CODE('sscc'),       /* pointer to short*/
  101.     kQTSInfo_SoundCompression   = FOUR_CHAR_CODE('ssct'),       /* pointer to OSType*/
  102.     kQTSInfo_CompressionList    = FOUR_CHAR_CODE('ctyl'),       /* pointer to OSType Handle*/
  103.     kQTSInfo_VideoHue           = FOUR_CHAR_CODE('hue '),       /* UInt16* */
  104.     kQTSInfo_VideoSaturation    = FOUR_CHAR_CODE('satr'),       /* UInt16* */
  105.     kQTSInfo_VideoContrast      = FOUR_CHAR_CODE('trst'),       /* UInt16* */
  106.     kQTSInfo_VideoBrightness    = FOUR_CHAR_CODE('brit'),       /* UInt16* */
  107.     kQTSInfo_VideoSharpness     = FOUR_CHAR_CODE('shrp'),       /* UInt16* */
  108.     kQTSInfo_TimeScale          = FOUR_CHAR_CODE('scal'),       /* UInt32* */
  109.     kQTSInfo_SGChannelDeviceName = FOUR_CHAR_CODE('innm'),      /* Handle* */
  110.     kQTSInfo_SGChannelDeviceList = FOUR_CHAR_CODE('srdl'),      /* SGDeviceList* */
  111.     kQTSInfo_SGChannelDeviceInput = FOUR_CHAR_CODE('sdii'),     /* short* */
  112.     kQTSInfo_SGChannelSettings  = FOUR_CHAR_CODE('sesg'),       /* QTSSGChannelSettingsParams */
  113.     kQTSInfo_PreviewWhileRecordingMode = FOUR_CHAR_CODE('srpr'), /* Boolean* */
  114.     kQTSInfo_CompressionParams  = FOUR_CHAR_CODE('sccp')        /* QTAtomContainer* */
  115. };
  116. /* info selectors for sourcers - get only*/
  117. enum {
  118.     kQTSInfo_SGChannel          = FOUR_CHAR_CODE('sgch'),       /* SGChannel* */
  119.     kQTSInfo_SGChannelInputName = FOUR_CHAR_CODE('srnm'),       /* Handle* */
  120.     kQTSInfo_FullInputRect      = FOUR_CHAR_CODE('fulr')        /* Rect* */
  121. };
  122. /* loop flags */
  123. enum {
  124.     kQTSLoopFlag_Loop           = 0x00000001
  125. };
  126. enum {
  127.     kQTSLoopParamsVersion1      = 1
  128. };
  129. struct QTSLoopParams {
  130.     SInt32                          version;
  131.     SInt32                          flags;
  132.     SInt32                          loopFlags;
  133.     SInt32                          flagsMask;
  134.     SInt32                          numLoops;
  135. };
  136. typedef struct QTSLoopParams            QTSLoopParams;
  137. enum {
  138.     kQTSTrackParamsVersion1     = 1
  139. };
  140. struct QTSTrackParams {
  141.     SInt32                          version;
  142.     SInt32                          flags;
  143.     Track                           track;
  144.     TimeValue64                     trackStartOffset;           /* to start other than at the beginning otherwise set to 0*/
  145.     TimeValue64                     duration;                   /* to limit the duration otherwise set to 0*/
  146.     QTSLoopParams *                 loopParams;                 /* set to NULL if not using; default is no looping */
  147. };
  148. typedef struct QTSTrackParams           QTSTrackParams;
  149. enum {
  150.     kQTSSourcerTimingParamsVersion1 = 1
  151. };
  152. struct QTSSourcerTimingParams {
  153.     SInt32                          version;
  154.     SInt32                          flags;
  155.     TimeScale                       timeScale;
  156.     TimeValue64                     presentationStartTime;
  157.     TimeValue64                     presentationEndTime;
  158.     TimeValue64                     presentationCurrentTime;
  159.     TimeValue64                     localStartTime;
  160.     TimeValue64                     localEndTime;
  161.     TimeValue64                     localCurrentTime;
  162. };
  163. typedef struct QTSSourcerTimingParams   QTSSourcerTimingParams;
  164. enum {
  165.     kQTSPushDataParamsVersion1  = 1
  166. };
  167. enum {
  168.     kQTSPushDataFlag_SampleTimeIsValid = 0x00000001,
  169.     kQTSPushDataFlag_DurationIsValid = 0x00000002
  170. };
  171. struct QTSPushDataParams {
  172.     SInt32                          version;
  173.     SInt32                          flags;
  174.     SampleDescriptionHandle         sampleDescription;          /* caller owns the handle */
  175.     UInt32                          sampleDescSeed;
  176.     TimeValue64                     sampleTime;                 /* also set flag if you set this */
  177.     TimeValue64                     duration;                   /* also set flag if you set this */
  178.     UInt32                          dataLength;
  179.     void *                          dataPtr;                    /* this does not have to be a real macintosh Ptr */
  180. };
  181. typedef struct QTSPushDataParams        QTSPushDataParams;
  182. enum {
  183.     kQTSSourcerCallbackProcParamsVersion1 = 1
  184. };
  185. struct QTSSourcerCallbackProcParams {
  186.     SInt32                          version;
  187.     SInt32                          flags;
  188.     QTSNotificationUPP              proc;
  189.     void *                          refCon;
  190. };
  191. typedef struct QTSSourcerCallbackProcParams QTSSourcerCallbackProcParams;
  192. /* track sourcer callback selectors*/
  193. enum {
  194.     kQTSSourcerCallback_Done    = FOUR_CHAR_CODE('done')        /* QTSSourcerDoneParams* */
  195. };
  196. /* push data sourcer callback selectors*/
  197. enum {
  198.     kQTSPushDataSourcerCallback_HasCharacteristic = 0x050D,     /* QTSPushDataHasCharacteristicParams* */
  199.     kQTSPushDataSourcerCallback_SetInfo = 0x0507,               /* QTSPushDataInfoParams* */
  200.     kQTSPushDataSourcerCallback_GetInfo = 0x0508                /* QTSPushDataInfoParams* */
  201. };
  202. struct QTSPushDataHasCharacteristicParams {
  203.     SInt32                          version;
  204.     SInt32                          flags;
  205.     OSType                          characteristic;
  206.     Boolean                         returnedHasIt;
  207.     char                            reserved1;
  208.     char                            reserved2;
  209.     char                            reserved3;
  210. };
  211. typedef struct QTSPushDataHasCharacteristicParams QTSPushDataHasCharacteristicParams;
  212. struct QTSPushDataInfoParams {
  213.     SInt32                          version;
  214.     SInt32                          flags;
  215.     OSType                          selector;
  216.     void *                          ioParams;
  217. };
  218. typedef struct QTSPushDataInfoParams    QTSPushDataInfoParams;
  219. enum {
  220.     kQTSSourcerDoneParamsVersion1 = 1
  221. };
  222. struct QTSSourcerDoneParams {
  223.     SInt32                          version;
  224.     SInt32                          flags;
  225.     ComponentInstance               sourcer;
  226. };
  227. typedef struct QTSSourcerDoneParams     QTSSourcerDoneParams;
  228. struct QTSSGChannelSettingsParams {
  229.     UserData                        settings;
  230.     SInt32                          flags;
  231. };
  232. typedef struct QTSSGChannelSettingsParams QTSSGChannelSettingsParams;
  233. /*-----------------------------------------
  234.     Stream Sourcer Selectors
  235. -----------------------------------------*/
  236. enum {
  237.     kQTSSourcerInitializeSelect = 0x0500,
  238.     kQTSSourcerSetEnableSelect  = 0x0503,
  239.     kQTSSourcerGetEnableSelect  = 0x0504,
  240.     kQTSSourcerSetInfoSelect    = 0x0507,
  241.     kQTSSourcerGetInfoSelect    = 0x0508,
  242.     kQTSSourcerSetTimeScaleSelect = 0x050E,
  243.     kQTSSourcerGetTimeScaleSelect = 0x050F,
  244.     kQTSSourcerIdleSelect       = 0x0516
  245. };
  246. /*-----------------------------------------
  247.     Stream Sourcer Prototypes
  248. -----------------------------------------*/
  249. EXTERN_API( ComponentResult )
  250. QTSSourcerInitialize            (QTSSourcer             inSourcer,
  251.                                  const QTSSourcerInitParams * inInitParams)                 FIVEWORDINLINE(0x2F3C, 0x0004, 0x0500, 0x7000, 0xA82A);
  252. EXTERN_API( ComponentResult )
  253. QTSSourcerIdle                  (QTSSourcer             inSourcer,
  254.                                  const TimeValue64 *    inTime,
  255.                                  SInt32                 inFlags,
  256.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x000C, 0x0516, 0x7000, 0xA82A);
  257. EXTERN_API( ComponentResult )
  258. QTSSourcerSetEnable             (QTSSourcer             inSourcer,
  259.                                  Boolean                inEnableMode,
  260.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0503, 0x7000, 0xA82A);
  261. EXTERN_API( ComponentResult )
  262. QTSSourcerGetEnable             (QTSSourcer             inSourcer,
  263.                                  Boolean *              outEnableMode,
  264.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0504, 0x7000, 0xA82A);
  265. EXTERN_API( ComponentResult )
  266. QTSSourcerSetTimeScale          (QTSSourcer             inSourcer,
  267.                                  TimeScale              inTimeScale)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x050E, 0x7000, 0xA82A);
  268. EXTERN_API( ComponentResult )
  269. QTSSourcerGetTimeScale          (QTSSourcer             inSourcer,
  270.                                  TimeScale *            outTimeScale)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x050F, 0x7000, 0xA82A);
  271. EXTERN_API( ComponentResult )
  272. QTSSourcerSetInfo               (QTSSourcer             inSourcer,
  273.                                  OSType                 inSelector,
  274.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0507, 0x7000, 0xA82A);
  275. EXTERN_API( ComponentResult )
  276. QTSSourcerGetInfo               (QTSSourcer             inSourcer,
  277.                                  OSType                 inSelector,
  278.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0508, 0x7000, 0xA82A);
  279. enum {
  280.     kQTSInfo_InputDeviceName    = FOUR_CHAR_CODE('innm'),       /* Handle* */
  281.     kQTSInfo_InputSourceName    = FOUR_CHAR_CODE('srnm')        /* Handle* */
  282. };
  283. /*============================================================================
  284.         Stream Handler
  285. ============================================================================*/
  286. /*
  287.     Server edits are only valid for the current chunk
  288. */
  289. struct SHServerEditParameters {
  290.     UInt32                          version;
  291.     Fixed                           editRate;
  292.     TimeValue64                     dataStartTime_mediaAxis;
  293.     TimeValue64                     dataEndTime_mediaAxis;
  294. };
  295. typedef struct SHServerEditParameters   SHServerEditParameters;
  296. enum {
  297.     kSHNoChunkDispatchFlags     = 0,
  298.     kSHChunkFlagSyncSample      = 1 << 2,
  299.     kSHChunkFlagDataLoss        = 1 << 4,
  300.     kSHChunkFlagExtended        = 1 << 5
  301. };
  302. struct SHChunkRecord {
  303.     UInt32                          version;
  304.     long                            reserved1;
  305.     SInt32                          flags;
  306.     UInt32                          dataSize;
  307.     UInt8 *                         dataPtr;
  308.     long                            reserved2;
  309.     long                            reserved3;
  310.     TimeValue64                     presentationTime;
  311.     long                            reserved4;
  312.     long                            reserved5;
  313.     const SHServerEditParameters *  serverEditParameters;
  314.     long                            reserved6;
  315.     long                            reserved7;
  316. };
  317. typedef struct SHChunkRecord            SHChunkRecord;
  318. enum {
  319.     kSHNumExtendedDataLongs     = 10
  320. };
  321. enum {
  322.     kSHExtendedChunkFlag_HasSampleCount = 1 << 0,
  323.     kSHExtendedChunkFlag_HasFrameLengths = 1 << 1
  324. };
  325. struct SHExtendedChunkRecord {
  326.     SHChunkRecord                   chunk;
  327.     SInt32                          extendedFlags;
  328.     SInt32                          extendedData[10];
  329. };
  330. typedef struct SHExtendedChunkRecord    SHExtendedChunkRecord;
  331. /*============================================================================
  332.         RTP Components
  333. ============================================================================*/
  334. typedef UInt32                          RTPSSRC;
  335. enum {
  336.     kRTPInvalidSSRC             = 0
  337. };
  338. /* RTP standard content encodings for audio */
  339. enum {
  340.     kRTPPayload_PCMU            = 0,                            /* 8kHz PCM mu-law mono */
  341.     kRTPPayload_1016            = 1,                            /* 8kHz CELP (Fed Std 1016) mono */
  342.     kRTPPayload_G721            = 2,                            /* 8kHz G.721 ADPCM mono */
  343.     kRTPPayload_GSM             = 3,                            /* 8kHz GSM mono */
  344.     kRTPPayload_G723            = 4,                            /* 8kHz G.723 ADPCM mono */
  345.     kRTPPayload_DVI_8           = 5,                            /* 8kHz Intel DVI ADPCM mono */
  346.     kRTPPayload_DVI_16          = 6,                            /* 16kHz Intel DVI ADPCM mono */
  347.     kRTPPayload_LPC             = 7,                            /* 8kHz LPC */
  348.     kRTPPayload_PCMA            = 8,                            /* 8kHz PCM a-law mono */
  349.     kRTPPayload_L16_44_2        = 10,                           /* 44.1kHz 16-bit linear stereo */
  350.     kRTPPayload_L16_44_1        = 11,                           /* 44.1kHz 16-bit linear mono */
  351.     kRTPPayload_PureVoice       = 12,                           /* 8kHz PureVoice mono (QCELP) */
  352.     kRTPPayload_MPEGAUDIO       = 14,                           /* MPEG I and II audio */
  353.     kRTPPayload_DVI_11          = 16,                           /* 11kHz Intel DVI ADPCM mono */
  354.     kRTPPayload_DVI_22          = 17                            /* 22kHz Intel DVI ADPCM mono */
  355. };
  356. /* RTP standard content encodings for video */
  357. enum {
  358.     kRTPPayload_CELLB           = 25,                           /* Sun CellB */
  359.     kRTPPayload_JPEG            = 26,                           /* JPEG */
  360.     kRTPPayload_CUSEEME         = 27,                           /* Cornell CU-SeeMe */
  361.     kRTPPayload_NV              = 28,                           /* Xerox PARC nv */
  362.     kRTPPayload_PICWIN          = 29,                           /* BBN Picture Window */
  363.     kRTPPayload_CPV             = 30,                           /* Bolter CPV */
  364.     kRTPPayload_H261            = 31,                           /* CCITT H.261 */
  365.     kRTPPayload_MPEGVIDEO       = 32,                           /* MPEG I and II video */
  366.     kRTPPayload_H263            = 34                            /* CCITT H.263 */
  367. };
  368. /* Other RTP standard content encodings */
  369. enum {
  370.     kRTPPayload_MPEG2T          = 33                            /* MPEG 2 Transport */
  371. };
  372. /* Dynamic encodings */
  373. enum {
  374.     kRTPPayload_FirstDynamic    = 96,
  375.     kRTPPayload_LastDynamic     = 127,
  376.     kRTPPayload_Unknown         = 0xFF
  377. };
  378. /*
  379. -----------------------------------------
  380.     RTP Info selectors
  381. -----------------------------------------
  382. */
  383. /* ----- these are get and set ----- */
  384. enum {
  385.     kRTPInfo_SSRC               = FOUR_CHAR_CODE('ssrc'),       /* UInt32* */
  386.     kRTPInfo_NextSeqNum         = FOUR_CHAR_CODE('rnsn')        /* UInt16* */
  387. };
  388. /*-----------------------------------------
  389.     RTP Statistics
  390. -----------------------------------------*/
  391. enum {
  392.     kRTPTotalReceivedPktsStat   = FOUR_CHAR_CODE('trcp'),
  393.     kRTPTotalLostPktsStat       = FOUR_CHAR_CODE('tlsp'),
  394.     kRTPTotalProcessedPktsStat  = FOUR_CHAR_CODE('tprp'),
  395.     kRTPTotalDroppedPktsStat    = FOUR_CHAR_CODE('tdrp'),
  396.     kRTPBadHeaderDroppedPktsStat = FOUR_CHAR_CODE('bhdp'),
  397.     kRTPOurHeaderDroppedPktsStat = FOUR_CHAR_CODE('ohdp'),
  398.     kRTPNotReceivingSenderDroppedPktsStat = FOUR_CHAR_CODE('nsdp'),
  399.     kRTPNotProcessingDroppedPktsStat = FOUR_CHAR_CODE('npdp'),
  400.     kRTPBadSeqDroppedPktsStat   = FOUR_CHAR_CODE('bsdp'),
  401.     kRTPArriveTooLatePktsStat   = FOUR_CHAR_CODE('artl'),
  402.     kRTPWaitForSeqDroppedPktsStat = FOUR_CHAR_CODE('wsdp'),
  403.     kRTPBadStateDroppedPktsStat = FOUR_CHAR_CODE('stdp'),
  404.     kRTPBadPayloadDroppedPktsStat = FOUR_CHAR_CODE('bpdp'),
  405.     kRTPNoTimeScaleDroppedPktsStat = FOUR_CHAR_CODE('ntdp'),
  406.     kRTPDupSeqNumDroppedPktsStat = FOUR_CHAR_CODE('dsdp'),
  407.     kRTPLostPktsPercentStat     = FOUR_CHAR_CODE('lspp'),
  408.     kRTPDroppedPktsPercentStat  = FOUR_CHAR_CODE('dppp'),
  409.     kRTPTotalUnprocessedPktsPercentStat = FOUR_CHAR_CODE('tupp'),
  410.     kRTPRTCPDataRateStat        = FOUR_CHAR_CODE('rrcd'),
  411.     kRTPPayloadIDStat           = FOUR_CHAR_CODE('rpid'),
  412.     kRTPPayloadNameStat         = FOUR_CHAR_CODE('rpnm'),
  413.     kRTPNumPktsInQueueStat      = FOUR_CHAR_CODE('rnpq'),
  414.     kRTPTotalPktsInQueueStat    = FOUR_CHAR_CODE('rtpq'),
  415.     kRTPTotalOutOfOrderPktsStat = FOUR_CHAR_CODE('rtoo'),
  416.     kRTPRetransmissionStat      = FOUR_CHAR_CODE('rrtx')
  417. };
  418. /*-----------------------------------------
  419.     Payload Info
  420. -----------------------------------------*/
  421. enum {
  422.     kRTPPayloadSpeedTag         = FOUR_CHAR_CODE('sped'),       /* 0-255, 255 is fastest*/
  423.     kRTPPayloadLossRecoveryTag  = FOUR_CHAR_CODE('loss'),       /* 0-255, 0 can't handle any loss, 128 can handle 50% packet loss*/
  424.     kRTPPayloadConformanceTag   = FOUR_CHAR_CODE('conf')        /* more than one of these can be present*/
  425. };
  426. struct RTPPayloadCharacteristic {
  427.     OSType                          tag;
  428.     long                            value;
  429. };
  430. typedef struct RTPPayloadCharacteristic RTPPayloadCharacteristic;
  431. /*
  432.     pass RTPPayloadSortRequest to QTSFindMediaPacketizer or QTSFindMediaPacketizerForTrack.
  433.     define the characteristics to sort by. tag is key to sort on. value is positive for ascending
  434.     sort (low value first), negative for descending sort (high value first).
  435. */
  436. struct RTPPayloadSortRequest {
  437.     long                            characteristicCount;
  438.     RTPPayloadCharacteristic        characteristic[1];          /* tag is key to sort on, value is + for ascending, - for descending*/
  439. };
  440. typedef struct RTPPayloadSortRequest    RTPPayloadSortRequest;
  441. typedef RTPPayloadSortRequest *         RTPPayloadSortRequestPtr;
  442. /* flags for RTPPayloadInfo */
  443. enum {
  444.     kRTPPayloadTypeStaticFlag   = 0x00000001,
  445.     kRTPPayloadTypeDynamicFlag  = 0x00000002
  446. };
  447. struct RTPPayloadInfo {
  448.     long                            payloadFlags;
  449.     UInt8                           payloadID;
  450.     char                            reserved1;
  451.     char                            reserved2;
  452.     char                            reserved3;
  453.     char                            payloadName[1];
  454. };
  455. typedef struct RTPPayloadInfo           RTPPayloadInfo;
  456. typedef RTPPayloadInfo *                RTPPayloadInfoPtr;
  457. typedef RTPPayloadInfoPtr *             RTPPayloadInfoHandle;
  458. /*============================================================================
  459.         RTP Reassembler
  460. ============================================================================*/
  461. typedef ComponentInstance               RTPReassembler;
  462. enum {
  463.     kRTPReassemblerType         = FOUR_CHAR_CODE('rtpr')
  464. };
  465. enum {
  466.     kRTPBaseReassemblerType     = FOUR_CHAR_CODE('gnrc'),
  467.     kRTP261ReassemblerType      = FOUR_CHAR_CODE('h261'),
  468.     kRTP263ReassemblerType      = FOUR_CHAR_CODE('h263'),
  469.     kRTP263PlusReassemblerType  = FOUR_CHAR_CODE('263+'),
  470.     kRTPAudioReassemblerType    = FOUR_CHAR_CODE('soun'),
  471.     kRTPQTReassemblerType       = FOUR_CHAR_CODE('qtim'),
  472.     kRTPPureVoiceReassemblerType = FOUR_CHAR_CODE('Qclp'),
  473.     kRTPJPEGReassemblerType     = FOUR_CHAR_CODE('jpeg'),
  474.     kRTPQDesign2ReassemblerType = FOUR_CHAR_CODE('QDM2'),
  475.     kRTPSorensonReassemblerType = FOUR_CHAR_CODE('SVQ1'),
  476.     kRTPMP3ReassemblerType      = FOUR_CHAR_CODE('mp3 '),
  477.     kRTPMPEG4AudioReassemblerType = FOUR_CHAR_CODE('mp4a'),
  478.     kRTPMPEG4VideoReassemblerType = FOUR_CHAR_CODE('mp4v')
  479. };
  480. struct RTPRssmInitParams {
  481.     RTPSSRC                         ssrc;
  482.     UInt8                           payloadType;
  483.     UInt8                           reserved1;
  484.     UInt8                           reserved2;
  485.     UInt8                           reserved3;
  486.     TimeBase                        timeBase;
  487.     TimeScale                       timeScale;
  488. };
  489. typedef struct RTPRssmInitParams        RTPRssmInitParams;
  490. struct RTPDescParams {
  491.     QTAtomContainer                 container;
  492.     QTAtom                          presentationParentAtom;
  493.     QTAtom                          streamParentAtom;
  494. };
  495. typedef struct RTPDescParams            RTPDescParams;
  496. struct RTPRssmMoreInitParams {
  497.     RTPRssmInitParams               initParams;
  498.     SInt32                          version;
  499.     RTPDescParams                   desc;
  500. };
  501. typedef struct RTPRssmMoreInitParams    RTPRssmMoreInitParams;
  502. enum {
  503.     kRTPRssmMoreInitParamsVersion1 = 1
  504. };
  505. /* get/set info selectors*/
  506. enum {
  507.     kRTPRssmInfo_MoreInitParams = FOUR_CHAR_CODE('rrmi')
  508. };
  509. struct RTPRssmPacket {
  510.     struct RTPRssmPacket *          next;
  511.     struct RTPRssmPacket *          prev;
  512.     QTSStreamBuffer *               streamBuffer;
  513.     Boolean                         paramsFilledIn;
  514.     UInt8                           reserved;
  515.     UInt16                          sequenceNum;
  516.     UInt32                          transportHeaderLength;      /* filled in by base*/
  517.     UInt32                          payloadHeaderLength;        /* derived adjusts this */
  518.     UInt32                          dataLength;
  519.     SHServerEditParameters          serverEditParams;
  520.     TimeValue64                     timeStamp;                  /* lower 32 bits is original rtp timestamp*/
  521.     SInt32                          chunkFlags;                 /* these are or'd together*/
  522.     SInt32                          flags;
  523. };
  524. typedef struct RTPRssmPacket            RTPRssmPacket;
  525. /* flags for RTPRssmPacket struct*/
  526. enum {
  527.     kRTPRssmPacketHasMarkerBitSet = 0x00000001,
  528.     kRTPRssmPacketHasServerEditFlag = 0x00010000
  529. };
  530. /* flags for RTPRssmSendStreamBufferRange*/
  531. enum {
  532.     kRTPRssmCanRefStreamBuffer  = 0x00000001
  533. };
  534. /* flags for RTPRssmSendPacketList*/
  535. enum {
  536.     kRTPRssmLostSomePackets     = 0x00000001
  537. };
  538. /* flags for RTPRssmSetFlags*/
  539. enum {
  540.     kRTPRssmEveryPacketAChunkFlag = 0x00000001,
  541.     kRTPRssmQueueAndUseMarkerBitFlag = 0x00000002,
  542.     kRTPRssmTrackLostPacketsFlag = 0x00010000,
  543.     kRTPRssmNoReorderingRequiredFlag = 0x00020000
  544. };
  545. struct RTPSendStreamBufferRangeParams {
  546.     QTSStreamBuffer *               streamBuffer;
  547.     TimeValue64                     presentationTime;
  548.     UInt32                          chunkStartPosition;
  549.     UInt32                          numDataBytes;
  550.     SInt32                          chunkFlags;
  551.     SInt32                          flags;
  552.     const SHServerEditParameters *  serverEditParams;           /* NULL if no edit*/
  553. };
  554. typedef struct RTPSendStreamBufferRangeParams RTPSendStreamBufferRangeParams;
  555. /* characteristics*/
  556. enum {
  557.     kRTPCharacteristic_RequiresOrderedPackets = FOUR_CHAR_CODE('rrop'),
  558.     kRTPCharacteristic_TimeStampsNotMonoIncreasing = FOUR_CHAR_CODE('tsmi')
  559. };
  560. enum {
  561.     kRTPReassemblerInfoResType  = FOUR_CHAR_CODE('rsmi')
  562. };
  563. struct RTPReassemblerInfo {
  564.     long                            characteristicCount;
  565.     RTPPayloadCharacteristic        characteristic[1];
  566.                                                                 /* after the last characteristic, the payload name (defined by the MediaPacketizerPayloadInfo*/
  567.                                                                 /* structure) is present. */
  568. };
  569. typedef struct RTPReassemblerInfo       RTPReassemblerInfo;
  570. typedef RTPReassemblerInfo *            RTPReassemblerInfoPtr;
  571. typedef RTPReassemblerInfoPtr *         RTPReassemblerInfoHandle;
  572. #define RTPReassemblerInfoToPayloadInfo(_rsmi) ((RTPPayloadInfoPtr)(&((_rsmi)->characteristic[(_rsmi)->characteristicCount])))
  573. /* RTPReassemblerInfoElement structs are padded to 32 bits */
  574. enum {
  575.     kRTPReassemblerInfoPadUpToBytes = 4
  576. };
  577. EXTERN_API_C( OSErr )
  578. QTSFindReassemblerForPayloadID  (UInt8                  inPayloadID,
  579.                                  RTPPayloadSortRequest * inSortInfo,
  580.                                  QTAtomContainer *      outReassemblerList);
  581. EXTERN_API_C( OSErr )
  582. QTSFindReassemblerForPayloadName (const char *          inPayloadName,
  583.                                  RTPPayloadSortRequest * inSortInfo,
  584.                                  QTAtomContainer *      outReassemblerList);
  585. /*-----------------------------------------
  586.     RTP Reassembler Selectors
  587. -----------------------------------------*/
  588. enum {
  589.     kRTPRssmSetCapabilitiesSelect = 0x0100,
  590.     kRTPRssmGetCapabilitiesSelect = 0x0101,
  591.     kRTPRssmSetPayloadHeaderLengthSelect = 0x0102,
  592.     kRTPRssmGetPayloadHeaderLengthSelect = 0x0103,
  593.     kRTPRssmSetTimeScaleSelect  = 0x0104,
  594.     kRTPRssmGetTimeScaleSelect  = 0x0105,
  595.     kRTPRssmNewStreamHandlerSelect = 0x0106,
  596.     kRTPRssmSetStreamHandlerSelect = 0x0107,
  597.     kRTPRssmGetStreamHandlerSelect = 0x0108,
  598.     kRTPRssmSendStreamHandlerChangedSelect = 0x0109,
  599.     kRTPRssmSetSampleDescriptionSelect = 0x010A,
  600.     kRTPRssmGetChunkAndIncrRefCountSelect = 0x010D,
  601.     kRTPRssmSendChunkAndDecrRefCountSelect = 0x010E,
  602.     kRTPRssmSendLostChunkSelect = 0x010F,
  603.     kRTPRssmSendStreamBufferRangeSelect = 0x0110,
  604.     kRTPRssmClearCachedPackets  = 0x0111,
  605.     kRTPRssmFillPacketListParamsSelect = 0x0113,
  606.     kRTPRssmReleasePacketListSelect = 0x0114,
  607.     kRTPRssmIncrChunkRefCountSelect = 0x0115,
  608.     kRTPRssmDecrChunkRefCountSelect = 0x0116,
  609.     kRTPRssmGetExtChunkAndIncrRefCountSelect = 0x0117,
  610.     kRTPRssmInitializeSelect    = 0x0500,
  611.     kRTPRssmHandleNewPacketSelect = 0x0501,
  612.     kRTPRssmComputeChunkSizeSelect = 0x0502,
  613.     kRTPRssmAdjustPacketParamsSelect = 0x0503,
  614.     kRTPRssmCopyDataToChunkSelect = 0x0504,
  615.     kRTPRssmSendPacketListSelect = 0x0505,
  616.     kRTPRssmGetTimeScaleFromPacketSelect = 0x0506,
  617.     kRTPRssmSetInfoSelect       = 0x0509,
  618.     kRTPRssmGetInfoSelect       = 0x050A,
  619.     kRTPRssmHasCharacteristicSelect = 0x050B,
  620.     kRTPRssmResetSelect         = 0x050C
  621. };
  622. /*-----------------------------------------
  623.     RTP Reassembler functions - base to derived
  624. -----------------------------------------*/
  625. EXTERN_API( ComponentResult )
  626. RTPRssmInitialize               (RTPReassembler         rtpr,
  627.                                  RTPRssmInitParams *    inInitParams)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x0500, 0x7000, 0xA82A);
  628. EXTERN_API( ComponentResult )
  629. RTPRssmHandleNewPacket          (RTPReassembler         rtpr,
  630.                                  QTSStreamBuffer *      inStreamBuffer,
  631.                                  SInt32                 inNumWraparounds)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x0501, 0x7000, 0xA82A);
  632. EXTERN_API( ComponentResult )
  633. RTPRssmComputeChunkSize         (RTPReassembler         rtpr,
  634.                                  RTPRssmPacket *        inPacketListHead,
  635.                                  SInt32                 inFlags,
  636.                                  UInt32 *               outChunkDataSize)                   FIVEWORDINLINE(0x2F3C, 0x000C, 0x0502, 0x7000, 0xA82A);
  637. EXTERN_API( ComponentResult )
  638. RTPRssmAdjustPacketParams       (RTPReassembler         rtpr,
  639.                                  RTPRssmPacket *        inPacket,
  640.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0503, 0x7000, 0xA82A);
  641. EXTERN_API( ComponentResult )
  642. RTPRssmCopyDataToChunk          (RTPReassembler         rtpr,
  643.                                  RTPRssmPacket *        inPacketListHead,
  644.                                  UInt32                 inMaxChunkDataSize,
  645.                                  SHChunkRecord *        inChunk,
  646.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0504, 0x7000, 0xA82A);
  647. EXTERN_API( ComponentResult )
  648. RTPRssmSendPacketList           (RTPReassembler         rtpr,
  649.                                  RTPRssmPacket *        inPacketListHead,
  650.                                  const TimeValue64 *    inLastChunkPresentationTime,
  651.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0505, 0x7000, 0xA82A);
  652. EXTERN_API( ComponentResult )
  653. RTPRssmGetTimeScaleFromPacket   (RTPReassembler         rtpr,
  654.                                  QTSStreamBuffer *      inStreamBuffer,
  655.                                  TimeScale *            outTimeScale)                       FIVEWORDINLINE(0x2F3C, 0x0008, 0x0506, 0x7000, 0xA82A);
  656. EXTERN_API( ComponentResult )
  657. RTPRssmSetInfo                  (RTPReassembler         rtpr,
  658.                                  OSType                 inSelector,
  659.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0509, 0x7000, 0xA82A);
  660. EXTERN_API( ComponentResult )
  661. RTPRssmGetInfo                  (RTPReassembler         rtpr,
  662.                                  OSType                 inSelector,
  663.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050A, 0x7000, 0xA82A);
  664. EXTERN_API( ComponentResult )
  665. RTPRssmHasCharacteristic        (RTPReassembler         rtpr,
  666.                                  OSType                 inCharacteristic,
  667.                                  Boolean *              outHasIt)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050B, 0x7000, 0xA82A);
  668. EXTERN_API( ComponentResult )
  669. RTPRssmReset                    (RTPReassembler         rtpr,
  670.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x050C, 0x7000, 0xA82A);
  671. /*-----------------------------------------
  672.     RTP Reassembler functions - derived to base
  673. -----------------------------------------*/
  674. /* ----- setup*/
  675. EXTERN_API( ComponentResult )
  676. RTPRssmSetCapabilities          (RTPReassembler         rtpr,
  677.                                  SInt32                 inFlags,
  678.                                  SInt32                 inFlagsMask)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0100, 0x7000, 0xA82A);
  679. EXTERN_API( ComponentResult )
  680. RTPRssmGetCapabilities          (RTPReassembler         rtpr,
  681.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  682. EXTERN_API( ComponentResult )
  683. RTPRssmSetPayloadHeaderLength   (RTPReassembler         rtpr,
  684.                                  UInt32                 inPayloadHeaderLength)              FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  685. EXTERN_API( ComponentResult )
  686. RTPRssmGetPayloadHeaderLength   (RTPReassembler         rtpr,
  687.                                  UInt32 *               outPayloadHeaderLength)             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  688. EXTERN_API( ComponentResult )
  689. RTPRssmSetTimeScale             (RTPReassembler         rtpr,
  690.                                  TimeScale              inSHTimeScale)                      FIVEWORDINLINE(0x2F3C, 0x0004, 0x0104, 0x7000, 0xA82A);
  691. EXTERN_API( ComponentResult )
  692. RTPRssmGetTimeScale             (RTPReassembler         rtpr,
  693.                                  TimeScale *            outSHTimeScale)                     FIVEWORDINLINE(0x2F3C, 0x0004, 0x0105, 0x7000, 0xA82A);
  694. EXTERN_API( ComponentResult )
  695. RTPRssmNewStreamHandler         (RTPReassembler         rtpr,
  696.                                  OSType                 inSHType,
  697.                                  SampleDescriptionHandle  inSampleDescription,
  698.                                  TimeScale              inSHTimeScale,
  699.                                  ComponentInstance *    outHandler)                         FIVEWORDINLINE(0x2F3C, 0x0010, 0x0106, 0x7000, 0xA82A);
  700. EXTERN_API( ComponentResult )
  701. RTPRssmSetStreamHandler         (RTPReassembler         rtpr,
  702.                                  ComponentInstance      inStreamHandler)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0107, 0x7000, 0xA82A);
  703. EXTERN_API( ComponentResult )
  704. RTPRssmGetStreamHandler         (RTPReassembler         rtpr,
  705.                                  ComponentInstance *    outStreamHandler)                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0108, 0x7000, 0xA82A);
  706. EXTERN_API( ComponentResult )
  707. RTPRssmSendStreamHandlerChanged (RTPReassembler         rtpr)                               FIVEWORDINLINE(0x2F3C, 0x0000, 0x0109, 0x7000, 0xA82A);
  708. EXTERN_API( ComponentResult )
  709. RTPRssmSetSampleDescription     (RTPReassembler         rtpr,
  710.                                  SampleDescriptionHandle  inSampleDescription)              FIVEWORDINLINE(0x2F3C, 0x0004, 0x010A, 0x7000, 0xA82A);
  711. /* ----- manually sending chunks*/
  712. EXTERN_API( ComponentResult )
  713. RTPRssmGetChunkAndIncrRefCount  (RTPReassembler         rtpr,
  714.                                  UInt32                 inChunkDataSize,
  715.                                  const TimeValue64 *    inChunkPresentationTime,
  716.                                  SHChunkRecord **       outChunk)                           FIVEWORDINLINE(0x2F3C, 0x000C, 0x010D, 0x7000, 0xA82A);
  717. EXTERN_API( ComponentResult )
  718. RTPRssmGetExtChunkAndIncrRefCount (RTPReassembler       rtpr,
  719.                                  UInt32                 inChunkDataSize,
  720.                                  const TimeValue64 *    inChunkPresentationTime,
  721.                                  SInt32                 inFlags,
  722.                                  SHExtendedChunkRecord ** outChunk)                         FIVEWORDINLINE(0x2F3C, 0x0010, 0x0117, 0x7000, 0xA82A);
  723. EXTERN_API( ComponentResult )
  724. RTPRssmSendChunkAndDecrRefCount (RTPReassembler         rtpr,
  725.                                  SHChunkRecord *        inChunk,
  726.                                  const SHServerEditParameters * inServerEdit)               FIVEWORDINLINE(0x2F3C, 0x0008, 0x010E, 0x7000, 0xA82A);
  727. EXTERN_API( ComponentResult )
  728. RTPRssmSendLostChunk            (RTPReassembler         rtpr,
  729.                                  const TimeValue64 *    inChunkPresentationTime)            FIVEWORDINLINE(0x2F3C, 0x0004, 0x010F, 0x7000, 0xA82A);
  730. EXTERN_API( ComponentResult )
  731. RTPRssmSendStreamBufferRange    (RTPReassembler         rtpr,
  732.                                  RTPSendStreamBufferRangeParams * inParams)                 FIVEWORDINLINE(0x2F3C, 0x0004, 0x0110, 0x7000, 0xA82A);
  733. EXTERN_API( ComponentResult )
  734. RTPRssmClearCachedPackets       (RTPReassembler         rtpr,
  735.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0111, 0x7000, 0xA82A);
  736. EXTERN_API( ComponentResult )
  737. RTPRssmFillPacketListParams     (RTPReassembler         rtpr,
  738.                                  RTPRssmPacket *        inPacketListHead,
  739.                                  SInt32                 inNumWraparounds,
  740.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0113, 0x7000, 0xA82A);
  741. EXTERN_API( ComponentResult )
  742. RTPRssmReleasePacketList        (RTPReassembler         rtpr,
  743.                                  RTPRssmPacket *        inPacketListHead)                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0114, 0x7000, 0xA82A);
  744. EXTERN_API( ComponentResult )
  745. RTPRssmIncrChunkRefCount        (RTPReassembler         rtpr,
  746.                                  SHChunkRecord *        inChunk)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0115, 0x7000, 0xA82A);
  747. EXTERN_API( ComponentResult )
  748. RTPRssmDecrChunkRefCount        (RTPReassembler         rtpr,
  749.                                  SHChunkRecord *        inChunk)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0116, 0x7000, 0xA82A);
  750. /*============================================================================
  751.         RTP Media Packetizer
  752. ============================================================================*/
  753. enum {
  754.     kRTPMediaPacketizerType     = FOUR_CHAR_CODE('rtpm')
  755. };
  756. typedef ComponentInstance               RTPMediaPacketizer;
  757. enum {
  758.     kRTPBaseMediaPacketizerType = FOUR_CHAR_CODE('gnrc'),
  759.     kRTP261MediaPacketizerType  = FOUR_CHAR_CODE('h261'),
  760.     kRTP263PlusMediaPacketizerType = FOUR_CHAR_CODE('263+'),
  761.     kRTPAudioMediaPacketizerType = FOUR_CHAR_CODE('soun'),
  762.     kRTPQTMediaPacketizerType   = FOUR_CHAR_CODE('qtim'),
  763.     kRTPPureVoiceMediaPacketizerType = FOUR_CHAR_CODE('Qclp'),
  764.     kRTPJPEGMediaPacketizerType = FOUR_CHAR_CODE('jpeg'),
  765.     kRTPQDesign2MediaPacketizerType = FOUR_CHAR_CODE('QDM2'),
  766.     kRTPSorensonMediaPacketizerType = FOUR_CHAR_CODE('SVQ1'),
  767.     kRTPMP3MediaPacketizerType  = FOUR_CHAR_CODE('mp3 '),
  768.     kRTPMPEG4AudioMediaPacketizerType = FOUR_CHAR_CODE('mp4a'),
  769.     kRTPMPEG4VideoMediaPacketizerType = FOUR_CHAR_CODE('mp4v')
  770. };
  771. typedef UInt32                          RTPMPSampleRef;
  772. typedef CALLBACK_API( void , RTPMPDataReleaseProcPtr )(UInt8 *inData, void *inRefCon);
  773. typedef STACK_UPP_TYPE(RTPMPDataReleaseProcPtr)                 RTPMPDataReleaseUPP;
  774. enum {
  775.     kMediaPacketizerCanPackEditRate = 1 << 0,
  776.     kMediaPacketizerCanPackLayer = 1 << 1,
  777.     kMediaPacketizerCanPackVolume = 1 << 2,
  778.     kMediaPacketizerCanPackBalance = 1 << 3,
  779.     kMediaPacketizerCanPackGraphicsMode = 1 << 4,
  780.     kMediaPacketizerCanPackEmptyEdit = 1 << 5
  781. };
  782. struct MediaPacketizerRequirements {
  783.     OSType                          mediaType;                  /* media type supported (0 for all)*/
  784.     OSType                          dataFormat;                 /* data format (e.g., compression) supported (0 for all)*/
  785.     UInt32                          capabilityFlags;            /* ability to handle non-standard track characteristics*/
  786.     UInt8                           canPackMatrixType;          /* can pack any matrix type up to this (identityMatrixType for identity only)*/
  787.     UInt8                           reserved1;
  788.     UInt8                           reserved2;
  789.     UInt8                           reserved3;
  790. };
  791. typedef struct MediaPacketizerRequirements MediaPacketizerRequirements;
  792. typedef MediaPacketizerRequirements *   MediaPacketizerRequirementsPtr;
  793. struct MediaPacketizerInfo {
  794.     OSType                          mediaType;                  /* media type supported (0 for all)*/
  795.     OSType                          dataFormat;                 /* data format (e.g., compression) supported (0 for all)*/
  796.     OSType                          vendor;                     /* manufacturer of this packetizer (e.g., 'appl' for Apple)*/
  797.     UInt32                          capabilityFlags;            /* ability to handle non-standard track characteristics*/
  798.     UInt8                           canPackMatrixType;          /* can pack any matrix type up to this (identityMatrixType for identity only)*/
  799.     UInt8                           reserved1;
  800.     UInt8                           reserved2;
  801.     UInt8                           reserved3;
  802.     long                            characteristicCount;
  803.     RTPPayloadCharacteristic        characteristic[1];
  804.                                                                 /* after the last characteristic, the payload name (defined by the RTPPayloadInfo*/
  805.                                                                 /* structure) is present. */
  806. };
  807. typedef struct MediaPacketizerInfo      MediaPacketizerInfo;
  808. typedef MediaPacketizerInfo *           MediaPacketizerInfoPtr;
  809. typedef MediaPacketizerInfoPtr *        MediaPacketizerInfoHandle;
  810. #define MediaPacketizerInfoToPayloadInfo(_mpi) ((RTPPayloadInfoPtr)(&((_mpi)->characteristic[(_mpi)->characteristicCount])))
  811. /* MediaPacketizerInfo structs are padded to 32 bits */
  812. enum {
  813.     kMediaPacketizerInfoPadUpToBytes = 4
  814. };
  815. enum {
  816.     kRTPMediaPacketizerInfoRezType = FOUR_CHAR_CODE('pcki')
  817. };
  818. EXTERN_API_C( OSErr )
  819. QTSFindMediaPacketizer          (MediaPacketizerRequirementsPtr  inPacketizerinfo,
  820.                                  SampleDescriptionHandle  inSampleDescription,
  821.                                  RTPPayloadSortRequestPtr  inSortInfo,
  822.                                  QTAtomContainer *      outPacketizerList);
  823. EXTERN_API_C( OSErr )
  824. QTSFindMediaPacketizerForTrack  (Track                  inTrack,
  825.                                  long                   inSampleDescriptionIndex,
  826.                                  RTPPayloadSortRequestPtr  inSortInfo,
  827.                                  QTAtomContainer *      outPacketizerList);
  828. EXTERN_API_C( OSErr )
  829. QTSFindMediaPacketizerForPayloadID (long                payloadID,
  830.                                  RTPPayloadSortRequestPtr  inSortInfo,
  831.                                  QTAtomContainer *      outPacketizerList);
  832. EXTERN_API_C( OSErr )
  833. QTSFindMediaPacketizerForPayloadName (const char *      payloadName,
  834.                                  RTPPayloadSortRequestPtr  inSortInfo,
  835.                                  QTAtomContainer *      outPacketizerList);
  836. /* flags for RTPMPInitialize*/
  837. enum {
  838.     kRTPMPRealtimeModeFlag      = 0x00000001
  839. };
  840. /* flags for RTPMPSampleDataParams*/
  841. enum {
  842.     kRTPMPSyncSampleFlag        = 0x00000001,
  843.     kRTPMPRespectDurationFlag   = 0x00000002
  844. };
  845. struct RTPMPSampleDataParams {
  846.     UInt32                          version;
  847.     UInt32                          timeStamp;
  848.     UInt32                          duration;                   /* 0 = unknown duration*/
  849.     UInt32                          playOffset;
  850.     Fixed                           playRate;
  851.     SInt32                          flags;
  852.     UInt32                          sampleDescSeed;
  853.     Handle                          sampleDescription;
  854.     RTPMPSampleRef                  sampleRef;
  855.     UInt32                          dataLength;
  856.     const UInt8 *                   data;
  857.     RTPMPDataReleaseUPP             releaseProc;
  858.     void *                          refCon;
  859. };
  860. typedef struct RTPMPSampleDataParams    RTPMPSampleDataParams;
  861. /* out flags for idle, RTPMPSetSampleData, and RTPMPFlush*/
  862. enum {
  863.     kRTPMPStillProcessingData   = 0x00000001                    /* not done with data you've got*/
  864. };
  865. struct RTPMPPayloadTypeParams {
  866.     UInt32                          flags;
  867.     UInt32                          payloadNumber;
  868.     short                           nameLength;                 /* in: size of payloadName buffer (counting null terminator) -- this will be reset to needed length and paramErr returned if too small */
  869.     char *                          payloadName;                /* caller must provide buffer */
  870. };
  871. typedef struct RTPMPPayloadTypeParams   RTPMPPayloadTypeParams;
  872. /*-----------------------------------------
  873.     RTP Media Packetizer Info selectors
  874. -----------------------------------------*/
  875. /* info selectors - get only */
  876. enum {
  877.     kRTPMPPayloadTypeInfo       = FOUR_CHAR_CODE('rtpp'),       /* RTPMPPayloadTypeParams* */
  878.     kRTPMPRTPTimeScaleInfo      = FOUR_CHAR_CODE('rtpt'),       /* TimeScale* */
  879.     kRTPMPRequiredSampleDescriptionInfo = FOUR_CHAR_CODE('sdsc'), /* SampleDescriptionHandle* */
  880.     kRTPMPMinPayloadSize        = FOUR_CHAR_CODE('mins'),       /* UInt32* in bytes, does not include rtp header; default is 0 */
  881.     kRTPMPMinPacketDuration     = FOUR_CHAR_CODE('mind'),       /* UInt3* in milliseconds; default is no min required */
  882.     kRTPMPSuggestedRepeatPktCountInfo = FOUR_CHAR_CODE('srpc'), /* UInt32* */
  883.     kRTPMPSuggestedRepeatPktSpacingInfo = FOUR_CHAR_CODE('srps'), /* UInt32* in milliseconds */
  884.     kRTPMPMaxPartialSampleSizeInfo = FOUR_CHAR_CODE('mpss'),    /* UInt32* in bytes */
  885.     kRTPMPPreferredBufferDelayInfo = FOUR_CHAR_CODE('prbd'),    /* UInt32* in milliseconds */
  886.     kRTPMPPayloadNameInfo       = FOUR_CHAR_CODE('name'),       /* StringPtr */
  887.     kRTPInfo_FormatString       = FOUR_CHAR_CODE('fmtp')        /* char **, caller allocates ptr, callee disposes */
  888. };
  889. /*-----------------------------------------
  890.     RTP Media Packetizer Characteristics
  891. -----------------------------------------*/
  892. /* also supports relevant ones in Movies.h and QTSToolbox.h */
  893. enum {
  894.     kRTPMPNoSampleDataRequiredCharacteristic = FOUR_CHAR_CODE('nsdr'),
  895.     kRTPMPHasUserSettingsDialogCharacteristic = FOUR_CHAR_CODE('sdlg'),
  896.     kRTPMPPrefersReliableTransportCharacteristic = FOUR_CHAR_CODE('rely'),
  897.     kRTPMPRequiresOutOfBandDimensionsCharacteristic = FOUR_CHAR_CODE('robd'),
  898.     kRTPMPReadsPartialSamplesCharacteristic = FOUR_CHAR_CODE('rpsp')
  899. };
  900. /*-----------------------------------------
  901.     RTP Media Packetizer selectors
  902. -----------------------------------------*/
  903. enum {
  904.     kRTPMPInitializeSelect      = 0x0500,
  905.     kRTPMPPreflightMediaSelect  = 0x0501,
  906.     kRTPMPIdleSelect            = 0x0502,
  907.     kRTPMPSetSampleDataSelect   = 0x0503,
  908.     kRTPMPFlushSelect           = 0x0504,
  909.     kRTPMPResetSelect           = 0x0505,
  910.     kRTPMPSetInfoSelect         = 0x0506,
  911.     kRTPMPGetInfoSelect         = 0x0507,
  912.     kRTPMPSetTimeScaleSelect    = 0x0508,
  913.     kRTPMPGetTimeScaleSelect    = 0x0509,
  914.     kRTPMPSetTimeBaseSelect     = 0x050A,
  915.     kRTPMPGetTimeBaseSelect     = 0x050B,
  916.     kRTPMPHasCharacteristicSelect = 0x050C,
  917.     kRTPMPSetPacketBuilderSelect = 0x050E,
  918.     kRTPMPGetPacketBuilderSelect = 0x050F,
  919.     kRTPMPSetMediaTypeSelect    = 0x0510,
  920.     kRTPMPGetMediaTypeSelect    = 0x0511,
  921.     kRTPMPSetMaxPacketSizeSelect = 0x0512,
  922.     kRTPMPGetMaxPacketSizeSelect = 0x0513,
  923.     kRTPMPSetMaxPacketDurationSelect = 0x0514,
  924.     kRTPMPGetMaxPacketDurationSelect = 0x0515,                  /* for export component and apps who want to*/
  925.                                                                 /* access dialogs for Media-specific settings*/
  926.                                                                 /* (such as Pure Voice interleave factor)*/
  927.     kRTPMPDoUserDialogSelect    = 0x0516,
  928.     kRTPMPSetSettingsFromAtomContainerAtAtomSelect = 0x0517,
  929.     kRTPMPGetSettingsIntoAtomContainerAtAtomSelect = 0x0518,
  930.     kRTPMPGetSettingsAsTextSelect = 0x0519,
  931.     kRTPMPGetSettingsSelect     = 0x051A,
  932.     kRTPMPSetSettingsSelect     = 0x051B
  933. };
  934. /*-----------------------------------------
  935.     RTP Media Packetizer functions
  936. -----------------------------------------*/
  937. EXTERN_API( ComponentResult )
  938. RTPMPInitialize                 (RTPMediaPacketizer     rtpm,
  939.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0500, 0x7000, 0xA82A);
  940. /* return noErr if you can handle this media */
  941. EXTERN_API( ComponentResult )
  942. RTPMPPreflightMedia             (RTPMediaPacketizer     rtpm,
  943.                                  OSType                 inMediaType,
  944.                                  SampleDescriptionHandle  inSampleDescription)              FIVEWORDINLINE(0x2F3C, 0x0008, 0x0501, 0x7000, 0xA82A);
  945. /*
  946.    do work here if you need to - give up time periodically
  947.    if you're doing time consuming operations
  948. */
  949. EXTERN_API( ComponentResult )
  950. RTPMPIdle                       (RTPMediaPacketizer     rtpm,
  951.                                  SInt32                 inFlags,
  952.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0502, 0x7000, 0xA82A);
  953. /*
  954.    caller owns the RTPMPSampleDataParams struct
  955.    media Packetizer must copy any fields of the struct it wants to keep
  956.    media Packetizer must call release proc when done with the data
  957.    you can do the processing work here if it does not take up too
  958.    much cpu time - otherwise do it in idle
  959. */
  960. EXTERN_API( ComponentResult )
  961. RTPMPSetSampleData              (RTPMediaPacketizer     rtpm,
  962.                                  const RTPMPSampleDataParams * inSampleData,
  963.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0503, 0x7000, 0xA82A);
  964. /*
  965.    send everything you have buffered - you will get idles while
  966.    you set the kRTPMPStillProcessingData flag here and in idle
  967. */
  968. EXTERN_API( ComponentResult )
  969. RTPMPFlush                      (RTPMediaPacketizer     rtpm,
  970.                                  SInt32                 inFlags,
  971.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0504, 0x7000, 0xA82A);
  972. /*
  973.    dispose of anything buffered and get rid of state
  974.    do not send the buffered data (because presumably
  975.    there is no connection for you to send on)
  976.    state should be the same as if you were just initialized
  977. */
  978. EXTERN_API( ComponentResult )
  979. RTPMPReset                      (RTPMediaPacketizer     rtpm,
  980.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0505, 0x7000, 0xA82A);
  981. /*-----------------------------------------
  982.     RTP Media Packetizer get / set functions
  983. -----------------------------------------*/
  984. EXTERN_API( ComponentResult )
  985. RTPMPSetInfo                    (RTPMediaPacketizer     rtpm,
  986.                                  OSType                 inSelector,
  987.                                  const void *           ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0506, 0x7000, 0xA82A);
  988. EXTERN_API( ComponentResult )
  989. RTPMPGetInfo                    (RTPMediaPacketizer     rtpm,
  990.                                  OSType                 inSelector,
  991.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0507, 0x7000, 0xA82A);
  992. EXTERN_API( ComponentResult )
  993. RTPMPSetTimeScale               (RTPMediaPacketizer     rtpm,
  994.                                  TimeScale              inTimeScale)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0508, 0x7000, 0xA82A);
  995. EXTERN_API( ComponentResult )
  996. RTPMPGetTimeScale               (RTPMediaPacketizer     rtpm,
  997.                                  TimeScale *            outTimeScale)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x0509, 0x7000, 0xA82A);
  998. EXTERN_API( ComponentResult )
  999. RTPMPSetTimeBase                (RTPMediaPacketizer     rtpm,
  1000.                                  TimeBase               inTimeBase)                         FIVEWORDINLINE(0x2F3C, 0x0004, 0x050A, 0x7000, 0xA82A);
  1001. EXTERN_API( ComponentResult )
  1002. RTPMPGetTimeBase                (RTPMediaPacketizer     rtpm,
  1003.                                  TimeBase *             outTimeBase)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x050B, 0x7000, 0xA82A);
  1004. EXTERN_API( ComponentResult )
  1005. RTPMPHasCharacteristic          (RTPMediaPacketizer     rtpm,
  1006.                                  OSType                 inSelector,
  1007.                                  Boolean *              outHasIt)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050C, 0x7000, 0xA82A);
  1008. EXTERN_API( ComponentResult )
  1009. RTPMPSetPacketBuilder           (RTPMediaPacketizer     rtpm,
  1010.                                  ComponentInstance      inPacketBuilder)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x050E, 0x7000, 0xA82A);
  1011. EXTERN_API( ComponentResult )
  1012. RTPMPGetPacketBuilder           (RTPMediaPacketizer     rtpm,
  1013.                                  ComponentInstance *    outPacketBuilder)                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x050F, 0x7000, 0xA82A);
  1014. EXTERN_API( ComponentResult )
  1015. RTPMPSetMediaType               (RTPMediaPacketizer     rtpm,
  1016.                                  OSType                 inMediaType)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0510, 0x7000, 0xA82A);
  1017. EXTERN_API( ComponentResult )
  1018. RTPMPGetMediaType               (RTPMediaPacketizer     rtpm,
  1019.                                  OSType *               outMediaType)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x0511, 0x7000, 0xA82A);
  1020. /* size is in bytes*/
  1021. EXTERN_API( ComponentResult )
  1022. RTPMPSetMaxPacketSize           (RTPMediaPacketizer     rtpm,
  1023.                                  UInt32                 inMaxPacketSize)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0512, 0x7000, 0xA82A);
  1024. EXTERN_API( ComponentResult )
  1025. RTPMPGetMaxPacketSize           (RTPMediaPacketizer     rtpm,
  1026.                                  UInt32 *               outMaxPacketSize)                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0513, 0x7000, 0xA82A);
  1027. /* duration is in milliseconds*/
  1028. EXTERN_API( ComponentResult )
  1029. RTPMPSetMaxPacketDuration       (RTPMediaPacketizer     rtpm,
  1030.                                  UInt32                 inMaxPacketDuration)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0514, 0x7000, 0xA82A);
  1031. EXTERN_API( ComponentResult )
  1032. RTPMPGetMaxPacketDuration       (RTPMediaPacketizer     rtpm,
  1033.                                  UInt32 *               outMaxPacketDuration)               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0515, 0x7000, 0xA82A);
  1034. EXTERN_API( ComponentResult )
  1035. RTPMPDoUserDialog               (RTPMediaPacketizer     rtpm,
  1036.                                  ModalFilterUPP         inFilterUPP,
  1037.                                  Boolean *              canceled)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0516, 0x7000, 0xA82A);
  1038. EXTERN_API( ComponentResult )
  1039. RTPMPSetSettingsFromAtomContainerAtAtom (RTPMediaPacketizer  rtpm,
  1040.                                  QTAtomContainer        inContainer,
  1041.                                  QTAtom                 inParentAtom)                       FIVEWORDINLINE(0x2F3C, 0x0008, 0x0517, 0x7000, 0xA82A);
  1042. EXTERN_API( ComponentResult )
  1043. RTPMPGetSettingsIntoAtomContainerAtAtom (RTPMediaPacketizer  rtpm,
  1044.                                  QTAtomContainer        inOutContainer,
  1045.                                  QTAtom                 inParentAtom)                       FIVEWORDINLINE(0x2F3C, 0x0008, 0x0518, 0x7000, 0xA82A);
  1046. EXTERN_API( ComponentResult )
  1047. RTPMPGetSettingsAsText          (RTPMediaPacketizer     rtpm,
  1048.                                  Handle *               text)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0519, 0x7000, 0xA82A);
  1049. EXTERN_API( ComponentResult )
  1050. RTPMPGetSettings                (RTPMediaPacketizer     rtpm,
  1051.                                  QTAtomContainer *      outSettings,
  1052.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x051A, 0x7000, 0xA82A);
  1053. EXTERN_API( ComponentResult )
  1054. RTPMPSetSettings                (RTPMediaPacketizer     rtpm,
  1055.                                  QTAtomSpecPtr          inSettings,
  1056.                                  SInt32                 inFlags)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x051B, 0x7000, 0xA82A);
  1057. /*============================================================================
  1058.         RTP Packet Builder
  1059. ============================================================================*/
  1060. enum {
  1061.     kRTPPacketBuilderType       = FOUR_CHAR_CODE('rtpb')
  1062. };
  1063. typedef ComponentInstance               RTPPacketBuilder;
  1064. typedef struct OpaqueRTPPacketGroupRef*  RTPPacketGroupRef;
  1065. typedef struct OpaqueRTPPacketRef*      RTPPacketRef;
  1066. typedef struct OpaqueRTPPacketRepeatedDataRef*  RTPPacketRepeatedDataRef;
  1067. /* flags for RTPPBBegin/EndPacket, RTPPBBegin/EndPacketGroup*/
  1068. enum {
  1069.     kRTPPBSetMarkerFlag         = 0x00000001,
  1070.     kRTPPBRepeatPacketFlag      = 0x00000002,
  1071.     kRTPPBSyncSampleFlag        = 0x00010000,
  1072.     kRTPPBBFrameFlag            = 0x00020000,
  1073.     kRTPPBDontSendFlag          = 0x10000000                    /* when set in EndPacketGroup, will not add group*/
  1074. };
  1075. enum {
  1076.     kRTPPBUnknownPacketMediaDataLength = 0
  1077. };
  1078. /* flags for RTPPBGetSampleData*/
  1079. enum {
  1080.     kRTPPBEndOfDataFlag         = 0x00000001
  1081. };
  1082. typedef CALLBACK_API( void , RTPPBCallbackProcPtr )(OSType inSelector, void *ioParams, void *inRefCon);
  1083. typedef STACK_UPP_TYPE(RTPPBCallbackProcPtr)                    RTPPBCallbackUPP;
  1084. /*-----------------------------------------
  1085.     RTP Packet Builder selectors
  1086. -----------------------------------------*/
  1087. enum {
  1088.     kRTPPBBeginPacketGroupSelect = 0x0500,
  1089.     kRTPPBEndPacketGroupSelect  = 0x0501,
  1090.     kRTPPBBeginPacketSelect     = 0x0502,
  1091.     kRTPPBEndPacketSelect       = 0x0503,
  1092.     kRTPPBAddPacketLiteralDataSelect = 0x0504,
  1093.     kRTPPBAddPacketSampleDataSelect = 0x0505,
  1094.     kRTPPBAddPacketRepeatedDataSelect = 0x0506,
  1095.     kRTPPBReleaseRepeatedDataSelect = 0x0507,
  1096.     kRTPPBSetPacketSequenceNumberSelect = 0x0508,
  1097.     kRTPPBGetPacketSequenceNumberSelect = 0x0509,
  1098.     kRTPPBSetCallbackSelect     = 0x050A,
  1099.     kRTPPBGetCallbackSelect     = 0x050B,
  1100.     kRTPPBSetInfoSelect         = 0x050C,
  1101.     kRTPPBGetInfoSelect         = 0x050D,
  1102.     kRTPPBSetPacketTimeStampOffsetSelect = 0x050E,
  1103.     kRTPPBGetPacketTimeStampOffsetSelect = 0x050F,
  1104.     kRTPPBAddPacketSampleData64Select = 0x0510,
  1105.     kRTPPBGetSampleDataSelect   = 0x0511,
  1106.     kRTPPBAddRepeatPacketSelect = 0x0512
  1107. };
  1108. /*-----------------------------------------
  1109.     RTP Packet Builder functions
  1110. -----------------------------------------*/
  1111. EXTERN_API( ComponentResult )
  1112. RTPPBBeginPacketGroup           (RTPPacketBuilder       rtpb,
  1113.                                  SInt32                 inFlags,
  1114.                                  UInt32                 inTimeStamp,
  1115.                                  RTPPacketGroupRef *    outPacketGroup)                     FIVEWORDINLINE(0x2F3C, 0x000C, 0x0500, 0x7000, 0xA82A);
  1116. EXTERN_API( ComponentResult )
  1117. RTPPBEndPacketGroup             (RTPPacketBuilder       rtpb,
  1118.                                  SInt32                 inFlags,
  1119.                                  RTPPacketGroupRef      inPacketGroup)                      FIVEWORDINLINE(0x2F3C, 0x0008, 0x0501, 0x7000, 0xA82A);
  1120. EXTERN_API( ComponentResult )
  1121. RTPPBBeginPacket                (RTPPacketBuilder       rtpb,
  1122.                                  SInt32                 inFlags,
  1123.                                  RTPPacketGroupRef      inPacketGroup,
  1124.                                  UInt32                 inPacketMediaDataLength,
  1125.                                  RTPPacketRef *         outPacket)                          FIVEWORDINLINE(0x2F3C, 0x0010, 0x0502, 0x7000, 0xA82A);
  1126. EXTERN_API( ComponentResult )
  1127. RTPPBEndPacket                  (RTPPacketBuilder       rtpb,
  1128.                                  SInt32                 inFlags,
  1129.                                  RTPPacketGroupRef      inPacketGroup,
  1130.                                  RTPPacketRef           inPacket,
  1131.                                  UInt32                 inTransmissionTimeOffset,
  1132.                                  UInt32                 inDuration)                         FIVEWORDINLINE(0x2F3C, 0x0014, 0x0503, 0x7000, 0xA82A);
  1133. /*
  1134.    non-NULL RTPPacketRepeatedDataRef means this data will be repeated later
  1135.    pb must return a repeated data ref
  1136. */
  1137. EXTERN_API( ComponentResult )
  1138. RTPPBAddPacketLiteralData       (RTPPacketBuilder       rtpb,
  1139.                                  SInt32                 inFlags,
  1140.                                  RTPPacketGroupRef      inPacketGroup,
  1141.                                  RTPPacketRef           inPacket,
  1142.                                  UInt8 *                inData,
  1143.                                  UInt32                 inDataLength,
  1144.                                  RTPPacketRepeatedDataRef * outDataRef)                     FIVEWORDINLINE(0x2F3C, 0x0018, 0x0504, 0x7000, 0xA82A);
  1145. /*
  1146.    non-NULL RTPPacketRepeatedDataRef means this data will be repeated later
  1147.    pb must return a repeated data ref
  1148. */
  1149. EXTERN_API( ComponentResult )
  1150. RTPPBAddPacketSampleData        (RTPPacketBuilder       rtpb,
  1151.                                  SInt32                 inFlags,
  1152.                                  RTPPacketGroupRef      inPacketGroup,
  1153.                                  RTPPacketRef           inPacket,
  1154.                                  RTPMPSampleDataParams * inSampleDataParams,
  1155.                                  UInt32                 inSampleOffset,
  1156.                                  UInt32                 inSampleDataLength,
  1157.                                  RTPPacketRepeatedDataRef * outDataRef)                     FIVEWORDINLINE(0x2F3C, 0x001C, 0x0505, 0x7000, 0xA82A);
  1158. /*
  1159.    non-NULL RTPPacketRepeatedDataRef means this data will be repeated later
  1160.    pb must return a repeated data ref
  1161. */
  1162. EXTERN_API( ComponentResult )
  1163. RTPPBAddPacketSampleData64      (RTPPacketBuilder       rtpb,
  1164.                                  SInt32                 inFlags,
  1165.                                  RTPPacketGroupRef      inPacketGroup,
  1166.                                  RTPPacketRef           inPacket,
  1167.                                  RTPMPSampleDataParams * inSampleDataParams,
  1168.                                  const UInt64 *         inSampleOffset,
  1169.                                  UInt32                 inSampleDataLength,
  1170.                                  RTPPacketRepeatedDataRef * outDataRef)                     FIVEWORDINLINE(0x2F3C, 0x001C, 0x0510, 0x7000, 0xA82A);
  1171. /*
  1172.    call to add the repeated data using the ref you got from
  1173.    RTPPBAddPacketLiteralData or RTPPBAddPacketSampleData
  1174. */
  1175. EXTERN_API( ComponentResult )
  1176. RTPPBAddPacketRepeatedData      (RTPPacketBuilder       rtpb,
  1177.                                  SInt32                 inFlags,
  1178.                                  RTPPacketGroupRef      inPacketGroup,
  1179.                                  RTPPacketRef           inPacket,
  1180.                                  RTPPacketRepeatedDataRef  inDataRef)                       FIVEWORDINLINE(0x2F3C, 0x0010, 0x0506, 0x7000, 0xA82A);
  1181. /* call when done with repeated data*/
  1182. EXTERN_API( ComponentResult )
  1183. RTPPBReleaseRepeatedData        (RTPPacketBuilder       rtpb,
  1184.                                  RTPPacketRepeatedDataRef  inDataRef)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x0507, 0x7000, 0xA82A);
  1185. /*
  1186.    seq number is just relative seq number
  1187.    don't call if you don't care when seq # is used
  1188. */
  1189. EXTERN_API( ComponentResult )
  1190. RTPPBSetPacketSequenceNumber    (RTPPacketBuilder       rtpb,
  1191.                                  SInt32                 inFlags,
  1192.                                  RTPPacketGroupRef      inPacketGroup,
  1193.                                  RTPPacketRef           inPacket,
  1194.                                  UInt32                 inSequenceNumber)                   FIVEWORDINLINE(0x2F3C, 0x0010, 0x0508, 0x7000, 0xA82A);
  1195. EXTERN_API( ComponentResult )
  1196. RTPPBGetPacketSequenceNumber    (RTPPacketBuilder       rtpb,
  1197.                                  SInt32                 inFlags,
  1198.                                  RTPPacketGroupRef      inPacketGroup,
  1199.                                  RTPPacketRef           inPacket,
  1200.                                  UInt32 *               outSequenceNumber)                  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0509, 0x7000, 0xA82A);
  1201. EXTERN_API( ComponentResult )
  1202. RTPPBSetPacketTimeStampOffset   (RTPPacketBuilder       rtpb,
  1203.                                  SInt32                 inFlags,
  1204.                                  RTPPacketGroupRef      inPacketGroup,
  1205.                                  RTPPacketRef           inPacket,
  1206.                                  SInt32                 inTimeStampOffset)                  FIVEWORDINLINE(0x2F3C, 0x0010, 0x050E, 0x7000, 0xA82A);
  1207. EXTERN_API( ComponentResult )
  1208. RTPPBGetPacketTimeStampOffset   (RTPPacketBuilder       rtpb,
  1209.                                  SInt32                 inFlags,
  1210.                                  RTPPacketGroupRef      inPacketGroup,
  1211.                                  RTPPacketRef           inPacket,
  1212.                                  SInt32 *               outTimeStampOffset)                 FIVEWORDINLINE(0x2F3C, 0x0010, 0x050F, 0x7000, 0xA82A);
  1213. EXTERN_API( ComponentResult )
  1214. RTPPBAddRepeatPacket            (RTPPacketBuilder       rtpb,
  1215.                                  SInt32                 inFlags,
  1216.                                  RTPPacketGroupRef      inPacketGroup,
  1217.                                  RTPPacketRef           inPacket,
  1218.                                  TimeValue              inTransmissionOffset,
  1219.                                  UInt32                 inSequenceNumber)                   FIVEWORDINLINE(0x2F3C, 0x0014, 0x0512, 0x7000, 0xA82A);
  1220. /*
  1221.    used for communicating with the caller of the media packetizers if needed
  1222.    NOT used for communicating with the media packetizers themselves
  1223. */
  1224. EXTERN_API( ComponentResult )
  1225. RTPPBSetCallback                (RTPPacketBuilder       rtpb,
  1226.                                  RTPPBCallbackUPP       inCallback,
  1227.                                  void *                 inRefCon)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050A, 0x7000, 0xA82A);
  1228. EXTERN_API( ComponentResult )
  1229. RTPPBGetCallback                (RTPPacketBuilder       rtpb,
  1230.                                  RTPPBCallbackUPP *     outCallback,
  1231.                                  void **                outRefCon)                          FIVEWORDINLINE(0x2F3C, 0x0008, 0x050B, 0x7000, 0xA82A);
  1232. EXTERN_API( ComponentResult )
  1233. RTPPBSetInfo                    (RTPPacketBuilder       rtpb,
  1234.                                  OSType                 inSelector,
  1235.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050C, 0x7000, 0xA82A);
  1236. EXTERN_API( ComponentResult )
  1237. RTPPBGetInfo                    (RTPPacketBuilder       rtpb,
  1238.                                  OSType                 inSelector,
  1239.                                  void *                 ioParams)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x050D, 0x7000, 0xA82A);
  1240. EXTERN_API( ComponentResult )
  1241. RTPPBGetSampleData              (RTPPacketBuilder       rtpb,
  1242.                                  RTPMPSampleDataParams * inParams,
  1243.                                  const UInt64 *         inStartOffset,
  1244.                                  UInt8 *                outDataBuffer,
  1245.                                  UInt32                 inBytesToRead,
  1246.                                  UInt32 *               outBytesRead,
  1247.                                  SInt32 *               outFlags)                           FIVEWORDINLINE(0x2F3C, 0x0018, 0x0511, 0x7000, 0xA82A);
  1248. /* UPP call backs */
  1249. #if OPAQUE_UPP_TYPES
  1250.     EXTERN_API(RTPMPDataReleaseUPP)
  1251.     NewRTPMPDataReleaseUPP         (RTPMPDataReleaseProcPtr userRoutine);
  1252.     EXTERN_API(RTPPBCallbackUPP)
  1253.     NewRTPPBCallbackUPP            (RTPPBCallbackProcPtr    userRoutine);
  1254.     EXTERN_API(void)
  1255.     DisposeRTPMPDataReleaseUPP     (RTPMPDataReleaseUPP     userUPP);
  1256.     EXTERN_API(void)
  1257.     DisposeRTPPBCallbackUPP        (RTPPBCallbackUPP        userUPP);
  1258.     EXTERN_API(void)
  1259.     InvokeRTPMPDataReleaseUPP      (UInt8 *                 inData,
  1260.                                     void *                  inRefCon,
  1261.                                     RTPMPDataReleaseUPP     userUPP);
  1262.     EXTERN_API(void)
  1263.     InvokeRTPPBCallbackUPP         (OSType                  inSelector,
  1264.                                     void *                  ioParams,
  1265.                                     void *                  inRefCon,
  1266.                                     RTPPBCallbackUPP        userUPP);
  1267. #else
  1268.     enum { uppRTPMPDataReleaseProcInfo = 0x000003C0 };              /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1269.     enum { uppRTPPBCallbackProcInfo = 0x00000FC0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  1270.     #define NewRTPMPDataReleaseUPP(userRoutine)                     (RTPMPDataReleaseUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppRTPMPDataReleaseProcInfo, GetCurrentArchitecture())
  1271.     #define NewRTPPBCallbackUPP(userRoutine)                        (RTPPBCallbackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppRTPPBCallbackProcInfo, GetCurrentArchitecture())
  1272.     #define DisposeRTPMPDataReleaseUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  1273.     #define DisposeRTPPBCallbackUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  1274.     #define InvokeRTPMPDataReleaseUPP(inData, inRefCon, userUPP)    CALL_TWO_PARAMETER_UPP((userUPP), uppRTPMPDataReleaseProcInfo, (inData), (inRefCon))
  1275.     #define InvokeRTPPBCallbackUPP(inSelector, ioParams, inRefCon, userUPP)  CALL_THREE_PARAMETER_UPP((userUPP), uppRTPPBCallbackProcInfo, (inSelector), (ioParams), (inRefCon))
  1276. #endif
  1277. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1278. #define NewRTPMPDataReleaseProc(userRoutine)                    NewRTPMPDataReleaseUPP(userRoutine)
  1279. #define NewRTPPBCallbackProc(userRoutine)                       NewRTPPBCallbackUPP(userRoutine)
  1280. #define CallRTPMPDataReleaseProc(userRoutine, inData, inRefCon) InvokeRTPMPDataReleaseUPP(inData, inRefCon, userRoutine)
  1281. #define CallRTPPBCallbackProc(userRoutine, inSelector, ioParams, inRefCon) InvokeRTPPBCallbackUPP(inSelector, ioParams, inRefCon, userRoutine)
  1282. #if PRAGMA_STRUCT_ALIGN
  1283.     #pragma options align=reset
  1284. #elif PRAGMA_STRUCT_PACKPUSH
  1285.     #pragma pack(pop)
  1286. #elif PRAGMA_STRUCT_PACK
  1287.     #pragma pack()
  1288. #endif
  1289. #ifdef PRAGMA_IMPORT_OFF
  1290. #pragma import off
  1291. #elif PRAGMA_IMPORT
  1292. #pragma import reset
  1293. #endif
  1294. #ifdef __cplusplus
  1295. }
  1296. #endif
  1297. #endif /* __QTSTREAMINGCOMPONENTS__ */