Shaka Packager SDK
mock_mpd_notifier.h
1 // Copyright 2015 Google LLC. 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_NOTIFIER_H_
8 #define MPD_BASE_MOCK_MPD_NOTIFIER_H_
9 
10 #include <gmock/gmock.h>
11 
12 #include <packager/mpd/base/content_protection_element.h>
13 #include <packager/mpd/base/media_info.pb.h>
14 #include <packager/mpd/base/mpd_notifier.h>
15 
16 namespace shaka {
17 
18 class MockMpdNotifier : public MpdNotifier {
19  public:
20  explicit MockMpdNotifier(const MpdOptions& mpd_options);
21  virtual ~MockMpdNotifier();
22 
23  MOCK_METHOD0(Init, bool());
24  MOCK_METHOD2(NotifyNewContainer,
25  bool(const MediaInfo& media_info, uint32_t* container_id));
26  MOCK_METHOD2(NotifySampleDuration,
27  bool(uint32_t container_id, int32_t sample_duration));
28  MOCK_METHOD5(NotifyNewSegment,
29  bool(uint32_t container_id,
30  int64_t start_time,
31  int64_t duration,
32  uint64_t size,
33  int64_t segment_number));
34  MOCK_METHOD3(NotifyCompletedSegment,
35  bool(uint32_t container_id, int64_t duration, uint64_t size));
36  MOCK_METHOD1(NotifyAvailabilityTimeOffset, bool(uint32_t container_id));
37  MOCK_METHOD1(NotifySegmentDuration, bool(uint32_t container_id));
38  MOCK_METHOD2(NotifyCueEvent, bool(uint32_t container_id, int64_t timestamp));
39  MOCK_METHOD4(NotifyEncryptionUpdate,
40  bool(uint32_t container_id,
41  const std::string& drm_uuid,
42  const std::vector<uint8_t>& new_key_id,
43  const std::vector<uint8_t>& new_pssh));
44  MOCK_METHOD2(NotifyMediaInfoUpdate,
45  bool(uint32_t container_id, const MediaInfo& media_info));
46  MOCK_METHOD0(Flush, bool());
47 };
48 
49 } // namespace shaka
50 
51 #endif // MPD_BASE_MOCK_MPD_NOTIFIER_H_
virtual bool NotifySampleDuration(uint32_t container_id, int32_t sample_duration)=0
virtual bool NotifyMediaInfoUpdate(uint32_t container_id, const MediaInfo &media_info)=0
virtual bool NotifyNewSegment(uint32_t container_id, int64_t start_time, int64_t duration, uint64_t size, int64_t segment_number)=0
virtual bool NotifyCompletedSegment(uint32_t container_id, int64_t duration, uint64_t size)
Definition: mpd_notifier.h:109
virtual bool NotifyAvailabilityTimeOffset(uint32_t container_id)
Definition: mpd_notifier.h:55
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 Init()=0
virtual bool NotifyCueEvent(uint32_t container_id, int64_t timestamp)=0
virtual bool NotifySegmentDuration(uint32_t container_id)
Definition: mpd_notifier.h:75
virtual bool NotifyNewContainer(const MediaInfo &media_info, uint32_t *container_id)=0
virtual bool Flush()=0
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66
Defines Mpd Options.
Definition: mpd_options.h:25