mp4_status.h 965 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_FORMATS_MP4_MP4_STATUS_H_
  5. #define MEDIA_FORMATS_MP4_MP4_STATUS_H_
  6. #include "media/base/status.h"
  7. namespace media {
  8. struct MP4StatusTraits {
  9. enum class Codes : StatusCodeType {
  10. kOk = 0,
  11. kUnsupportedStream = 1,
  12. kFailedToParse = 2,
  13. // SPS and PPS are common to H264 and H265.
  14. kInvalidSPS = 3,
  15. kInvalidPPS = 4,
  16. kFailedToLookupSPS = 5,
  17. kFailedToLookupPPS = 6,
  18. // Slice headers are h264 only (I think, but we only have an h264 parser)
  19. kInvalidSliceHeader = 7,
  20. kBufferTooSmall = 8,
  21. };
  22. static constexpr StatusGroupType Group() { return "MP4Status"; }
  23. static constexpr Codes DefaultEnumValue() { return Codes::kOk; }
  24. };
  25. using MP4Status = TypedStatus<MP4StatusTraits>;
  26. } // namespace media
  27. #endif // MEDIA_FORMATS_MP4_MP4_STATUS_H_