Shaka Packager SDK
Loading...
Searching...
No Matches
es_parser_h265.h
1// Copyright 2016 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
8#define PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
9
10#include <cstdint>
11#include <memory>
12
13#include <packager/media/codecs/nalu_reader.h>
14#include <packager/media/formats/mp2t/es_parser.h>
15#include <packager/media/formats/mp2t/es_parser_h26x.h>
16
17namespace shaka {
18namespace media {
19
20class H265Parser;
21
22namespace mp2t {
23
24class EsParserH265 : public EsParserH26x {
25 public:
26 EsParserH265(uint32_t pid,
27 const NewStreamInfoCB& new_stream_info_cb,
28 const EmitSampleCB& emit_sample_cb);
29 ~EsParserH265() override;
30
31 // EsParserH26x implementation override.
32 void Reset() override;
33
34 private:
35 // Processes a NAL unit found in ParseInternal.
36 bool ProcessNalu(const Nalu& nalu, VideoSliceInfo* video_slice_info) override;
37
38 // Update the video decoder config based on an H264 SPS.
39 // Return true if successful.
40 bool UpdateVideoDecoderConfig(int sps_id) override;
41
42 int64_t CalculateSampleDuration(int pps_id) override;
43 // Callback to pass the stream configuration.
44 NewStreamInfoCB new_stream_info_cb_;
45
46 // Last video decoder config.
47 std::shared_ptr<StreamInfo> last_video_decoder_config_;
48 bool decoder_config_check_pending_;
49
50 std::unique_ptr<H265Parser> h265_parser_;
51};
52
53} // namespace mp2t
54} // namespace media
55} // namespace shaka
56
57#endif // PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
All the methods that are virtual are virtual for mocking.