Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: webkit/media/simple_video_frame_provider.h

Issue 10918052: create a separate WebMediaPlayer for URL derived from media stream (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/media_stream_client.h ('k') | webkit/media/simple_video_frame_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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.
4
5 #ifndef WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
6 #define WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
7
8 #include "base/time.h"
9 #include "ui/gfx/size.h"
10 #include "webkit/media/video_frame_provider.h"
11
12 namespace base {
13 class MessageLoopProxy;
14 }
15
16 namespace webkit_media {
17
18 // A simple implementation of VideoFrameProvider generates raw frames and
19 // passes them to webmediaplayer.
20 class SimpleVideoFrameProvider : public VideoFrameProvider {
21 public:
22 SimpleVideoFrameProvider(
23 const gfx::Size& size,
24 const base::TimeDelta& frame_duration,
25 const base::Closure& error_cb,
26 const RepaintCB& repaint_cb);
27
28 // VideoFrameProvider implementation.
29 virtual void Start() OVERRIDE;
30 virtual void Stop() OVERRIDE;
31 virtual void Play() OVERRIDE;
32 virtual void Pause() OVERRIDE;
33
34 protected:
35 virtual ~SimpleVideoFrameProvider();
36
37 private:
38 enum State {
39 kStarted,
40 kPaused,
41 kStopped,
42 };
43
44 void GenerateFrame();
45
46 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
47 gfx::Size size_;
48 State state_;
49
50 base::TimeDelta current_time_;
51 base::TimeDelta frame_duration_;
52 base::Closure error_cb_;
53 RepaintCB repaint_cb_;
54
55 DISALLOW_COPY_AND_ASSIGN(SimpleVideoFrameProvider);
56 };
57
58 } // namespace webkit_media
59
60 #endif // WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
OLDNEW
« no previous file with comments | « webkit/media/media_stream_client.h ('k') | webkit/media/simple_video_frame_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698