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  DashProfile dash_profile() const { return mpd_options_.dash_profile; }
109 
111  MpdType mpd_type() const { return mpd_options_.mpd_type; }
112 
113  private:
114  const MpdOptions mpd_options_;
115 
116  DISALLOW_COPY_AND_ASSIGN(MpdNotifier);
117 };
118 
119 } // namespace shaka
120 
121 #endif // MPD_BASE_MPD_NOTIFIER_H_
virtual bool Flush()=0
MpdType mpd_type() const
Definition: mpd_notifier.h:111
virtual bool Init()=0
virtual bool NotifyNewSegment(uint32_t container_id, uint64_t start_time, uint64_t duration, uint64_t size)=0
DashProfile dash_profile() const
Definition: mpd_notifier.h:108
virtual bool NotifySampleDuration(uint32_t container_id, uint32_t sample_duration)=0
All the methods that are virtual are virtual for mocking.
virtual bool NotifyCueEvent(uint32_t container_id, uint64_t timestamp)=0
virtual bool NotifyNewContainer(const MediaInfo &media_info, uint32_t *container_id)=0
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
virtual bool NotifyMediaInfoUpdate(uint32_t container_id, const MediaInfo &media_info)=0
Defines Mpd Options.
Definition: mpd_options.h:25