Shaka Packager SDK
es_parser_h265.h
1 // Copyright 2016 Google Inc. 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 <stdint.h>
11 
12 #include <list>
13 #include <memory>
14 #include <utility>
15 
16 #include "packager/base/callback.h"
17 #include "packager/base/compiler_specific.h"
18 #include "packager/media/formats/mp2t/es_parser_h26x.h"
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  // Callback to pass the stream configuration.
46  NewStreamInfoCB new_stream_info_cb_;
47 
48  // Last video decoder config.
49  std::shared_ptr<StreamInfo> last_video_decoder_config_;
50  bool decoder_config_check_pending_;
51 
52  std::unique_ptr<H265Parser> h265_parser_;
53 };
54 
55 } // namespace mp2t
56 } // namespace media
57 } // namespace shaka
58 
59 #endif // PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
shaka::media::Nalu
Definition: nalu_reader.h:27
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::media::mp2t::EsParserH265
Definition: es_parser_h265.h:27
shaka::media::mp2t::EsParserH26x::VideoSliceInfo
Definition: es_parser_h26x.h:42
shaka::media::mp2t::EsParserH26x
Definition: es_parser_h26x.h:28