Shaka Packager SDK
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 <functional>
12 #include <list>
13 #include <memory>
14 #include <utility>
15 
16 #include <packager/macros/classes.h>
17 #include <packager/media/formats/mp2t/es_parser_h26x.h>
18 #include <functional>
19 
20 namespace shaka {
21 namespace media {
22 
23 class H265Parser;
24 
25 namespace mp2t {
26 
27 class EsParserH265 : public EsParserH26x {
28  public:
29  EsParserH265(uint32_t pid,
30  const NewStreamInfoCB& new_stream_info_cb,
31  const EmitSampleCB& emit_sample_cb);
32  ~EsParserH265() override;
33 
34  // EsParserH26x implementation override.
35  void Reset() override;
36 
37  private:
38  // Processes a NAL unit found in ParseInternal.
39  bool ProcessNalu(const Nalu& nalu, VideoSliceInfo* video_slice_info) override;
40 
41  // Update the video decoder config based on an H264 SPS.
42  // Return true if successful.
43  bool UpdateVideoDecoderConfig(int sps_id) override;
44 
45  int64_t CalculateSampleDuration(int pps_id) override;
46  // Callback to pass the stream configuration.
47  NewStreamInfoCB new_stream_info_cb_;
48 
49  // Last video decoder config.
50  std::shared_ptr<StreamInfo> last_video_decoder_config_;
51  bool decoder_config_check_pending_;
52 
53  std::unique_ptr<H265Parser> h265_parser_;
54 };
55 
56 } // namespace mp2t
57 } // namespace media
58 } // namespace shaka
59 
60 #endif // PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66