Shaka Packager SDK
Loading...
Searching...
No Matches
mock_mpd_builder.cc
1// Copyright 2023 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#include <packager/mpd/base/mock_mpd_builder.h>
8
9#include <cstdint>
10#include <memory>
11
12#include <packager/mpd/base/adaptation_set.h>
13#include <packager/mpd/base/media_info.pb.h>
14#include <packager/mpd/base/mpd_builder.h>
15#include <packager/mpd/base/mpd_options.h>
16#include <packager/mpd/base/period.h>
17#include <packager/mpd/base/representation.h>
18
19namespace shaka {
20namespace {
21const char kEmptyLang[] = "";
22const MpdOptions kDefaultMpdOptions;
23} // namespace
24
25// Doesn't matter what values get passed to the super class' constructor.
26// All methods used for testing should be mocked.
27MockMpdBuilder::MockMpdBuilder() : MpdBuilder(kDefaultMpdOptions) {}
28MockMpdBuilder::~MockMpdBuilder() {}
29
30MockPeriod::MockPeriod(uint32_t period_id, double start_time_in_seconds)
31 : Period(period_id,
32 start_time_in_seconds,
33 kDefaultMpdOptions,
34 &sequence_counter_) {}
35
36MockAdaptationSet::MockAdaptationSet()
37 : AdaptationSet(kEmptyLang, kDefaultMpdOptions, &sequence_counter_) {}
38
39MockAdaptationSet::~MockAdaptationSet() {}
40
41MockRepresentation::MockRepresentation(uint32_t representation_id)
42 : Representation(MediaInfo(),
43 kDefaultMpdOptions,
44 representation_id,
45 std::unique_ptr<RepresentationStateChangeListener>()) {}
46MockRepresentation::~MockRepresentation() {}
47
48} // namespace shaka
All the methods that are virtual are virtual for mocking.