DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs
mock_mpd_builder.h
1 // Copyright 2015 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 #ifndef MPD_BASE_MOCK_MPD_BUILDER_H_
8 #define MPD_BASE_MOCK_MPD_BUILDER_H_
9 
10 #include <gmock/gmock.h>
11 
12 #include "packager/base/compiler_specific.h"
13 #include "packager/mpd/base/content_protection_element.h"
14 #include "packager/mpd/base/mpd_builder.h"
15 
16 namespace edash_packager {
17 
18 class MockMpdBuilder : public MpdBuilder {
19  public:
20  // |type| indicates whether the MPD should be for VOD or live content (kStatic
21  // for VOD profile, or kDynamic for live profile).
22  explicit MockMpdBuilder(MpdType type);
23  virtual ~MockMpdBuilder() OVERRIDE;
24 
25  MOCK_METHOD1(AddAdaptationSet, AdaptationSet*(const std::string& lang));
26  MOCK_METHOD1(ToString, bool(std::string* output));
27 };
28 
30  public:
31  // |adaptation_set_id| is the id for the AdaptationSet.
32  explicit MockAdaptationSet(uint32_t adaptation_set_id);
33  virtual ~MockAdaptationSet() OVERRIDE;
34 
35  MOCK_METHOD1(AddRepresentation, Representation*(const MediaInfo& media_info));
36  MOCK_METHOD1(AddContentProtectionElement,
37  void(const ContentProtectionElement& element));
38  MOCK_METHOD2(UpdateContentProtectionPssh,
39  void(const std::string& drm_uuid, const std::string& pssh));
40  MOCK_METHOD1(AddRole, void(AdaptationSet::Role role));
41 
42  MOCK_METHOD1(SetGroup, void(int group_number));
43  MOCK_CONST_METHOD0(Group, int());
44 
45  private:
46  // Only for constructing the super class. Not used for testing.
47  base::AtomicSequenceNumber sequence_counter_;
48 };
49 
51  public:
52  // |representation_id| is the numeric ID for the <Representation>.
53  explicit MockRepresentation(uint32_t representation_id);
54  virtual ~MockRepresentation() OVERRIDE;
55 
56  MOCK_METHOD1(AddContentProtectionElement,
57  void(const ContentProtectionElement& element));
58  MOCK_METHOD2(UpdateContentProtectionPssh,
59  void(const std::string& drm_uuid, const std::string& pssh));
60  MOCK_METHOD3(AddNewSegment,
61  void(uint64_t start_time, uint64_t duration, uint64_t size));
62  MOCK_METHOD1(SetSampleDuration, void(uint32_t sample_duration));
63 };
64 
65 } // namespace edash_packager
66 
67 #endif // MPD_BASE_MOCK_MPD_BUILDER_H_
MpdType type() const
Definition: mpd_builder.h:91
virtual void AddNewSegment(uint64_t start_time, uint64_t duration, uint64_t size)
virtual int Group() const
Definition: mpd_builder.cc:793
virtual AdaptationSet * AddAdaptationSet(const std::string &lang)
Definition: mpd_builder.cc:392
This class generates DASH MPDs (Media Presentation Descriptions).
Definition: mpd_builder.h:56
virtual void SetSampleDuration(uint32_t sample_duration)
virtual void UpdateContentProtectionPssh(const std::string &drm_uuid, const std::string &pssh)
virtual void SetGroup(int group_number)
Definition: mpd_builder.cc:789
virtual void AddContentProtectionElement(const ContentProtectionElement &element)
virtual Representation * AddRepresentation(const MediaInfo &media_info)
Definition: mpd_builder.cc:655
virtual void UpdateContentProtectionPssh(const std::string &drm_uuid, const std::string &pssh)
Definition: mpd_builder.cc:700
virtual bool ToString(std::string *output)
Definition: mpd_builder.cc:410
virtual void AddRole(Role role)
Definition: mpd_builder.cc:707
virtual void AddContentProtectionElement(const ContentProtectionElement &element)
Definition: mpd_builder.cc:693