DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
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/base/synchronization/lock.h"
14 #include "packager/mpd/base/content_protection_element.h"
15 #include "packager/mpd/base/mpd_builder.h"
16 
17 namespace shaka {
18 
19 class MockMpdBuilder : public MpdBuilder {
20  public:
22  ~MockMpdBuilder() override;
23 
24  MOCK_METHOD1(AddAdaptationSet, AdaptationSet*(const std::string& lang));
25  MOCK_METHOD1(ToString, bool(std::string* output));
26 };
27 
29  public:
30  // |adaptation_set_id| is the id for the AdaptationSet.
31  explicit MockAdaptationSet(uint32_t adaptation_set_id);
32  ~MockAdaptationSet() override;
33 
34  MOCK_METHOD1(AddRepresentation, Representation*(const MediaInfo& media_info));
35  MOCK_METHOD1(AddContentProtectionElement,
36  void(const ContentProtectionElement& element));
37  MOCK_METHOD2(UpdateContentProtectionPssh,
38  void(const std::string& drm_uuid, const std::string& pssh));
39  MOCK_METHOD1(AddRole, void(AdaptationSet::Role role));
40  MOCK_METHOD1(ForceSetSegmentAlignment, void(bool segment_alignment));
41  MOCK_METHOD1(AddTrickPlayReferenceId, void(uint32_t id));
42 
43  private:
44  // Only for constructing the super class. Not used for testing.
45  base::AtomicSequenceNumber sequence_counter_;
46 };
47 
49  public:
50  // |representation_id| is the numeric ID for the <Representation>.
51  explicit MockRepresentation(uint32_t representation_id);
52  ~MockRepresentation() override;
53 
54  MOCK_METHOD1(AddContentProtectionElement,
55  void(const ContentProtectionElement& element));
56  MOCK_METHOD2(UpdateContentProtectionPssh,
57  void(const std::string& drm_uuid, const std::string& pssh));
58  MOCK_METHOD3(AddNewSegment,
59  void(uint64_t start_time, uint64_t duration, uint64_t size));
60  MOCK_METHOD1(SetSampleDuration, void(uint32_t sample_duration));
61 };
62 
63 } // namespace shaka
64 
65 #endif // MPD_BASE_MOCK_MPD_BUILDER_H_
virtual void AddNewSegment(uint64_t start_time, uint64_t duration, uint64_t size)
virtual void SetSampleDuration(uint32_t sample_duration)
virtual Representation * AddRepresentation(const MediaInfo &media_info)
Definition: mpd_builder.cc:701
This class generates DASH MPDs (Media Presentation Descriptions).
Definition: mpd_builder.h:57
virtual void AddContentProtectionElement(const ContentProtectionElement &element)
Definition: mpd_builder.cc:747
virtual void AddTrickPlayReferenceId(uint32_t id)
Definition: mpd_builder.cc:903
virtual void AddRole(Role role)
Definition: mpd_builder.cc:759
virtual void UpdateContentProtectionPssh(const std::string &drm_uuid, const std::string &pssh)
Definition: mpd_builder.cc:753
virtual bool ToString(std::string *output)
Definition: mpd_builder.cc:427
virtual void ForceSetSegmentAlignment(bool segment_alignment)
Definition: mpd_builder.cc:868
virtual void AddContentProtectionElement(const ContentProtectionElement &element)
virtual AdaptationSet * AddAdaptationSet(const std::string &lang)
Definition: mpd_builder.cc:408
virtual void UpdateContentProtectionPssh(const std::string &drm_uuid, const std::string &pssh)