mux_mp2.h
上传用户:wangqun
上传日期:2019-10-16
资源大小:34701k
文件大小:24k
源码类别:

多媒体

开发平台:

Visual C++

  1. /* ----------------------------------------------------------------------------
  2.  * File: mux_mp2.h
  3.  *
  4.  * Desc: MPEG Muxer API
  5.  *
  6.  * Copyright (c) 2009, MainConcept GmbH. All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information of
  9.  * MainConcept GmbH and may be used only in accordance with the terms of
  10.  * your license from MainConcept GmbH.
  11.  * ----------------------------------------------------------------------------
  12.  */
  13.  
  14. #if !defined (__MUX_MP2_API_INCLUDED__)
  15. #define __MUX_MP2_API_INCLUDED__
  16. #include "bufstrm.h"
  17. #include "mcdefs.h"
  18. #include "mcprofile.h"
  19. #include "mcmediatypes.h"
  20. #include "mcapiext.h"
  21. typedef struct MP2Muxer mp2muxer_tt;   // muxer object
  22. //namespace MP2Mux
  23. //{
  24. // maximum stream of each type that can be added
  25. // Don't use these defines anymore - obsolete parameters. 
  26. // Kept for compatibility reasons only. 
  27. // The maximum allowed number of streams is limited by the specs for concrete output profile (TS, PS, etc.)
  28. #define MAX_VIDEO_STREAMS   8
  29. #define MAX_AUDIO_STREAMS   8
  30. #define MAX_SUBPIC_STREAMS 32
  31. // -------------------------------
  32. // flags for the mp2muxer_set_struct.feature_flags field
  33. #define MUX_FEATURE_TS_ATS            0x00000001  // add 4-byte arrival time stamp prefix to all transport stream packets
  34.                           // only the lower 30 bits of the 4 bytes are used
  35.                           // the upper 2 bits are set to 0
  36. #define MUX_FEATURE_TS_NO_PSI         0x00000002  // no transport stream Program Specific Information (PAT, PMT, etc.)
  37.                           // is placed in the transport stream
  38. #define MUX_FEATURE_TS_AU_INFO        0x00000004 // AU_information private data as defined by ETSI TS 101 154 V1.7.1
  39. // is placed in the transport stream
  40. #define MUX_FEATURE_TS_PCR_IFRAMES    0x00000008 // PCR is placed in transport stream packets that contain the start
  41. // of an I or IDR frame
  42. #define MUX_FEATURE_TS_PCR_ALL_FRAMES 0x00000010 // PCR is placed in transport stream packets that contain the start
  43. // of any frame
  44. // flags for the mp2mux_stream_set_struct.flags field
  45. #define STREAM_FLAG_STILL_PICTURES    0x00000001  // video stream contains still images, I frames only!
  46. #define STREAM_FLAG_VCD_VBV_UPDATE    0x00000002  // only use with a single I frame, STREAM_FLAG_STILL_PICTURES
  47.                           // must also be present. The muxer will update the VBV in the
  48.                           // seq hdr to the length of the pic rounded up to a multiple
  49.                           // of 2048 bytes (as well as the P-STD buffer).
  50. #define STREAM_FLAG_SVCD_STILL_OFFSET 0x00000004  // put a SVCD scan offset in the still picture
  51.                           // STREAM_FLAG_STILL_PICTURES must also be present
  52. #define STREAM_FLAG_SUBPIC_WITH_PTS   0x00000008  // each subpic is prefixed by an 8 byte (int64_t) PTS value, file mux only!
  53. #define STREAM_FLAG_H264_AU_DELIMITER 0x00000010  // put an AU delimiter before each H.264 frame
  54. #define STREAM_FLAG_STOP_AT_EOF       0x00000020  // stop muxing when this file ends, file muxing only, video or audio only
  55. //These defines are only informative since 8.0 and kept for backward compatibility only
  56. //Use mcmediatypes_t instead.
  57. #define STREAM_FLAG_VIDEO_STREAM      0x00010000  // stream is a video stream
  58. #define STREAM_FLAG_AUDIO_STREAM      0x00020000  // stream is an audio stream
  59. #define STREAM_FLAG_SUBPIC_STREAM     0x00040000  // stream is a subpicture stream
  60. // flags for the mp2mux_ext_set_struct.flags field
  61. #define EXT_FLAG_EMPTY_SECTORS        0x00000001  // make empty sectors instead of padding sectors, VCD only
  62. #define EXT_OUTPUT_DATA_FOR_XML       0x00000002  // output video_seq_info_xml and video_au_info_xml data
  63. #define EXT_USE_PROGRAM_NUMBER        0x00000010  // obsolete. Use mp2mux_ts_program_set_struct.program_number 
  64. #define EXT_USE_NETWORK_ID            0x00000020  // obsolete. Set the network_ID to 0 to calculate it automatically, otherwise it's considered as valid value  
  65. #define EXT_USE_TRANSPORT_ID          0x00000040  // obsolete. Set the transport_ID to 0 to calculate it automatically, otherwise it's considered as valid value
  66. #define EXT_PAD_PES_EXTENSION         0x00000080  // add 3 PES padding bytes to reserve space for a PES
  67.                           // extension in the first packet of each stream in a VOBU
  68.                           // mplex_type must be one of the DVD types!
  69. #define EXT_AUDIO_NO_SPAN_VOBU        0x00000100  // do not let an audio frame span a VOBU
  70.                           // boundary. mplex_type must be one of the DVD types
  71. #define EXT_PTS_START_OFFSETS         0x00000200  // streaming input PTS's start with offset, 
  72.                           // adjust SCR start accordingly, leave audio PTS untouched
  73. #define EXT_WARN_ON_LOW_MUXRATE       0x00000400  // call wrn_printf (instead of calling inf_printf,
  74.                           // if the user mux rate is computed to be too low
  75. #define EXT_ERR_ON_LOW_MUXRATE        0x00000800  // call err_printf and abort (instead of calling inf_printf and continuing),
  76.                           // if the user mux rate is computed to be too low
  77. //obsolete flag
  78. #define EXT_PRESERVE_TIMESTAMPS       0x00001000  // use the streaming input timestamps without modification
  79. // On-the-fly parameters flags
  80. #define OTF_FLAG_BITRATE 0x00000001
  81. #define OTF_FLAG_PADDING 0x00000002
  82. #define MUX_OK           0
  83. #define MUX_NOVID        1
  84. #define MUX_NOAUD1       2
  85. #define MUX_NOAUD2       4
  86. #define MUX_NOTHINGTODO  8
  87. #define MUX_ERR         16
  88. #define MUX_NOSP        32
  89. #define MUX_NOTIMP      64
  90. #ifdef __GNUC__
  91.   #pragma pack(push,1)
  92. #else
  93.   #pragma pack(push)
  94.   #pragma pack(1)
  95. #endif
  96. struct dash_vr_set_struct
  97. {
  98.   unsigned char dci_cci_ss;
  99.   unsigned char dci;
  100.   unsigned char cci;
  101.   unsigned char mnf_id[32];
  102.   unsigned char mnfi_dt[1944];
  103. };
  104. struct si_commit_struct
  105. {
  106.   int64_t target_time_PCR;  //the PCR time at which SI config should be applied. In 27 MHz units. 
  107.   uint8_t reserved[128];
  108. };
  109. typedef enum 
  110. {
  111.   eOuter_descriptor_loop = 0, //descriptor loop of a PSI section
  112.   eInner_descriptor_loop = 1  //descriptor loop of entries
  113. #ifdef __BORLANDC__
  114. eDummy = 0xffffffff
  115. #endif
  116.   
  117. } loop_level_enum;
  118. struct si_descriptor_struct
  119. {
  120.   int16_t         target_table_id;    //target table to which the descriptor should be loaded.
  121.   int16_t         target_table_id_ext;  //target table id extension. Set to -1 if it's not required
  122.                         //It's excessive for such tables as PAT, since table_id = 0x0 is enough for distinguishing of this table;
  123.                         //But if many tables can exist with the same table_id (PMT for ex.), we need to distinguish between 
  124.                         // tables using target_table_id_ext. 
  125.                         //Example: for NIT the target_table_id_ext represents network_id. 
  126.                         //For PMT specify the program_number as the target_table_id_ext.
  127.                         
  128.   loop_level_enum target_loop;    //inner loop (1) / outer loop (0). Use loop_level_enum.
  129.   int16_t         target_entry_id;  //use it only if target_loop == 1! It's the PId of the stream, 
  130.                       //for which the descriptor is written.
  131.   int16_t         target_entry_id_ext;  //it's excessive for most of all entries, such as PMT entry. But NIT entry is identified by two id's - transport_id and orig_network_id
  132.   uint8_t         descriptor_tag;
  133.   uint8_t         descriptor_length;
  134.   uint8_t*        pbData;       //pointer to the data. It is copied instantly into the internal muxer's memory. 
  135.                       //User is responsible for cleaning of memory by himself. 
  136.   uint8_t         reserved[32];
  137. };
  138. struct si_entry_struct
  139. {
  140.   int16_t  target_table_id;     //target table to which the entry should be loaded.
  141.   int16_t  target_table_id_ext; //target table id extension. Set to -1 if it's not required
  142.   int32_t  entry_length;        //length of the entry bytes (num of valid bytes by pbData)
  143.   uint8_t* pbData;              //pointer to the data. It is copied instantly into the muxer's internal memory. 
  144.                                 //User is responsible for cleaning of memory by himself!
  145.   uint8_t  reserved[32];
  146. };
  147. // Not implemented yet!
  148. //complete SI table to be multiplexed
  149. struct si_section_struct
  150. {
  151.   int16_t  target_table_id;    //target table to which the descriptor should be loaded.
  152.   int16_t  target_table_id_ext;  //target table id extension. Set to -1 if it's not required
  153.   uint8_t* pbData;       //pointer to the data. It is copied instantly into the internal muxer's memory. 
  154.                       //User is responsible for cleaning of memory by himself. 
  155.   uint32_t cbData;       //data size.
  156.   uint8_t  reserved[32];
  157. };
  158. struct mp2mux_stream_set_struct
  159. {
  160.   mc_stream_format_t format_struct; // mc_mediatype and format structure: video, audio or user-defined private
  161.   int32_t stream_fifo_size; // the size of the fifo in bytes being used for this stream, only used
  162.                             // by mpegOutMP2MuxAddStream. If 0, the muxer will use a fixed size
  163.                             // for its internal fifo, else the muxer will compute an appropriate
  164.                             // internal fifo size based on this value
  165.   int32_t stream_rate_bps;  // Optional field. Sets the bitrate of the stream. 
  166.                             // If the input media type is private or doesn't contain any headers (i.e. PCM, subpicture), 
  167.                             // the bitrate must be specified by this parameter.
  168.                             // It also effective for 'parsable' video / audio: this parameter is applied with higher priority than 
  169.                             // the bitrate specified in the bitstream.
  170.   int32_t delay_ms;         // stream delay, 0 = automatically computed
  171.   int32_t id;               // stream ID, 0 = automatically computed
  172.   int32_t PES_length;
  173.   int32_t parent_program_PID;
  174.   int32_t flags;            // flags, one or more of the STREAM_FLAGS_ defines above
  175.                             // The best way to specify the mediatype is to use the format_struct.
  176.                             // If it's not possible or format_struct is not filled at all, this parameter 
  177.                             // MUST contain one and only one of: STREAM_FLAG_VIDEO_STREAM, STREAM_FLAG_AUDIO_STREAM or STREAM_FLAG_SUBPIC_STREAM
  178.   int32_t still_picture_duration; // duration of still pictures if the STREAM_FLAG_STILL_PICTURES flags
  179.                                   // is present. The value is the number of frames to display each picture
  180.   // ***** TS specific ***********
  181.   int32_t PID;              // PID, 0 = automatically computed
  182.   // ***** PS specific ***********
  183.   int32_t PSTD_buffer_size; // P-STD buffer size, 0 = automatically computed
  184.   int32_t sub_id;           // substream ID, 0 = automatically computed 
  185.                           
  186.   uint8_t shared_mpts_stream_flag; //set to 1 to indicate the stream is shared among all the programs being multiplexed
  187.   int32_t cpb_size_bits;
  188.   uint8_t align_in_flag;
  189.   uint8_t opt_packing_flag;
  190.   uint8_t enhanced_parsing_flag;
  191.   uint8_t reserved[56];  
  192. };
  193. typedef enum running_status_t
  194. {
  195.   e_undefined = 0,
  196.   e_not_running = 1,
  197.   e_starts_few_sec = 2,
  198.   e_pausing = 3,
  199.   e_running = 4,
  200.   e_reserved = 5
  201. };
  202. struct mp2mux_ts_program_set_struct
  203. {
  204.   int32_t PCR_PID;
  205.   int32_t independent_PCR_PID;
  206.   int32_t independent_PCR_PID_flag;
  207.   int32_t program_number;
  208.   int32_t program_PID;
  209.   uint8_t reserved5[64]; //63 or 60 and 4 bytes for independent PCR_PID? 
  210. };
  211. struct mp2mux_ext_set_struct
  212. {
  213.   uint32_t flags;                   // flags, one or more of the EXT_FLAG_ defines above
  214.   // transport stream items
  215.   int32_t  NIT_PID;                 // network information section PID, 0 = automatically computed
  216.   int32_t  SDT_PID;                 // service description section PID, 0 = automatically computed
  217.   int32_t  EIT_PID;                 // event information section PID, 0 = automatically computed
  218.   int32_t  TDT_PID;                 // time and date section PID, 0 = automatically computed
  219. //  int PMT_PID;               // obsolete; use mp2mux_ts_program_set_struct.program_PID
  220. //  int PCR_PID;               // obsolete; use mp2mux_ts_program_set_struct.PCR_PID 
  221. //  int program_number;             // obsolete; use mp2mux_ts_program_set_struct.program_number 
  222.   int32_t  PSI_LIMIT;               // time (in ms) before the PAT and other tables are repeated, 0 = automatically computed
  223.   int32_t  PCR_LIMIT;               // upper limit (in ms) of the PCR repeat rate, 0 = automatically computed
  224.   
  225.   int32_t  network_id;              // transport stream network id. Set to 0 to be automatically computed
  226.   int32_t  transport_id;            // transport stream id. Set to 0 to be automatically computed
  227.   
  228.   struct dash_vr_settings *dvr_set; // DVD-VR settings
  229.   uint8_t reserved[40];
  230. };
  231. struct mp2muxer_set_struct
  232. {
  233.   int32_t  mplex_type;             // type of program stream, one of the MPEG_ defines in mcdefs.h 
  234.   int64_t  sectors_delay;          // time stamp of first mpeg pack in ms
  235.   int64_t  video_delay_ms;         // default time stamp of the first video packet for all video streams, 0 = automatically computed
  236.   int64_t  audio_delay_ms;         // default time stamp of the first audio packet for all audio streams, 0 = automatically computed
  237.   int32_t  sector_size;            // size of the mpeg packs
  238.   int32_t  packets_per_pack;       // number of PES packets per pack
  239.   int32_t  extra_padding_packs;    // extra padding packets per second for transport streams only
  240.   int32_t  user_mux_rate_bps;      // force a particular mux rate (in bps)
  241.   int32_t  vcd_audio_pad;          // pad each vcd audio sector with 20 zeros 
  242.   int32_t  align_sequence_headers; // align sequence headers to the start of a PES packet 
  243.   int32_t  put_private2;           // put DVD private stream 2's instead of padding packets
  244.   int32_t  frame_timestamps;       // which frames to timestamp 
  245.   int32_t  VBR_multiplex;          // do VBR style multiplexing (enable / disable padding in both TS / PS)
  246.   
  247.   int32_t  mux_SVCD_scan_offsets;  // compute SVCD scan offsets 
  248.   int32_t  max_file_size;          // split file every so many MB 
  249.   uint32_t feature_flags;          // one or more of the MUX_FEATURE_* defines
  250.   int32_t  reset_clocks;           // reset the clocks in split files 
  251.   int32_t  write_pec;              // write a program end code 
  252.   int32_t  write_end_codes;        // write program end codes in split files 
  253.   int32_t  set_broken_link;        // set the broken link flag in the first GOP of split files 
  254.   uint8_t  ts_write_PSI_only_once; // Write the PSI (PAT, PMT, etc) only once in the beginning of the stream
  255.   uint8_t  ts_set_disc_indicator; // Set the 'discontinuity_indicator' of the first TS packet to 1
  256.   uint8_t  deny_missing_streams; // do not allow muxing of data when the input buffer is full. This can be done if only EOS received in case if deny_missing_stream=1
  257.   uint8_t  reserved[125];
  258. };
  259. #define MP2MUX_RT_FLAG_BITRATE 1 << 31;
  260. struct mp2mux_rt_set
  261. {
  262. int32_t  user_mux_rate_bps;      // force a particular mux rate (in bps)
  263. int32_t  VBR_multiplex;          // do VBR style multiplexing (enable / disable padding in both TS / PS)
  264. };
  265. #pragma pack(pop)
  266. #ifdef __cplusplus
  267. extern "C" {
  268. #endif
  269. // call to fill an mp2muxer_set_struct structure with defaults values
  270. // based on one of the SDK profile ID's
  271. // 
  272. //  inputs:
  273. //    set - pointer to an mp2muxer_set_struct structure
  274. //    video_type - one of the MPEG_* constants
  275. //  output:
  276. //    modified mp2muxer_set_struct structure
  277. //  return:
  278. //    none
  279. char *mpegOutMP2MuxDefaults(struct mp2muxer_set_struct *set, int32_t profileID);
  280. // call to create an mpeg muxer object
  281. //
  282. //  inputs:
  283. //    get_rc - pointer to a get resource function 
  284. //    set - pointer to a filled in mp2muxer_set_struct structure
  285. //  outputs:
  286. //    none
  287. //  return:
  288. //    pointer to a mp2muxer_tt object if succesful
  289. //    NULL if unsuccesful
  290. mp2muxer_tt * mpegOutMP2MuxNew(void *(*get_rc)(char* name), const struct mp2muxer_set_struct *set);
  291. // call to initialize the muxer for a streaming mode muxing session,
  292. // the audio/video data comes from audio and video bufstream
  293. // objects passed to mpegOutMP2MuxAddStream
  294. //
  295. //  inputs:
  296. //    muxer - pointer to an mpeg muxer object
  297. //    output - pointer to a bufstream_tt object for the output muxed data
  298. //    ext_set - pointer to an mp2mux_ext_set_struct structure, can be NULL
  299. //  outputs:
  300. //    none
  301. //  return:
  302. //    MUX_OK if successful
  303. //    MUX_ERR if unsuccesful
  304. int32_t mpegOutMP2MuxInitStream(mp2muxer_tt *muxer, struct mp2mux_ext_set_struct *ext_set, bufstream_tt *output);
  305. // call to add a video, audio or subpic stream to the muxer in streaming mode,
  306. //
  307. //  inputs:
  308. //    muxer - pointer to an mpeg muxer object
  309. //    set - pointer to a mp2mux_stream_set_struct structure
  310. //    input - pointer to a bufstream_tt object for the input data
  311. //  outputs:
  312. //    none
  313. //  return:
  314. //    MUX_OK if successful
  315. //    MUX_ERR if unsuccesful
  316. int32_t mpegOutMP2MuxAddStream(mp2muxer_tt *muxer, struct mp2mux_stream_set_struct *set, bufstream_tt *input);
  317. // call to initialize the muxer for a file mode muxing session,
  318. // the audio/video data comes from files added via mpegOutMuxAddFile
  319. //
  320. //  inputs:
  321. //    muxer - pointer to an mpeg muxer object
  322. //    output - pointer to an output filename or bufstream for the output muxed data
  323. //    ext_set - pointer to an mp2mux_ext_set_struct structure, can be NULL
  324. //  outputs:
  325. //    none
  326. //  return:
  327. //    MUX_OK if successful
  328. //    MUX_ERR if unsuccesful
  329. int32_t mpegOutMP2MuxInitFile(mp2muxer_tt *muxer, struct mp2mux_ext_set_struct *ext_set, char *output);
  330. int32_t mpegOutMP2MuxInitFileBS(mp2muxer_tt *muxer, struct mp2mux_ext_set_struct *ext_set, bufstream_tt *output);
  331. // call to add a video, audio or subpic stream to the muxer in file mode,
  332. //
  333. //  inputs:
  334. //    muxer - pointer to an mpeg muxer object
  335. //    set - pointer to a mp2mux_stream_set_struct structure
  336. //    input - pointer to a filename for the input data
  337. //    input1, input2 - input bufstreams, same file opened twice
  338. //    video_bitrate - bitrate (in bits/sec) of the video stream, only needed for MPEG-1 VBR or H264 video
  339. //            also used for AAC audio streams!
  340. //  outputs:
  341. //    none
  342. //  return:
  343. //    MUX_OK if successful
  344. //    MUX_ERR if unsuccesful
  345. int32_t mpegOutMP2MuxAddFile(mp2muxer_tt *muxer, struct mp2mux_stream_set_struct *set, char *input, int32_t video_bitrate);
  346. int32_t mpegOutMP2MuxAddFileBS(mp2muxer_tt *muxer, struct mp2mux_stream_set_struct *set, bufstream_tt *input1, bufstream_tt *input2, int32_t video_bitrate);
  347. // call to do the multiplexing in file mode
  348. // 
  349. //  inputs:
  350. //    muxer -  pointer to an mpeg muxer object
  351. //  outputs:
  352. //    muxed data to output file
  353. //  return:
  354. //    MUX_OK if succesful
  355. //    MUX_ERR if unsuccesful
  356. int32_t mpegOutMP2Mux(mp2muxer_tt *muxer);
  357. // call to finish a muxing session, set abort non-zero if muxing is being
  358. // aborted.
  359. //
  360. //  inputs:
  361. //    muxer - pointer to an mpeg muxer object
  362. //    abort - set to 0 to finish any leftover muxing and clean up,
  363. //        else just clean up
  364. //  outputs:
  365. //    muxed data to output file if needed
  366. //  return:
  367. //    MUX_OK if successful
  368. //    MUX_ERR if unsuccesful
  369. int32_t mpegOutMP2MuxDone(mp2muxer_tt *muxer, int32_t abort);
  370. // call to free an mpeg muxer object
  371. //
  372. //  inputs:
  373. //    muxer - muxer object to free
  374. //  outputs:
  375. //    none
  376. //  return:
  377. //    none
  378. void mpegOutMP2MuxFree(mp2muxer_tt *muxer);
  379. // call to get the setting errors/warnings in an mp2muxer_set_struct structure
  380. // use with the get_rc callback to provide an err_printf callback to get
  381. // error messages that can be localized
  382. //
  383. //  inputs:
  384. //    get_rc - pointer to a get_rc function
  385. //    set - pointer to an mp2muxer_set_struct structure
  386. //    options - check options, one or more of the CHECK_* defines in mcdefs.h
  387. //    app - reserved
  388. //  outputs:
  389. //    none
  390. //  return:
  391. //    MUX_OK if no errors found
  392. //    one of the INV_* error codes if an error is found
  393. int32_t mpegOutMP2MuxChkSettings(void *(*get_rc)(char *name), const struct mp2muxer_set_struct *set, uint32_t options, void *app);
  394. // call to send messages to the muxer
  395. //
  396. //  inputs:
  397. //    muxer -  pointer to an mpeg muxer object
  398. //    offs - value is dependent on the message
  399. //    info_ID - the message to process
  400. //    info_ptr - pointer, dependent on the message
  401. //    info_size - size of the structure pointed to by info_ptr
  402. //  outputs:
  403. //    none
  404. //  return:
  405. //    none
  406. void mpegOutMP2MuxAuxinfo(mp2muxer_tt *muxer, int32_t offs, int32_t info_ID, void *info_ptr, int32_t info_size);
  407. // call to create a new TS program 
  408. // 
  409. // inputs: 
  410. //    muxer -  pointer to an mpeg muxer object
  411. //    program_set - pointer to the program's settings structure
  412. // return: 
  413. //      MUX_OK if all is ok
  414. //      MUX_ERR if any error occured
  415. int32_t mpegOutMP2MuxAddProgram(mp2muxer_tt *muxer, struct mp2mux_ts_program_set_struct *program_set);
  416. // call to load a descriptor into an SI table
  417. // muxer -  pointer to an mpeg muxer object
  418. // descriptor - pointer to the descriptor struct with all necessary info
  419. // outputs: 
  420. //      none
  421. // return: 
  422. //      MUX_OK if success, MUX_ERR otherwise
  423. int32_t mpegOutMP2MuxLoadDescriptor(mp2muxer_tt* muxer, const si_descriptor_struct* descriptor);
  424. // Not implemented yet!
  425. // call to load an Entry into an SI table
  426. // muxer -  pointer to an mpeg muxer object
  427. // ts_entry - pointer to the entry struct with all necessary info
  428. // outputs: 
  429. //      none
  430. // return: 
  431. //      MUX_OK if success, MUX_ERR otherwise
  432. int32_t mpegOutMP2MuxLoadEntry(mp2muxer_tt* muxer, const si_entry_struct* entry);
  433. // Not implemented yet!
  434. // call to load a complete SI section
  435. // muxer -  pointer to an mpeg muxer object
  436. // table - pointer to the descriptor struct with all necessary info
  437. // outputs: 
  438. //      none
  439. // return: 
  440. //      MUX_OK if success, MUX_ERR otherwise
  441. int32_t mpegOutMP2MuxLoadSection(mp2muxer_tt* muxer, const si_section_struct* descriptor);
  442. // call to commit loading of the descriptors / entries / sections set
  443. // muxer -  pointer to an mpeg muxer object
  444. // commit_struct - pointer to the si_commit_struct with timing parameters declaring the moment of the new PSI info applying
  445. // If target_time_PCR == -1, then parameters are applied immediately
  446. // outputs: 
  447. //      none
  448. // return: 
  449. //      MUX_OK if success, MUX_ERR otherwise
  450. int32_t mpegOutMP2MuxCommitPSI(mp2muxer_tt* muxer, const si_commit_struct* commit_struct);
  451. //call to start streaming.
  452. //return: 
  453. //      MUX_OK if success, MUX_ERR otherwise
  454. int32_t mpegOutMP2MuxRun(mp2muxer_tt *muxer);
  455. // call to fill an mp2mux_ext_set_struct structure with defaults values
  456. // based on one of the SDK profile ID's
  457. // 
  458. //  inputs:
  459. //    ProfileID - one of the MC profiles as defined in mcprofiles.h
  460. //  output:
  461. //    modified mp2mux_ext_set_struct structure
  462. //  return:
  463. //    none
  464. char *mpegOutMP2MuxDefaultsExt(struct mp2mux_ext_set_struct *set, int32_t profileID);
  465. // call to check whether the given stream is allowed for multiplexing into the specific TS profile
  466. //  mc_stream_format_t as defined in mcmediatypes.h
  467. //  one of the MPEG_ defines in mpegdef.h 
  468. int32_t mpegOutMP2MuxCheckConnect(void *(*get_rc)(char* name), mc_stream_format_t *pFormat, int32_t mplex_type, void* pExt);
  469. // call to change the parameters "on-the-fly". 
  470. // The parameters allowed to be modified are presented in the mp2mux_rt_set struct
  471. int32_t mpegOutMP2MuxRuntimeConfig(mp2muxer_tt *muxer, const mp2mux_rt_set* set, const uint32_t option_flags);
  472. // call to get extended API function
  473. //
  474. //  inputs: 
  475. //    func - function ID
  476. //  return: 
  477. //    function pointer or NULL
  478. APIEXTFUNC mpegOutMP2MuxGetAPIExt(uint32_t func);
  479. #ifdef __cplusplus
  480. }
  481. #endif
  482. #endif // #if !defined (__MUX_MP2_API_INCLUDED__)