Kári Tristan Helgason | b163359 | 2019-03-22 11:19:08 +0100 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 9d9c2d5 | 2022-10-07 21:47:49 +0000 | [diff] [blame] | 13 | |
Kári Tristan Helgason | b163359 | 2019-03-22 11:19:08 +0100 | [diff] [blame] | 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 | |
Mirko Bonadei | 9d9c2d5 | 2022-10-07 21:47:49 +0000 | [diff] [blame] | 17 | #include "absl/types/optional.h" |
Kári Tristan Helgason | b163359 | 2019-03-22 11:19:08 +0100 | [diff] [blame] | 18 | #include "api/array_view.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | // This class is an interface for bitstream parsers. |
| 23 | class 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_ |