mock_media_stream_video_sink.h revision c5cede9ae108bb15f6b7a8aea21c7e1fefa2834c
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SINK_H_
6#define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SINK_H_
7
8#include "content/public/renderer/media_stream_video_sink.h"
9
10#include "media/base/video_frame.h"
11
12namespace content {
13
14class MockMediaStreamVideoSink : public MediaStreamVideoSink {
15 public:
16  MockMediaStreamVideoSink();
17
18  virtual void OnVideoFrame(
19      const scoped_refptr<media::VideoFrame>& frame) OVERRIDE;
20  virtual void OnReadyStateChanged(
21        blink::WebMediaStreamSource::ReadyState state) OVERRIDE;
22  virtual void OnEnabledChanged(bool enabled) OVERRIDE;
23
24  int number_of_frames() const { return number_of_frames_; }
25  media::VideoFrame::Format format() const { return format_; }
26  bool enabled() const { return enabled_; }
27  blink::WebMediaStreamSource::ReadyState state() const { return state_; }
28
29 private:
30  int number_of_frames_;
31  bool enabled_;
32  media::VideoFrame::Format format_;
33  blink::WebMediaStreamSource::ReadyState state_;
34};
35
36}  // namespace content
37
38#endif
39