7 #ifndef PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_ 8 #define PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_ 16 #include "packager/base/atomic_sequence_num.h" 17 #include "packager/base/macros.h" 18 #include "packager/base/synchronization/lock.h" 19 #include "packager/hls/base/hls_notifier.h" 20 #include "packager/hls/base/master_playlist.h" 21 #include "packager/hls/base/media_playlist.h" 22 #include "packager/hls/public/hls_params.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);
48 bool NotifyNewStream(
const MediaInfo& media_info,
49 const std::string& playlist_name,
50 const std::string& stream_name,
51 const std::string& group_id,
52 uint32_t* stream_id)
override;
53 bool NotifyNewSegment(uint32_t stream_id,
54 const std::string& segment_name,
57 uint64_t start_byte_offset,
58 uint64_t size)
override;
59 bool NotifyKeyFrame(uint32_t stream_id,
61 uint64_t start_byte_offset,
62 uint64_t size)
override;
63 bool NotifyCueEvent(uint32_t container_id, uint64_t timestamp)
override;
64 bool NotifyEncryptionUpdate(
66 const std::vector<uint8_t>& key_id,
67 const std::vector<uint8_t>& system_id,
68 const std::vector<uint8_t>& iv,
69 const std::vector<uint8_t>& protection_system_specific_data)
override;
70 bool Flush()
override;
74 friend class SimpleHlsNotifierTest;
77 std::unique_ptr<MediaPlaylist> media_playlist;
78 MediaPlaylist::EncryptionMethod encryption_method;
81 std::string output_dir_;
82 uint32_t target_duration_ = 0;
84 std::unique_ptr<MediaPlaylistFactory> media_playlist_factory_;
85 std::unique_ptr<MasterPlaylist> master_playlist_;
88 std::map<uint32_t, std::unique_ptr<StreamEntry>> stream_map_;
89 std::list<MediaPlaylist*> media_playlists_;
91 base::AtomicSequenceNumber sequence_number_;
101 #endif // PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
All the methods that are virtual are virtual for mocking.