aboutsummaryrefslogtreecommitdiff
path: root/cast/standalone_receiver/dummy_player.h
blob: a75aa61e6944294dbdafe2adb2400e589c0e49ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019 The Chromium Authors. All rights reserved.
// 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/receiver.h"
#include "platform/api/task_runner.h"
#include "platform/api/time.h"

namespace openscreen {
namespace 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 : public Receiver::Consumer {
 public:
  explicit DummyPlayer(Receiver* receiver);

  ~DummyPlayer() final;

 private:
  // Receiver::Consumer implementation.
  void OnFramesReady(int next_frame_buffer_size) final;

  Receiver* const receiver_;
  std::vector<uint8_t> buffer_;
};

}  // namespace cast
}  // namespace openscreen

#endif  // CAST_STANDALONE_RECEIVER_DUMMY_PLAYER_H_