You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.2 KiB

  1. using JT1078.FMp4.Interfaces;
  2. using JT1078.FMp4.MessagePack;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace JT1078.FMp4
  7. {
  8. /// <summary>
  9. /// traf
  10. /// </summary>
  11. public class TrackFragmentBox : Mp4Box, IFMp4MessagePackFormatter
  12. {
  13. /// <summary>
  14. /// traf
  15. /// </summary>
  16. public TrackFragmentBox() : base("traf")
  17. {
  18. }
  19. /// <summary>
  20. /// tfhd
  21. /// </summary>
  22. public TrackFragmentHeaderBox TrackFragmentHeaderBox { get; set; }
  23. /// <summary>
  24. /// sdtp
  25. /// </summary>
  26. public SampleDependencyTypeBox SampleDependencyTypeBox { get; set; }
  27. /// <summary>
  28. /// trun
  29. /// </summary>
  30. public TrackRunBox TrackRunBox { get; set; }
  31. /// <summary>
  32. /// tfdt
  33. /// </summary>
  34. public TrackFragmentBaseMediaDecodeTimeBox TrackFragmentBaseMediaDecodeTimeBox { get; set; }
  35. /// <summary>
  36. /// sbgp
  37. /// </summary>
  38. public SampleToGroupBox SampleToGroupBox { get; set; }
  39. /// <summary>
  40. /// subs
  41. /// </summary>
  42. public SubSampleInformationBox SubSampleInformationBox { get; set; }
  43. public void ToBuffer(ref FMp4MessagePackWriter writer)
  44. {
  45. Start(ref writer);
  46. if (TrackFragmentHeaderBox != null)
  47. {
  48. TrackFragmentHeaderBox.ToBuffer(ref writer);
  49. }
  50. if (SampleDependencyTypeBox != null)
  51. {
  52. SampleDependencyTypeBox.ToBuffer(ref writer);
  53. }
  54. if (TrackFragmentBaseMediaDecodeTimeBox != null)
  55. {
  56. TrackFragmentBaseMediaDecodeTimeBox.ToBuffer(ref writer);
  57. }
  58. if (TrackRunBox != null)
  59. {
  60. TrackRunBox.ToBuffer(ref writer);
  61. }
  62. if (SampleToGroupBox != null)
  63. {
  64. SampleToGroupBox.ToBuffer(ref writer);
  65. }
  66. if (SubSampleInformationBox != null)
  67. {
  68. SubSampleInformationBox.ToBuffer(ref writer);
  69. }
  70. End(ref writer);
  71. }
  72. }
  73. }