funcprotos.h
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:9k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. #ifndef FUNCPROTOS_H
  2. #define FUNCPROTOS_H
  3. /* atom handling routines */
  4. long quicktime_atom_read_size(char *data);
  5. u_int64_t quicktime_atom_read_size64(char *data);
  6. quicktime_trak_t* quicktime_add_track(quicktime_moov_t *moov);
  7. quicktime_trak_t* quicktime_find_track_by_id(quicktime_moov_t *moov, int trackId);
  8. /* initializers for every atom */
  9. int quicktime_matrix_init(quicktime_matrix_t *matrix);
  10. int quicktime_edts_init_table(quicktime_edts_t *edts);
  11. int quicktime_edts_init(quicktime_edts_t *edts);
  12. int quicktime_elst_init(quicktime_elst_t *elst);
  13. int quicktime_elst_init_all(quicktime_elst_t *elst);
  14. int quicktime_elst_table_init(quicktime_elst_table_t *table); /* initialize a table */
  15. int quicktime_tkhd_init(quicktime_tkhd_t *tkhd);
  16. int quicktime_tkhd_init_video(quicktime_t *file, quicktime_tkhd_t *tkhd, int frame_w, int frame_h);
  17. int quicktime_ctab_init(quicktime_ctab_t *ctab);
  18. int quicktime_mjqt_init(quicktime_mjqt_t *mjqt);
  19. int quicktime_mjht_init(quicktime_mjht_t *mjht);
  20. int quicktime_stsd_table_init(quicktime_stsd_table_t *table);
  21. int quicktime_stsd_init(quicktime_stsd_t *stsd);
  22. int quicktime_stsd_init_table(quicktime_stsd_t *stsd);
  23. int quicktime_stsd_init_video(quicktime_t *file, quicktime_stsd_t *stsd, int frame_w, int frame_h, float frame_rate, char *compression);
  24. int quicktime_stsd_init_audio(quicktime_t *file, quicktime_stsd_t *stsd, int channels, int sample_rate, int bits, char *compressor);
  25. int quicktime_stts_init(quicktime_stts_t *stts);
  26. int quicktime_stts_init_table(quicktime_stts_t *stts);
  27. int quicktime_stts_init_video(quicktime_t *file, quicktime_stts_t *stts, int time_scale, float frame_rate);
  28. int quicktime_stts_init_audio(quicktime_t *file, quicktime_stts_t *stts, int time_scale, int sample_duration);
  29. int quicktime_stts_init_hint(quicktime_t *file, quicktime_stts_t *stts, int sample_duration);
  30. int quicktime_stss_init(quicktime_stss_t *stss);
  31. int quicktime_stss_init_common(quicktime_t *file, quicktime_stss_t *stss);
  32. int quicktime_stsc_init(quicktime_stsc_t *stsc);
  33. int quicktime_stsc_init_video(quicktime_t *file, quicktime_stsc_t *stsc);
  34. int quicktime_stsc_init_audio(quicktime_t *file, quicktime_stsc_t *stsc);
  35. int quicktime_stsz_init(quicktime_stsz_t *stsz);
  36. int quicktime_stsz_init_video(quicktime_t *file, quicktime_stsz_t *stsz);
  37. int quicktime_stsz_init_audio(quicktime_t *file, quicktime_stsz_t *stsz, int sample_size);
  38. int quicktime_stco_init(quicktime_stco_t *stco);
  39. int quicktime_stco_init_common(quicktime_t *file, quicktime_stco_t *stco);
  40. int quicktime_stbl_init(quicktime_stbl_t *tkhd);
  41. int quicktime_stbl_init_video(quicktime_t *file, quicktime_stbl_t *stbl, int frame_w, int frame_h, int time_scale, float frame_rate, char *compressor);
  42. int quicktime_stbl_init_audio(quicktime_t *file, quicktime_stbl_t *stbl, int channels, int sample_rate, int bits, int sample_size, int time_scale, int sample_duration, char *compressor);
  43. int quicktime_stbl_init_hint(quicktime_t *file, quicktime_stbl_t *stbl, quicktime_trak_t *refTrak, int maxPktSize, int timeScale, int sampleDuration);
  44. int quicktime_vmhd_init(quicktime_vmhd_t *vmhd);
  45. int quicktime_vmhd_init_video(quicktime_t *file, quicktime_vmhd_t *vmhd, int frame_w, int frame_h, float frame_rate);
  46. int quicktime_smhd_init(quicktime_smhd_t *smhd);
  47. int quicktime_dref_table_init(quicktime_dref_table_t *table);
  48. int quicktime_dref_init_all(quicktime_dref_t *dref);
  49. int quicktime_dref_init(quicktime_dref_t *dref);
  50. int quicktime_dinf_init_all(quicktime_dinf_t *dinf);
  51. int quicktime_dinf_init(quicktime_dinf_t *dinf);
  52. int quicktime_minf_init(quicktime_minf_t *minf);
  53. int quicktime_minf_init_video(quicktime_t *file, quicktime_minf_t *minf, int frame_w, int frame_h, int time_scale, float frame_rate, char *compressor);
  54. int quicktime_minf_init_audio(quicktime_t *file, quicktime_minf_t *minf, int channels, int sample_rate, int bits, int sample_size, int time_scale, int sample_duration, char *compressor);
  55. int quicktime_minf_init_hint(quicktime_t *file, quicktime_minf_t *minf, quicktime_trak_t *refTrak, int maxPktSize, int timeScale, int sampleDuration);
  56. int quicktime_mdhd_init(quicktime_mdhd_t *mdhd);
  57. int quicktime_mdhd_init_video(quicktime_t *file, quicktime_mdhd_t *mdhd, int time_scale);
  58. int quicktime_mdhd_init_audio(quicktime_t *file, quicktime_mdhd_t *mdhd, int time_scale);
  59. int quicktime_mdia_init(quicktime_mdia_t *mdia);
  60. int quicktime_mdia_init_video(quicktime_t *file, quicktime_mdia_t *mdia, int frame_w, int frame_h, float frame_rate, int time_scale, char *compressor);
  61. int quicktime_mdia_init_audio(quicktime_t *file, quicktime_mdia_t *mdia, int channels, int sample_rate, int bits, int sample_size, int time_scale, int sample_duration, char *compressor);
  62. int quicktime_mdia_init_hint(quicktime_t *file, quicktime_mdia_t *mdia, quicktime_trak_t *refTrak, int maxPktSize, int time_scale, int sampleDuration);
  63. int quicktime_trak_init(quicktime_trak_t *trak);
  64. int quicktime_trak_init_video(quicktime_t *file, quicktime_trak_t *trak, int frame_w, int frame_h, float frame_rate, int time_scale, char *compressor);
  65. int quicktime_trak_init_audio(quicktime_t *file, quicktime_trak_t *trak, int channels, int sample_rate, int bits, int sample_size, int time_scale, int sample_duration, char *compressor);
  66. int quicktime_trak_init_hint(quicktime_t *file, quicktime_trak_t *trak, quicktime_trak_t *refTrak, int maxPktSize, int time_scale, int sample_duration);
  67. int quicktime_tref_init(quicktime_tref_t *tref);
  68. int quicktime_tref_init_hint(quicktime_tref_t *tref, quicktime_trak_t *refTrak);
  69. int quicktime_udta_init(quicktime_udta_t *udta);
  70. int quicktime_mvhd_init(quicktime_mvhd_t *mvhd);
  71. int quicktime_moov_init(quicktime_moov_t *moov);
  72. int quicktime_mdat_init(quicktime_mdat_t *mdat);
  73. int quicktime_init(quicktime_t *file);
  74. int quicktime_hdlr_init(quicktime_hdlr_t *hdlr);
  75. int quicktime_hdlr_init_video(quicktime_hdlr_t *hdlr);
  76. int quicktime_hdlr_init_audio(quicktime_hdlr_t *hdlr);
  77. int quicktime_hdlr_init_data(quicktime_hdlr_t *hdlr);
  78. /* utilities for reading data types */
  79. int quicktime_read_data(quicktime_t *file, char *data, int size);
  80. int quicktime_write_data(quicktime_t *file, char *data, int size);
  81. int quicktime_read_pascal(quicktime_t *file, char *data);
  82. int quicktime_write_pascal(quicktime_t *file, char *data);
  83. float quicktime_read_fixed32(quicktime_t *file);
  84. int quicktime_write_fixed32(quicktime_t *file, float number);
  85. float quicktime_read_fixed16(quicktime_t *file);
  86. int quicktime_write_fixed16(quicktime_t *file, float number);
  87. u_int64_t quicktime_read_int64(quicktime_t *file);
  88. int quicktime_write_int64(quicktime_t *file, u_int64_t number);
  89. long quicktime_read_int32(quicktime_t *file);
  90. int quicktime_write_int32(quicktime_t *file, long number);
  91. long quicktime_read_int24(quicktime_t *file);
  92. int quicktime_write_int24(quicktime_t *file, long number);
  93. int quicktime_read_int16(quicktime_t *file);
  94. int quicktime_write_int16(quicktime_t *file, int number);
  95. int quicktime_read_char(quicktime_t *file);
  96. int quicktime_write_char(quicktime_t *file, char x);
  97. int quicktime_read_char32(quicktime_t *file, char *string);
  98. int quicktime_write_char32(quicktime_t *file, char *string);
  99. int quicktime_copy_char32(char *output, char *input);
  100. long quicktime_position(quicktime_t *file);
  101. int quicktime_read_mp4_descr_length(quicktime_t *file);
  102. int quicktime_write_mp4_descr_length(quicktime_t *file, int length, bool compact);
  103. /* Most codecs don't specify the actual number of bits on disk in the stbl. */
  104. /* Convert the samples to the number of bytes for reading depending on the codec. */
  105. long quicktime_samples_to_bytes(quicktime_trak_t *track, long samples);
  106. /* chunks always start on 1 */
  107. /* samples start on 0 */
  108. /* queries for every atom */
  109. /* the starting sample in the given chunk */
  110. long quicktime_sample_of_chunk(quicktime_trak_t *trak, long chunk);
  111. /* number of samples in the chunk */
  112. long quicktime_chunk_samples(quicktime_trak_t *trak, long chunk);
  113. /* the byte offset from mdat start of the chunk */
  114. long quicktime_chunk_to_offset(quicktime_trak_t *trak, long chunk);
  115. /* the chunk of any offset from mdat start */
  116. long quicktime_offset_to_chunk(long *chunk_offset, quicktime_trak_t *trak, long offset);
  117. /* the total number of samples in the track depending on the access mode */
  118. long quicktime_track_samples(quicktime_t *file, quicktime_trak_t *trak);
  119. /* total bytes between the two samples */
  120. long quicktime_sample_range_size(quicktime_trak_t *trak, long chunk_sample, long sample);
  121. /* update the position pointers in all the tracks after a set_position */
  122. int quicktime_update_positions(quicktime_t *file);
  123. /* converting between mdat offsets to samples */
  124. long quicktime_sample_to_offset(quicktime_trak_t *trak, long sample);
  125. long quicktime_offset_to_sample(quicktime_trak_t *trak, long offset);
  126. quicktime_trak_t* quicktime_add_trak(quicktime_moov_t *moov);
  127. int quicktime_delete_trak(quicktime_moov_t *moov, quicktime_trak_t *trak);
  128. int quicktime_get_timescale(float frame_rate);
  129. /* update all the tables after writing a buffer */
  130. /* set sample_size to 0 if no sample size should be set */
  131. int quicktime_update_tables(quicktime_t *file, 
  132. quicktime_trak_t *trak, 
  133. long offset, 
  134. long chunk, 
  135. long sample, 
  136. long samples, 
  137. long sample_size,
  138. long sample_duration,
  139. u_char isSyncSample,
  140. long renderingOffset);
  141. unsigned long quicktime_current_time();
  142. #endif