blob: 0d8d014d62620cf07e5cca150e0dfacbdc56c4b7 [file] [log] [blame]
Kári Tristan Helgasonb1633592019-03-22 11:19:08 +01001/*
2 * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_VIDEO_CODECS_BITSTREAM_PARSER_H_
12#define API_VIDEO_CODECS_BITSTREAM_PARSER_H_
13#include <stddef.h>
14#include <stdint.h>
15
16#include "api/array_view.h"
17
18namespace webrtc {
19
20// This class is an interface for bitstream parsers.
21class BitstreamParser {
22 public:
23 virtual ~BitstreamParser() = default;
24
25 // Parse an additional chunk of the bitstream.
26 virtual void ParseBitstream(rtc::ArrayView<const uint8_t> bitstream) = 0;
27
28 // Get the last extracted QP value from the parsed bitstream. If no QP
29 // value could be parsed, returns absl::nullopt.
30 virtual absl::optional<int> GetLastSliceQp() const = 0;
31};
32
33} // namespace webrtc
34
35#endif // API_VIDEO_CODECS_BITSTREAM_PARSER_H_