summaryrefslogtreecommitdiff
path: root/chromium/media/formats/mp4/mp4_status.h
blob: 8238b462b121f087af8d03ad6a279a2482c761d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_FORMATS_MP4_MP4_STATUS_H_
#define MEDIA_FORMATS_MP4_MP4_STATUS_H_

#include "media/base/status.h"

namespace media {

struct MP4StatusTraits {
  enum class Codes : StatusCodeType {
    kOk = 0,
    kUnsupportedStream = 1,
    kFailedToParse = 2,

    // SPS and PPS are common to H264 and H265.
    kInvalidSPS = 3,
    kInvalidPPS = 4,
    kFailedToLookupSPS = 5,
    kFailedToLookupPPS = 6,

    // Slice headers are h264 only (I think, but we only have an h264 parser)
    kInvalidSliceHeader = 7,

    kBufferTooSmall = 8,
  };
  static constexpr StatusGroupType Group() { return "MP4Status"; }
  static constexpr Codes DefaultEnumValue() { return Codes::kOk; }
};

using MP4Status = TypedStatus<MP4StatusTraits>;

}  // namespace media

#endif  // MEDIA_FORMATS_MP4_MP4_STATUS_H_