chromium/media/filters/demuxer_perftest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stddef.h>
#include <stdint.h>
#include <memory>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/decoder_buffer.h"
#include "media/base/media_tracks.h"
#include "media/base/media_util.h"
#include "media/base/test_data_util.h"
#include "media/base/timestamp_constants.h"
#include "media/filters/ffmpeg_demuxer.h"
#include "media/filters/file_data_source.h"
#include "media/media_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"

namespace media {

static const int kBenchmarkIterations =;

class DemuxerHostImpl : public media::DemuxerHost {};

static void QuitLoopWithStatus(base::OnceClosure quit_cb,
                               media::PipelineStatus status) {}

static void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
                                     const std::vector<uint8_t>& init_data) {}

static void OnMediaTracksUpdated(std::unique_ptr<MediaTracks> tracks) {}

Streams;

// Simulates playback reading requirements by reading from each stream
// present in |demuxer| in as-close-to-monotonically-increasing timestamp order.
class StreamReader {};

StreamReader::StreamReader(media::Demuxer* demuxer,
                           bool enable_bitstream_converter) {}

StreamReader::~StreamReader() = default;

void StreamReader::Read() {}

bool StreamReader::IsDone() {}

void StreamReader::OnReadDone(
    scoped_refptr<base::SingleThreadTaskRunner> task_runner,
    base::OnceClosure quit_when_idle_closure,
    bool* end_of_stream,
    base::TimeDelta* timestamp,
    media::DemuxerStream::Status status,
    DemuxerStream::DecoderBufferVector buffers) {}

int StreamReader::GetNextStreamIndexToRead() {}

static void RunDemuxerBenchmark(const std::string& filename) {}

class DemuxerPerfTest : public testing::TestWithParam<const char*> {};

TEST_P(DemuxerPerfTest, Demuxer) {}

static const char* kDemuxerTestFiles[] {};

// For simplicity we only test containers with above 2% daily usage as measured
// by the Media.DetectedContainer histogram.
INSTANTIATE_TEST_SUITE_P();

}  // namespace media