#include "media/test/test_media_source.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/task/single_thread_task_runner.h"
#include "media/base/stream_parser.h"
#include "media/base/test_data_util.h"
#include "media/base/timestamp_constants.h"
namespace {
void SplitMime(const std::string& mimetype,
std::string* type,
std::string* codecs) { … }
}
namespace media {
constexpr char kSourceId[] = …;
TestMediaSource::TestMediaSource(const std::string& filename,
const std::string& mimetype,
size_t initial_append_size,
bool initial_sequence_mode)
: … { … }
TestMediaSource::TestMediaSource(const std::string& filename,
size_t initial_append_size,
bool initial_sequence_mode)
: … { … }
TestMediaSource::TestMediaSource(scoped_refptr<DecoderBuffer> data,
const std::string& mimetype,
size_t initial_append_size,
bool initial_sequence_mode)
: … { … }
TestMediaSource::~TestMediaSource() = default;
std::unique_ptr<Demuxer> TestMediaSource::GetDemuxer() { … }
void TestMediaSource::SetAppendWindow(base::TimeDelta timestamp_offset,
base::TimeDelta append_window_start,
base::TimeDelta append_window_end) { … }
void TestMediaSource::Seek(base::TimeDelta seek_time,
size_t new_position,
size_t seek_append_size) { … }
void TestMediaSource::Seek(base::TimeDelta seek_time) { … }
void TestMediaSource::SetSequenceMode(bool sequence_mode) { … }
void TestMediaSource::AppendData(size_t size) { … }
bool TestMediaSource::AppendAtTime(base::TimeDelta timestamp_offset,
base::span<const uint8_t> data) { … }
void TestMediaSource::AppendAtTimeWithWindow(
base::TimeDelta timestamp_offset,
base::TimeDelta append_window_start,
base::TimeDelta append_window_end,
base::span<const uint8_t> data) { … }
void TestMediaSource::SetMemoryLimits(size_t limit_bytes) { … }
bool TestMediaSource::EvictCodedFrames(base::TimeDelta currentMediaTime,
size_t newDataSize) { … }
void TestMediaSource::RemoveRange(base::TimeDelta start, base::TimeDelta end) { … }
void TestMediaSource::EndOfStream() { … }
void TestMediaSource::UnmarkEndOfStream() { … }
void TestMediaSource::Shutdown() { … }
void TestMediaSource::DemuxerOpened() { … }
void TestMediaSource::DemuxerOpenedTask() { … }
ChunkDemuxer::Status TestMediaSource::AddId() { … }
void TestMediaSource::ChangeType(const std::string& mimetype) { … }
void TestMediaSource::OnEncryptedMediaInitData(
EmeInitDataType init_data_type,
const std::vector<uint8_t>& init_data) { … }
void TestMediaSource::InitSegmentReceived(std::unique_ptr<MediaTracks> tracks) { … }
void TestMediaSource::VerifyExpectedAppendResult(bool append_result) { … }
}