DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs 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 
19 namespace edash_packager {
20 
21 class MediaInfo;
22 struct ContentProtectionElement;
23 
24 enum DashProfile {
25  kUnknownProfile,
26  kOnDemandProfile,
27  kLiveProfile,
28 };
29 
32 class MpdNotifier {
33  public:
34  MpdNotifier(DashProfile dash_profile) : dash_profile_(dash_profile) {};
35  virtual ~MpdNotifier() {};
36 
40  virtual bool Init() = 0;
41 
50  virtual bool NotifyNewContainer(const MediaInfo& media_info,
51  uint32_t* container_id) = 0;
52 
60  virtual bool NotifySampleDuration(uint32_t container_id,
61  uint32_t sample_duration) = 0;
62 
73  virtual bool NotifyNewSegment(uint32_t container_id,
74  uint64_t start_time,
75  uint64_t duration,
76  uint64_t size) = 0;
77 
87  virtual bool NotifyEncryptionUpdate(uint32_t container_id,
88  const std::string& drm_uuid,
89  const std::vector<uint8_t>& new_key_id,
90  const std::vector<uint8_t>& new_pssh) = 0;
91 
98  virtual bool AddContentProtectionElement(
99  uint32_t container_id,
100  const ContentProtectionElement& content_protection_element) = 0;
101 
105  virtual bool Flush() = 0;
106 
108  DashProfile dash_profile() const { return dash_profile_; }
109 
110  private:
111  const DashProfile dash_profile_;
112 
113  DISALLOW_COPY_AND_ASSIGN(MpdNotifier);
114 };
115 
116 } // namespace edash_packager
117 
118 #endif // MPD_BASE_MPD_NOTIFIER_H_
virtual bool AddContentProtectionElement(uint32_t container_id, const ContentProtectionElement &content_protection_element)=0
DashProfile dash_profile() const
Definition: mpd_notifier.h:108
virtual bool NotifyNewContainer(const MediaInfo &media_info, uint32_t *container_id)=0
virtual bool NotifySampleDuration(uint32_t container_id, uint32_t sample_duration)=0
virtual bool NotifyNewSegment(uint32_t container_id, uint64_t start_time, uint64_t duration, uint64_t size)=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