OLD | NEW |
(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_VIDEO_FRAME_PROVIDER_H_ |
| 6 #define WEBKIT_MEDIA_VIDEO_FRAME_PROVIDER_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 |
| 11 namespace media { |
| 12 class VideoFrame; |
| 13 } |
| 14 |
| 15 namespace webkit_media { |
| 16 |
| 17 // Define an interface to provide a sequence of video frames to clients. |
| 18 class VideoFrameProvider |
| 19 : public base::RefCountedThreadSafe<VideoFrameProvider> { |
| 20 public: |
| 21 typedef base::Callback<void(const scoped_refptr<media::VideoFrame>&)> |
| 22 RepaintCB; |
| 23 |
| 24 // Start to provide video frames to the caller. |
| 25 virtual void Start() = 0; |
| 26 // Stop to provide video frames to the caller. |
| 27 virtual void Stop() = 0; |
| 28 // Resume to provide video frames to the caller after being paused. |
| 29 virtual void Play() = 0; |
| 30 // Put the provider in pause state and the caller will not receive video |
| 31 // frames, but the provider might still generate video frames which are |
| 32 // thrown away. |
| 33 virtual void Pause() = 0; |
| 34 |
| 35 protected: |
| 36 friend class base::RefCountedThreadSafe<VideoFrameProvider>; |
| 37 VideoFrameProvider(); |
| 38 virtual ~VideoFrameProvider(); |
| 39 |
| 40 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(VideoFrameProvider); |
| 42 }; |
| 43 |
| 44 } // namespace webkit_media |
| 45 |
| 46 #endif // WEBKIT_MEDIA_VIDEO_FRAME_PROVIDER_H_ |
OLD | NEW |