blob: 65b5d12e5b9ba33b91d33e62a7ca52a13b4206cb [file]
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CAST_STANDALONE_RECEIVER_DUMMY_PLAYER_H_
#define CAST_STANDALONE_RECEIVER_DUMMY_PLAYER_H_
#include <stdint.h>
#include <vector>
#include "cast/streaming/public/receiver.h"
#include "platform/api/task_runner.h"
#include "platform/api/time.h"
#include "util/raw_ref.h"
namespace openscreen::cast {
// Consumes frames from a Receiver, but does nothing other than OSP_LOG_INFO
// each one's FrameId, timestamp and size. This is only useful for confirming a
// Receiver is successfully receiving a stream, for platforms where
// SDLVideoPlayer cannot be built.
class DummyPlayer final : public Receiver::Consumer {
public:
explicit DummyPlayer(Receiver& receiver);
~DummyPlayer() final;
private:
// Receiver::Consumer implementation.
void OnFramesReady(size_t next_frame_buffer_size) final;
const raw_ref<Receiver> receiver_;
std::vector<uint8_t> buffer_;
};
} // namespace openscreen::cast
#endif // CAST_STANDALONE_RECEIVER_DUMMY_PLAYER_H_