| 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_MEDIA_STREAM_VIDEO_RENDERER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_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 // Interface returned by MediaStreamRendererFactory that provides controls for | 17 // Interface returned by MediaStreamRendererFactory that provides controls for |
| 18 // the flow of video frame callbacks being made. | 18 // the flow of video frame callbacks being made. |
| 19 // TODO(wjia): remove ref count. | 19 // TODO(wjia): remove ref count. |
| 20 class MediaStreamVideoRenderer | 20 class MediaStreamVideoRenderer |
| 21 : public base::RefCountedThreadSafe<MediaStreamVideoRenderer> { | 21 : public base::RefCountedThreadSafe<MediaStreamVideoRenderer> { |
| 22 public: | 22 public: |
| 23 typedef base::Callback<void(const scoped_refptr<media::VideoFrame>&)> | 23 typedef base::Callback<void(scoped_refptr<media::VideoFrame>)> RepaintCB; |
| 24 RepaintCB; | |
| 25 | 24 |
| 26 // Start to provide video frames to the caller. | 25 // Start to provide video frames to the caller. |
| 27 virtual void Start() = 0; | 26 virtual void Start() = 0; |
| 28 | 27 |
| 29 // Stop to provide video frames to the caller. | 28 // Stop to provide video frames to the caller. |
| 30 virtual void Stop() = 0; | 29 virtual void Stop() = 0; |
| 31 | 30 |
| 32 // Resume to provide video frames to the caller after being paused. | 31 // Resume to provide video frames to the caller after being paused. |
| 33 virtual void Resume() = 0; | 32 virtual void Resume() = 0; |
| 34 | 33 |
| 35 // Put the provider in pause state and the caller will not receive video | 34 // 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 | 35 // frames, but the provider might still generate video frames which are |
| 37 // thrown away. | 36 // thrown away. |
| 38 virtual void Pause() = 0; | 37 virtual void Pause() = 0; |
| 39 | 38 |
| 40 protected: | 39 protected: |
| 41 friend class base::RefCountedThreadSafe<MediaStreamVideoRenderer>; | 40 friend class base::RefCountedThreadSafe<MediaStreamVideoRenderer>; |
| 42 | 41 |
| 43 virtual ~MediaStreamVideoRenderer() {} | 42 virtual ~MediaStreamVideoRenderer() {} |
| 44 | 43 |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 } // namespace content | 46 } // namespace content |
| 48 | 47 |
| 49 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ | 48 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_RENDERER_H_ |
| OLD | NEW |