OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ |
6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ | 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/video/capture/video_capture.h" | 10 #include "media/video/capture/video_capture.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Retrieves the state of the VideoCapture. Must be called on main thread. | 44 // Retrieves the state of the VideoCapture. Must be called on main thread. |
45 const VideoCaptureState& state() const { return state_; } | 45 const VideoCaptureState& state() const { return state_; } |
46 | 46 |
47 // VideoCapture::EventHandler implementation, called on VC thread. | 47 // VideoCapture::EventHandler implementation, called on VC thread. |
48 virtual void OnStarted(VideoCapture* capture) OVERRIDE; | 48 virtual void OnStarted(VideoCapture* capture) OVERRIDE; |
49 virtual void OnStopped(VideoCapture* capture) OVERRIDE; | 49 virtual void OnStopped(VideoCapture* capture) OVERRIDE; |
50 virtual void OnPaused(VideoCapture* capture) OVERRIDE; | 50 virtual void OnPaused(VideoCapture* capture) OVERRIDE; |
51 virtual void OnError(VideoCapture* capture, int error_code) OVERRIDE; | 51 virtual void OnError(VideoCapture* capture, int error_code) OVERRIDE; |
52 virtual void OnRemoved(VideoCapture* capture) OVERRIDE; | 52 virtual void OnRemoved(VideoCapture* capture) OVERRIDE; |
53 virtual void OnBufferReady( | 53 virtual void OnFrameReady(VideoCapture* capture, |
54 VideoCapture* capture, | 54 const scoped_refptr<VideoFrame>& frame) OVERRIDE; |
55 scoped_refptr<VideoCapture::VideoFrameBuffer> buffer) OVERRIDE; | |
56 virtual void OnDeviceInfoReceived( | 55 virtual void OnDeviceInfoReceived( |
57 VideoCapture* capture, | 56 VideoCapture* capture, |
58 const VideoCaptureParams& device_info) OVERRIDE; | 57 const VideoCaptureParams& device_info) OVERRIDE; |
59 | 58 |
60 private: | 59 private: |
61 // Called on main thread. | 60 // Called on main thread. |
62 void OnStartedOnMainThread( | 61 void OnStartedOnMainThread( |
63 VideoCapture* capture, | 62 VideoCapture* capture, |
64 const VideoCaptureState& state); | 63 const VideoCaptureState& state); |
65 void OnStoppedOnMainThread( | 64 void OnStoppedOnMainThread( |
66 VideoCapture* capture, | 65 VideoCapture* capture, |
67 const VideoCaptureState& state); | 66 const VideoCaptureState& state); |
68 void OnPausedOnMainThread( | 67 void OnPausedOnMainThread( |
69 VideoCapture* capture, | 68 VideoCapture* capture, |
70 const VideoCaptureState& state); | 69 const VideoCaptureState& state); |
71 void OnErrorOnMainThread( | 70 void OnErrorOnMainThread( |
72 VideoCapture* capture, | 71 VideoCapture* capture, |
73 const VideoCaptureState& state, | 72 const VideoCaptureState& state, |
74 int error_code); | 73 int error_code); |
75 void OnRemovedOnMainThread( | 74 void OnRemovedOnMainThread( |
76 VideoCapture* capture, | 75 VideoCapture* capture, |
77 const VideoCaptureState& state); | 76 const VideoCaptureState& state); |
78 void OnBufferReadyOnMainThread( | 77 void OnFrameReadyOnMainThread(VideoCapture* capture, |
79 VideoCapture* capture, | 78 const VideoCaptureState& state, |
80 const VideoCaptureState& state, | 79 const scoped_refptr<VideoFrame>& frame); |
81 scoped_refptr<VideoCapture::VideoFrameBuffer> buffer); | 80 void OnDeviceInfoReceivedOnMainThread(VideoCapture* capture, |
82 void OnDeviceInfoReceivedOnMainThread( | 81 const VideoCaptureState& state, |
83 VideoCapture* capture, | 82 const VideoCaptureParams& device_info); |
84 const VideoCaptureState& state, | |
85 const VideoCaptureParams& device_info); | |
86 | 83 |
87 // Only accessed from main thread. | 84 // Only accessed from main thread. |
88 VideoCapture::EventHandler* proxied_; | 85 VideoCapture::EventHandler* proxied_; |
89 VideoCaptureState state_; | 86 VideoCaptureState state_; |
90 | 87 |
91 scoped_refptr<base::MessageLoopProxy> main_message_loop_; | 88 scoped_refptr<base::MessageLoopProxy> main_message_loop_; |
92 }; | 89 }; |
93 | 90 |
94 } // namespace media | 91 } // namespace media |
95 | 92 |
96 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ | 93 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_ |
OLD | NEW |