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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/simple_video_frame_provider.h
===================================================================
--- webkit/media/simple_video_frame_provider.h (revision 0)
+++ webkit/media/simple_video_frame_provider.h (revision 0)
@@ -0,0 +1,60 @@
+// Copyright (c) 2012 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 WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
+#define WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
+
+#include "base/time.h"
+#include "ui/gfx/size.h"
+#include "webkit/media/video_frame_provider.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace webkit_media {
+
+// A simple implementation of VideoFrameProvider generates raw frames and
+// passes them to webmediaplayer.
+class SimpleVideoFrameProvider : public VideoFrameProvider {
+ public:
+ SimpleVideoFrameProvider(
+ const gfx::Size& size,
+ const base::TimeDelta& frame_duration,
+ const base::Closure& error_cb,
+ const RepaintCB& repaint_cb);
+
+ // VideoFrameProvider implementation.
+ virtual void Start() OVERRIDE;
+ virtual void Stop() OVERRIDE;
+ virtual void Play() OVERRIDE;
+ virtual void Pause() OVERRIDE;
+
+ protected:
+ virtual ~SimpleVideoFrameProvider();
+
+ private:
+ enum State {
+ kStarted,
+ kPaused,
+ kStopped,
+ };
+
+ void GenerateFrame();
+
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
+ gfx::Size size_;
+ State state_;
+
+ base::TimeDelta current_time_;
+ base::TimeDelta frame_duration_;
+ base::Closure error_cb_;
+ RepaintCB repaint_cb_;
+
+ DISALLOW_COPY_AND_ASSIGN(SimpleVideoFrameProvider);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_SIMPLE_VIDEO_FRAME_PROVIDER_H_
Property changes on: webkit/media/simple_video_frame_provider.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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