descriptors.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * The contents of this file are subject to the Mozilla Public
  3. * License Version 1.1 (the "License"); you may not use this file
  4. * except in compliance with the License. You may obtain a copy of
  5. * the License at http://www.mozilla.org/MPL/
  6. *
  7. * Software distributed under the License is distributed on an "AS
  8. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9. * implied. See the License for the specific language governing
  10. * rights and limitations under the License.
  11. *
  12. * The Original Code is MPEG4IP.
  13. *
  14. * The Initial Developer of the Original Code is Cisco Systems Inc.
  15. * Portions created by Cisco Systems Inc. are
  16. * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved.
  17. *
  18. * Contributor(s):
  19. * Dave Mackie [email protected]
  20. */
  21. #ifndef __DESCRIPTORS_INCLUDED__
  22. #define __DESCRIPTORS_INCLUDED__
  23. const u_int8_t MP4ODescrTag = 0x01;
  24. const u_int8_t MP4IODescrTag = 0x02;
  25. const u_int8_t MP4ESDescrTag = 0x03;
  26. const u_int8_t MP4DecConfigDescrTag = 0x04;
  27. const u_int8_t MP4DecSpecificDescrTag = 0x05;
  28. const u_int8_t MP4SLConfigDescrTag = 0x06;
  29. const u_int8_t MP4ContentIdDescrTag = 0x07;
  30. const u_int8_t MP4SupplContentIdDescrTag = 0x08;
  31. const u_int8_t MP4IPIPtrDescrTag = 0x09;
  32. const u_int8_t MP4IPMPPtrDescrTag = 0x0A;
  33. const u_int8_t MP4IPMPDescrTag = 0x0B;
  34. const u_int8_t MP4RegistrationDescrTag = 0x0D;
  35. const u_int8_t MP4ESIDIncDescrTag = 0x0E;
  36. const u_int8_t MP4ESIDRefDescrTag = 0x0F;
  37. const u_int8_t MP4FileIODescrTag = 0x10;
  38. const u_int8_t MP4FileODescrTag = 0x11;
  39. const u_int8_t MP4ExtProfileLevelDescrTag = 0x13;
  40. const u_int8_t MP4ExtDescrTagsStart = 0x80;
  41. const u_int8_t MP4ExtDescrTagsEnd = 0xFE;
  42. class MP4BaseDescriptor : public MP4Descriptor {
  43. public:
  44. MP4BaseDescriptor(u_int8_t tag);
  45. };
  46. class MP4BytesDescriptor : public MP4Descriptor {
  47. public:
  48. MP4BytesDescriptor(u_int8_t tag);
  49. void Read(MP4File* pFile);
  50. protected:
  51. uint m_size_offset; // size to adjust the size for the bytes property
  52. uint m_bytes_index; // index into properties for bytes property
  53. };
  54. class MP4IODescriptor : public MP4Descriptor {
  55. public:
  56. MP4IODescriptor();
  57. void Generate();
  58. protected:
  59. void Mutate();
  60. };
  61. class MP4ODescriptor : public MP4Descriptor {
  62. public:
  63. MP4ODescriptor();
  64. void Generate();
  65. protected:
  66. void Mutate();
  67. };
  68. class MP4ESDescriptor : public MP4Descriptor {
  69. public:
  70. MP4ESDescriptor();
  71. protected:
  72. void Mutate();
  73. };
  74. class MP4DecConfigDescriptor : public MP4Descriptor {
  75. public:
  76. MP4DecConfigDescriptor();
  77. void Generate();
  78. };
  79. class MP4SLConfigDescriptor : public MP4Descriptor {
  80. public:
  81. MP4SLConfigDescriptor();
  82. void Generate();
  83. void Read(MP4File* pFile);
  84. protected:
  85. void Mutate();
  86. };
  87. class MP4IPIPtrDescriptor : public MP4Descriptor {
  88. public:
  89. MP4IPIPtrDescriptor();
  90. };
  91. class MP4ContentIdDescriptor : public MP4Descriptor {
  92. public:
  93. MP4ContentIdDescriptor();
  94. void Read(MP4File* pFile);
  95. protected:
  96. void Mutate();
  97. };
  98. // associated values in descriptors
  99. // ES objectTypeId
  100. const u_int8_t MP4SystemsV1ObjectType = 0x01;
  101. const u_int8_t MP4SystemsV2ObjectType = 0x02;
  102. // ES streamType
  103. const u_int8_t MP4ObjectDescriptionStreamType = 0x01;
  104. const u_int8_t MP4ClockReferenceStreamType = 0x02;
  105. const u_int8_t MP4SceneDescriptionStreamType = 0x03;
  106. const u_int8_t MP4VisualStreamType = 0x04;
  107. const u_int8_t MP4AudioStreamType = 0x05;
  108. const u_int8_t MP4Mpeg7StreamType = 0x06;
  109. const u_int8_t MP4IPMPStreamType = 0x07;
  110. const u_int8_t MP4OCIStreamType = 0x08;
  111. const u_int8_t MP4MPEGJStreamType = 0x09;
  112. const u_int8_t MP4UserPrivateStreamType = 0x20;
  113. #endif /* __DESCRIPTORS_INCLUDED__ */