Shaka Packager SDK
mpd_notifier.h
1 // Copyright 2014 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 // MpdNotifier is responsible for notifying the MpdBuilder class to generate an
8 // MPD file.
9 
10 #ifndef MPD_BASE_MPD_NOTIFIER_H_
11 #define MPD_BASE_MPD_NOTIFIER_H_
12 
13 #include <stdint.h>
14 #include <string>
15 #include <vector>
16 
17 #include "packager/base/macros.h"
18 #include "packager/mpd/base/mpd_options.h"
19 
20 namespace shaka {
21 
22 class MediaInfo;
23 struct ContentProtectionElement;
24 
27 class MpdNotifier {
28  public:
29  explicit MpdNotifier(const MpdOptions& mpd_options)
30  : mpd_options_(mpd_options) {}
31  virtual ~MpdNotifier() {}
32 
36  virtual bool Init() = 0;
37 
46  virtual bool NotifyNewContainer(const MediaInfo& media_info,
47  uint32_t* container_id) = 0;
48 
56  virtual bool NotifySampleDuration(uint32_t container_id,
57  uint32_t sample_duration) = 0;
58 
69  virtual bool NotifyNewSegment(uint32_t container_id,
70  uint64_t start_time,
71  uint64_t duration,
72  uint64_t size) = 0;
73 
79  virtual bool NotifyCueEvent(uint32_t container_id, uint64_t timestamp) = 0;
80 
90  virtual bool NotifyEncryptionUpdate(uint32_t container_id,
91  const std::string& drm_uuid,
92  const std::vector<uint8_t>& new_key_id,
93  const std::vector<uint8_t>& new_pssh) = 0;
94 
99  virtual bool NotifyMediaInfoUpdate(uint32_t container_id,
100  const MediaInfo& media_info) = 0;
101 
105  virtual bool Flush() = 0;
106 
108  bool include_mspr_pro() const { return mpd_options_.mpd_params.include_mspr_pro; }
109 
111  DashProfile dash_profile() const { return mpd_options_.dash_profile; }
112 
114  MpdType mpd_type() const { return mpd_options_.mpd_type; }
115 
117  bool use_segment_list() const {
118  return mpd_options_.mpd_params.use_segment_list;
119  }
120 
121  private:
122  const MpdOptions mpd_options_;
123 
124  DISALLOW_COPY_AND_ASSIGN(MpdNotifier);
125 };
126 
127 } // namespace shaka
128 
129 #endif // MPD_BASE_MPD_NOTIFIER_H_
shaka::MpdOptions
Defines Mpd Options.
Definition: mpd_options.h:25
shaka::MpdNotifier::NotifyMediaInfoUpdate
virtual bool NotifyMediaInfoUpdate(uint32_t container_id, const MediaInfo &media_info)=0
shaka::MpdNotifier::NotifySampleDuration
virtual bool NotifySampleDuration(uint32_t container_id, uint32_t sample_duration)=0
shaka::MpdNotifier
Definition: mpd_notifier.h:27
shaka::MpdNotifier::NotifyNewSegment
virtual bool NotifyNewSegment(uint32_t container_id, uint64_t start_time, uint64_t duration, uint64_t size)=0
shaka::MpdNotifier::Init
virtual bool Init()=0
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::MpdNotifier::include_mspr_pro
bool include_mspr_pro() const
Definition: mpd_notifier.h:108
shaka::MpdParams::include_mspr_pro
bool include_mspr_pro
Definition: mpd_params.h:89
shaka::MpdNotifier::use_segment_list
bool use_segment_list() const
Definition: mpd_notifier.h:117
shaka::MpdNotifier::dash_profile
DashProfile dash_profile() const
Definition: mpd_notifier.h:111
shaka::MpdNotifier::NotifyNewContainer
virtual bool NotifyNewContainer(const MediaInfo &media_info, uint32_t *container_id)=0
shaka::MpdNotifier::NotifyCueEvent
virtual bool NotifyCueEvent(uint32_t container_id, uint64_t timestamp)=0
shaka::MpdNotifier::Flush
virtual bool Flush()=0
shaka::MpdNotifier::NotifyEncryptionUpdate
virtual bool NotifyEncryptionUpdate(uint32_t container_id, const std::string &drm_uuid, const std::vector< uint8_t > &new_key_id, const std::vector< uint8_t > &new_pssh)=0
shaka::MpdNotifier::mpd_type
MpdType mpd_type() const
Definition: mpd_notifier.h:114
shaka::MpdParams::use_segment_list
bool use_segment_list
Definition: mpd_params.h:93