bitstream_parser.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef API_VIDEO_CODECS_BITSTREAM_PARSER_H_
  11. #define API_VIDEO_CODECS_BITSTREAM_PARSER_H_
  12. #include <stddef.h>
  13. #include <stdint.h>
  14. #include "api/array_view.h"
  15. namespace webrtc {
  16. // This class is an interface for bitstream parsers.
  17. class BitstreamParser {
  18. public:
  19. virtual ~BitstreamParser() = default;
  20. // Parse an additional chunk of the bitstream.
  21. virtual void ParseBitstream(rtc::ArrayView<const uint8_t> bitstream) = 0;
  22. // Get the last extracted QP value from the parsed bitstream. If no QP
  23. // value could be parsed, returns absl::nullopt.
  24. virtual absl::optional<int> GetLastSliceQp() const = 0;
  25. };
  26. } // namespace webrtc
  27. #endif // API_VIDEO_CODECS_BITSTREAM_PARSER_H_