2022-08-26 15:44:59 +00:00
|
|
|
// Copyright 2016 Google LLC. All rights reserved.
|
2016-03-25 08:39:07 +00:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef PACKAGER_HLS_BASE_MOCK_MEDIA_PLAYLIST_H_
|
|
|
|
#define PACKAGER_HLS_BASE_MOCK_MEDIA_PLAYLIST_H_
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
|
2023-10-10 23:51:11 +00:00
|
|
|
#include <packager/hls/base/media_playlist.h>
|
2016-03-25 08:39:07 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2016-03-25 08:39:07 +00:00
|
|
|
namespace hls {
|
|
|
|
|
|
|
|
class MockMediaPlaylist : public MediaPlaylist {
|
|
|
|
public:
|
|
|
|
// The actual parameters to MediaPlaylist() (parent) constructor doesn't
|
|
|
|
// matter because the return value can be mocked.
|
2018-04-14 01:26:02 +00:00
|
|
|
MockMediaPlaylist(const std::string& file_name,
|
2016-03-25 08:39:07 +00:00
|
|
|
const std::string& name,
|
|
|
|
const std::string& group_id);
|
|
|
|
~MockMediaPlaylist() override;
|
|
|
|
|
|
|
|
MOCK_METHOD1(SetMediaInfo, bool(const MediaInfo& media_info));
|
2017-05-01 20:38:58 +00:00
|
|
|
MOCK_METHOD5(AddSegment,
|
2016-03-25 08:39:07 +00:00
|
|
|
void(const std::string& file_name,
|
2018-06-22 01:14:34 +00:00
|
|
|
int64_t start_time,
|
|
|
|
int64_t duration,
|
2017-05-01 20:38:58 +00:00
|
|
|
uint64_t start_byte_offset,
|
2016-03-25 08:39:07 +00:00
|
|
|
uint64_t size));
|
2018-01-31 02:30:19 +00:00
|
|
|
MOCK_METHOD3(AddKeyFrame,
|
2018-06-22 01:14:34 +00:00
|
|
|
void(int64_t timestamp,
|
2018-01-31 02:30:19 +00:00
|
|
|
uint64_t start_byte_offset,
|
|
|
|
uint64_t size));
|
2017-04-04 20:57:50 +00:00
|
|
|
MOCK_METHOD6(AddEncryptionInfo,
|
2016-03-25 08:39:07 +00:00
|
|
|
void(EncryptionMethod method,
|
|
|
|
const std::string& url,
|
2017-04-04 20:57:50 +00:00
|
|
|
const std::string& key_id,
|
2016-03-25 08:39:07 +00:00
|
|
|
const std::string& iv,
|
|
|
|
const std::string& key_format,
|
|
|
|
const std::string& key_format_versions));
|
2018-01-12 01:33:37 +00:00
|
|
|
MOCK_METHOD0(AddPlacementOpportunity, void());
|
2023-08-22 01:41:18 +00:00
|
|
|
MOCK_METHOD1(WriteToFile, bool(const std::filesystem::path& file_path));
|
2018-05-31 21:27:21 +00:00
|
|
|
MOCK_CONST_METHOD0(MaxBitrate, uint64_t());
|
|
|
|
MOCK_CONST_METHOD0(AvgBitrate, uint64_t());
|
2016-03-25 08:39:07 +00:00
|
|
|
MOCK_CONST_METHOD0(GetLongestSegmentDuration, double());
|
2021-08-04 18:56:44 +00:00
|
|
|
MOCK_METHOD1(SetTargetDuration, void(int32_t target_duration));
|
2017-12-09 01:53:17 +00:00
|
|
|
MOCK_CONST_METHOD0(GetNumChannels, int());
|
2020-06-04 05:02:49 +00:00
|
|
|
MOCK_CONST_METHOD0(GetEC3JocComplexity, int());
|
2020-07-04 21:55:28 +00:00
|
|
|
MOCK_CONST_METHOD0(GetAC4ImsFlag, bool());
|
|
|
|
MOCK_CONST_METHOD0(GetAC4CbiFlag, bool());
|
2017-07-13 20:25:36 +00:00
|
|
|
MOCK_CONST_METHOD2(GetDisplayResolution,
|
|
|
|
bool(uint32_t* width, uint32_t* height));
|
2019-09-23 06:47:07 +00:00
|
|
|
MOCK_CONST_METHOD0(GetFrameRate, double());
|
2016-03-25 08:39:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace hls
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2016-03-25 08:39:07 +00:00
|
|
|
|
|
|
|
#endif // PACKAGER_HLS_BASE_MOCK_MEDIA_PLAYLIST_H_
|