Shaka Packager SDK
Loading...
Searching...
No Matches
hls_notifier.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_HLS_BASE_HLS_NOTIFIER_H_
8#define PACKAGER_HLS_BASE_HLS_NOTIFIER_H_
9
10#include <cstdint>
11#include <string>
12#include <vector>
13
14#include <packager/hls_params.h>
15#include <packager/mpd/base/media_info.pb.h>
16
17namespace shaka {
18namespace hls {
19
20// TODO(rkuroiwa): Consider merging this with MpdNotifier.
22 public:
23 explicit HlsNotifier(const HlsParams& hls_params) : hls_params_(hls_params) {}
24 virtual ~HlsNotifier() {}
25
28 virtual bool Init() = 0;
29
39 virtual bool NotifyNewStream(const MediaInfo& media_info,
40 const std::string& playlist_name,
41 const std::string& stream_name,
42 const std::string& group_id,
43 uint32_t* stream_id) = 0;
44
51 virtual bool NotifySampleDuration(uint32_t stream_id,
52 int32_t sample_duration) = 0;
53
62 virtual bool NotifyNewSegment(uint32_t stream_id,
63 const std::string& segment_name,
64 int64_t start_time,
65 int64_t duration,
66 uint64_t start_byte_offset,
67 uint64_t size) = 0;
68
75 virtual bool NotifyKeyFrame(uint32_t stream_id,
76 int64_t timestamp,
77 uint64_t start_byte_offset,
78 uint64_t size) = 0;
79
83 virtual bool NotifyCueEvent(uint32_t stream_id, int64_t timestamp) = 0;
84
94 uint32_t stream_id,
95 const std::vector<uint8_t>& key_id,
96 const std::vector<uint8_t>& system_id,
97 const std::vector<uint8_t>& iv,
98 const std::vector<uint8_t>& protection_system_specific_data) = 0;
99
102 virtual bool Flush() = 0;
103
105 const HlsParams& hls_params() const { return hls_params_; }
106
107 private:
108 const HlsParams hls_params_;
109};
110
111} // namespace hls
112} // namespace shaka
113
114#endif // PACKAGER_HLS_BASE_HLS_NOTIFIER_H_
virtual bool NotifyCueEvent(uint32_t stream_id, int64_t timestamp)=0
virtual 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)=0
virtual 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)=0
virtual 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)=0
virtual bool NotifySampleDuration(uint32_t stream_id, int32_t sample_duration)=0
virtual bool NotifyKeyFrame(uint32_t stream_id, int64_t timestamp, uint64_t start_byte_offset, uint64_t size)=0
virtual bool Flush()=0
virtual bool Init()=0
const HlsParams & hls_params() const
All the methods that are virtual are virtual for mocking.