edts.c
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. #include "quicktime.h"
  2. int quicktime_edts_init(quicktime_edts_t *edts)
  3. {
  4. quicktime_elst_init(&(edts->elst));
  5. }
  6. int quicktime_edts_delete(quicktime_edts_t *edts)
  7. {
  8. quicktime_elst_delete(&(edts->elst));
  9. }
  10. int quicktime_edts_init_table(quicktime_edts_t *edts)
  11. {
  12. quicktime_elst_init_all(&(edts->elst));
  13. }
  14. int quicktime_read_edts(quicktime_t *file, quicktime_edts_t *edts, quicktime_atom_t *edts_atom)
  15. {
  16. quicktime_atom_t leaf_atom;
  17. do
  18. {
  19. quicktime_atom_read_header(file, &leaf_atom);
  20. if(quicktime_atom_is(&leaf_atom, "elst"))
  21. { quicktime_read_elst(file, &(edts->elst)); }
  22. else
  23. quicktime_atom_skip(file, &leaf_atom);
  24. }while(quicktime_position(file) < edts_atom->end);
  25. }
  26. int quicktime_edts_dump(quicktime_edts_t *edts)
  27. {
  28. printf("  edit atom (edts)n");
  29. quicktime_elst_dump(&(edts->elst));
  30. }
  31. int quicktime_write_edts(quicktime_t *file, quicktime_edts_t *edts, long duration)
  32. {
  33. quicktime_atom_t atom;
  34. quicktime_atom_write_header(file, &atom, "edts");
  35. quicktime_write_elst(file, &(edts->elst), duration);
  36. quicktime_atom_write_footer(file, &atom);
  37. }