DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
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 
83  virtual bool NotifyEncryptionUpdate(uint32_t container_id,
84  const std::string& drm_uuid,
85  const std::vector<uint8_t>& new_key_id,
86  const std::vector<uint8_t>& new_pssh) = 0;
87 
94  virtual bool AddContentProtectionElement(
95  uint32_t container_id,
96  const ContentProtectionElement& content_protection_element) = 0;
97 
101  virtual bool Flush() = 0;
102 
104  DashProfile dash_profile() const { return mpd_options_.dash_profile; }
105 
107  MpdType mpd_type() const { return mpd_options_.mpd_type; }
108 
109  private:
110  const MpdOptions mpd_options_;
111 
112  DISALLOW_COPY_AND_ASSIGN(MpdNotifier);
113 };
114 
115 } // namespace shaka
116 
117 #endif // MPD_BASE_MPD_NOTIFIER_H_
virtual bool Flush()=0
virtual bool Init()=0
virtual bool NotifyNewSegment(uint32_t container_id, uint64_t start_time, uint64_t duration, uint64_t size)=0
virtual bool NotifySampleDuration(uint32_t container_id, uint32_t sample_duration)=0
MpdType mpd_type() const
Definition: mpd_notifier.h:107
virtual bool AddContentProtectionElement(uint32_t container_id, const ContentProtectionElement &content_protection_element)=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
DashProfile dash_profile() const
Definition: mpd_notifier.h:104
Defines Mpd Options.
Definition: mpd_options.h:25