1 // Copyright (c) 2012 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.
5 #ifndef WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
6 #define WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
9 #include "ui/gfx/size.h"
10 #include "webkit/media/video_frame_provider.h"
13 class MessageLoopProxy
;
16 namespace webkit_media
{
18 // A simple implementation of VideoFrameProvider generates raw frames and
19 // passes them to webmediaplayer.
20 // Since non-black pixel values are required in the layout test, e.g.,
21 // media/video-capture-canvas.html, this class should generate frame with
22 // only non-black pixels.
23 class SimpleVideoFrameProvider
: public VideoFrameProvider
{
25 SimpleVideoFrameProvider(
26 const gfx::Size
& size
,
27 const base::TimeDelta
& frame_duration
,
28 const base::Closure
& error_cb
,
29 const RepaintCB
& repaint_cb
);
31 // VideoFrameProvider implementation.
32 virtual void Start() OVERRIDE
;
33 virtual void Stop() OVERRIDE
;
34 virtual void Play() OVERRIDE
;
35 virtual void Pause() OVERRIDE
;
38 virtual ~SimpleVideoFrameProvider();
49 scoped_refptr
<base::MessageLoopProxy
> message_loop_proxy_
;
53 base::TimeDelta current_time_
;
54 base::TimeDelta frame_duration_
;
55 base::Closure error_cb_
;
56 RepaintCB repaint_cb_
;
58 DISALLOW_COPY_AND_ASSIGN(SimpleVideoFrameProvider
);
61 } // namespace webkit_media
63 #endif // WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_