| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_RENDERER_VIDEO_FRAME_PROVIDER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_VIDEO_FRAME_PROVIDER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 class VideoFrame; | 12 class VideoFrame; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // Define an interface to provide a sequence of video frames to clients. | 17 // Interface returned by MediaStreamRendererFactory that provides controls for |
| 18 // the flow of video frame callbacks being made. |
| 18 // TODO(wjia): remove ref count. | 19 // TODO(wjia): remove ref count. |
| 19 // TODO(wjia): rename interface so it doesn't clash with cc::VideoFrameProvider. | 20 class MediaStreamVideoRenderer |
| 20 class VideoFrameProvider | 21 : public base::RefCountedThreadSafe<MediaStreamVideoRenderer> { |
| 21 : public base::RefCountedThreadSafe<VideoFrameProvider> { | |
| 22 public: | 22 public: |
| 23 typedef base::Callback<void(const scoped_refptr<media::VideoFrame>&)> | 23 typedef base::Callback<void(const scoped_refptr<media::VideoFrame>&)> |
| 24 RepaintCB; | 24 RepaintCB; |
| 25 | 25 |
| 26 // Start to provide video frames to the caller. | 26 // Start to provide video frames to the caller. |
| 27 virtual void Start() = 0; | 27 virtual void Start() = 0; |
| 28 | 28 |
| 29 // Stop to provide video frames to the caller. | 29 // Stop to provide video frames to the caller. |
| 30 virtual void Stop() = 0; | 30 virtual void Stop() = 0; |
| 31 | 31 |
| 32 // Resume to provide video frames to the caller after being paused. | 32 // Resume to provide video frames to the caller after being paused. |
| 33 virtual void Play() = 0; | 33 virtual void Resume() = 0; |
| 34 | 34 |
| 35 // Put the provider in pause state and the caller will not receive video | 35 // Put the provider in pause state and the caller will not receive video |
| 36 // frames, but the provider might still generate video frames which are | 36 // frames, but the provider might still generate video frames which are |
| 37 // thrown away. | 37 // thrown away. |
| 38 virtual void Pause() = 0; | 38 virtual void Pause() = 0; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 friend class base::RefCountedThreadSafe<VideoFrameProvider>; | 41 friend class base::RefCountedThreadSafe<MediaStreamVideoRenderer>; |
| 42 | 42 |
| 43 virtual ~VideoFrameProvider() {} | 43 virtual ~MediaStreamVideoRenderer() {} |
| 44 | 44 |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace content | 47 } // namespace content |
| 48 | 48 |
| 49 #endif // CONTENT_PUBLIC_RENDERER_VIDEO_FRAME_PROVIDER_H_ | 49 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ |
| OLD | NEW |