2023-12-01 17:32:19 +00:00
|
|
|
// Copyright 2016 Google LLC. All rights reserved.
|
2016-03-31 19:48:16 +00:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#ifndef PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
|
|
|
|
#define PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
|
2016-03-31 19:48:16 +00:00
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
#include <cstdint>
|
|
|
|
#include <functional>
|
2016-03-31 19:48:16 +00:00
|
|
|
#include <list>
|
2016-08-17 17:41:40 +00:00
|
|
|
#include <memory>
|
2016-03-31 19:48:16 +00:00
|
|
|
#include <utility>
|
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
#include <packager/macros/classes.h>
|
|
|
|
#include <packager/media/formats/mp2t/es_parser_h26x.h>
|
|
|
|
#include <functional>
|
2016-03-31 19:48:16 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2016-03-31 19:48:16 +00:00
|
|
|
namespace media {
|
|
|
|
|
|
|
|
class H265Parser;
|
|
|
|
|
|
|
|
namespace mp2t {
|
|
|
|
|
|
|
|
class EsParserH265 : public EsParserH26x {
|
|
|
|
public:
|
|
|
|
EsParserH265(uint32_t pid,
|
|
|
|
const NewStreamInfoCB& new_stream_info_cb,
|
|
|
|
const EmitSampleCB& emit_sample_cb);
|
|
|
|
~EsParserH265() override;
|
|
|
|
|
|
|
|
// EsParserH26x implementation override.
|
|
|
|
void Reset() override;
|
|
|
|
|
|
|
|
private:
|
2016-08-25 22:44:25 +00:00
|
|
|
// Processes a NAL unit found in ParseInternal.
|
|
|
|
bool ProcessNalu(const Nalu& nalu, VideoSliceInfo* video_slice_info) override;
|
2016-03-31 19:48:16 +00:00
|
|
|
|
|
|
|
// Update the video decoder config based on an H264 SPS.
|
|
|
|
// Return true if successful.
|
|
|
|
bool UpdateVideoDecoderConfig(int sps_id) override;
|
|
|
|
|
2022-10-28 03:22:17 +00:00
|
|
|
int64_t CalculateSampleDuration(int pps_id) override;
|
2016-03-31 19:48:16 +00:00
|
|
|
// Callback to pass the stream configuration.
|
|
|
|
NewStreamInfoCB new_stream_info_cb_;
|
|
|
|
|
|
|
|
// Last video decoder config.
|
2017-01-24 00:55:02 +00:00
|
|
|
std::shared_ptr<StreamInfo> last_video_decoder_config_;
|
2016-03-31 19:48:16 +00:00
|
|
|
bool decoder_config_check_pending_;
|
|
|
|
|
2016-08-17 17:41:40 +00:00
|
|
|
std::unique_ptr<H265Parser> h265_parser_;
|
2016-03-31 19:48:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mp2t
|
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2016-03-31 19:48:16 +00:00
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#endif // PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_H265_H_
|