mp4container.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 __MP4_CONTAINER_INCLUDED__
  22. #define __MP4_CONTAINER_INCLUDED__
  23. // base class - container of mp4 properties
  24. class MP4Container {
  25. public:
  26. MP4Container() { }
  27. virtual ~MP4Container();
  28. void AddProperty(MP4Property* pProperty);
  29. virtual void Read(MP4File* pFile);
  30. virtual void Write(MP4File* pFile);
  31. MP4Property* GetProperty(u_int32_t index) {
  32. return m_pProperties[index];
  33. }
  34. // LATER MP4Property* GetProperty(const char* name); throw on error
  35. // LATER MP4Property* FindProperty(const char* name, u_int32_t* pIndex = NULL); returns NULL on error
  36. bool FindProperty(const char* name,
  37. MP4Property** ppProperty, u_int32_t* pIndex = NULL);
  38. void FindIntegerProperty(const char* name,
  39. MP4Property** ppProperty, u_int32_t* pIndex = NULL);
  40. u_int64_t GetIntegerProperty(const char* name);
  41. void SetIntegerProperty(const char* name, u_int64_t value);
  42. void FindFloatProperty(const char* name,
  43. MP4Property** ppProperty, u_int32_t* pIndex = NULL);
  44. float GetFloatProperty(const char* name);
  45. void SetFloatProperty(const char* name, float value);
  46. void FindStringProperty(const char* name,
  47. MP4Property** ppProperty, u_int32_t* pIndex = NULL);
  48. const char* GetStringProperty(const char* name);
  49. void SetStringProperty(const char* name, const char* value);
  50. void FindBytesProperty(const char* name,
  51. MP4Property** ppProperty, u_int32_t* pIndex = NULL);
  52. void GetBytesProperty(const char* name,
  53. u_int8_t** ppValue, u_int32_t* pValueSize);
  54. void SetBytesProperty(const char* name,
  55. const u_int8_t* pValue, u_int32_t valueSize);
  56. protected:
  57. MP4PropertyArray m_pProperties;
  58. };
  59. #endif /* __MP4_CONTAINER_INCLUDED__ */