blob: 86ce192e49dd8530a2bf998e3ef9525e5db6cd14 [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_
Mirko Bonadei9d9c2d52022-10-07 21:47:49 +000013
Kári Tristan Helgasonb1633592019-03-22 11:19:08 +010014#include <stddef.h>
15#include <stdint.h>
16
Mirko Bonadei9d9c2d52022-10-07 21:47:49 +000017#include "absl/types/optional.h"
Kári Tristan Helgasonb1633592019-03-22 11:19:08 +010018#include "api/array_view.h"
19
20namespace webrtc {
21
22// This class is an interface for bitstream parsers.
23class BitstreamParser {
24 public:
25 virtual ~BitstreamParser() = default;
26
27 // Parse an additional chunk of the bitstream.
28 virtual void ParseBitstream(rtc::ArrayView<const uint8_t> bitstream) = 0;
29
30 // Get the last extracted QP value from the parsed bitstream. If no QP
31 // value could be parsed, returns absl::nullopt.
32 virtual absl::optional<int> GetLastSliceQp() const = 0;
33};
34
35} // namespace webrtc
36
37#endif // API_VIDEO_CODECS_BITSTREAM_PARSER_H_