7 #ifndef PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
8 #define PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
16 #include <absl/synchronization/mutex.h>
18 #include <packager/hls/base/hls_notifier.h>
19 #include <packager/hls/base/master_playlist.h>
20 #include <packager/hls/base/media_playlist.h>
21 #include <packager/hls_params.h>
22 #include <packager/macros/classes.h>
32 virtual std::unique_ptr<MediaPlaylist> Create(
const HlsParams& hls_params,
33 const std::string& file_name,
34 const std::string& name,
35 const std::string& group_id);
49 const std::string& playlist_name,
50 const std::string& stream_name,
51 const std::string& group_id,
52 uint32_t* stream_id)
override;
54 int32_t sample_duration)
override;
56 const std::string& segment_name,
59 uint64_t start_byte_offset,
60 uint64_t size)
override;
63 uint64_t start_byte_offset,
64 uint64_t size)
override;
65 bool NotifyCueEvent(uint32_t container_id, int64_t timestamp)
override;
68 const std::vector<uint8_t>& key_id,
69 const std::vector<uint8_t>& system_id,
70 const std::vector<uint8_t>& iv,
71 const std::vector<uint8_t>& protection_system_specific_data)
override;
72 bool Flush()
override;
79 std::unique_ptr<MediaPlaylist> media_playlist;
80 MediaPlaylist::EncryptionMethod encryption_method;
83 std::string master_playlist_dir_;
84 int32_t target_duration_ = 0;
86 std::unique_ptr<MediaPlaylistFactory> media_playlist_factory_;
87 std::unique_ptr<MasterPlaylist> master_playlist_;
90 std::map<uint32_t, std::unique_ptr<StreamEntry>> stream_map_;
91 std::list<MediaPlaylist*> media_playlists_;
93 uint32_t sequence_number_ = 0;
const HlsParams & hls_params() const
bool NotifyNewSegment(uint32_t stream_id, const std::string &segment_name, int64_t start_time, int64_t duration, uint64_t start_byte_offset, uint64_t size) override
SimpleHlsNotifier(const HlsParams &hls_params)
bool NotifyNewStream(const MediaInfo &media_info, const std::string &playlist_name, const std::string &stream_name, const std::string &group_id, uint32_t *stream_id) override
bool NotifyKeyFrame(uint32_t stream_id, int64_t timestamp, uint64_t start_byte_offset, uint64_t size) override
friend class SimpleHlsNotifierTest
}@
bool NotifyEncryptionUpdate(uint32_t stream_id, const std::vector< uint8_t > &key_id, const std::vector< uint8_t > &system_id, const std::vector< uint8_t > &iv, const std::vector< uint8_t > &protection_system_specific_data) override
bool NotifyCueEvent(uint32_t container_id, int64_t timestamp) override
bool NotifySampleDuration(uint32_t stream_id, int32_t sample_duration) override
All the methods that are virtual are virtual for mocking.