| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // |max_requested_height| and |max_requested_width| are 0. | 100 // |max_requested_height| and |max_requested_width| are 0. |
| 101 virtual void GetCurrentSupportedFormats( | 101 virtual void GetCurrentSupportedFormats( |
| 102 int max_requested_width, | 102 int max_requested_width, |
| 103 int max_requested_height, | 103 int max_requested_height, |
| 104 double max_requested_frame_rate, | 104 double max_requested_frame_rate, |
| 105 const VideoCaptureDeviceFormatsCB& callback) = 0; | 105 const VideoCaptureDeviceFormatsCB& callback) = 0; |
| 106 | 106 |
| 107 // An implementation must start capture frames using the resolution in | 107 // An implementation must start capture frames using the resolution in |
| 108 // |params|. When the source has started or the source failed to start | 108 // |params|. When the source has started or the source failed to start |
| 109 // OnStartDone must be called. An implementation must call | 109 // OnStartDone must be called. An implementation must call |
| 110 // invoke |frame_callback| on the IO thread with the captured frames. | 110 // |frame_callback| on the IO thread with the captured frames. |
| 111 // TODO(perkj): pass a VideoCaptureFormats instead of VideoCaptureParams for | |
| 112 // subclasses to customize. | |
| 113 virtual void StartSourceImpl( | 111 virtual void StartSourceImpl( |
| 114 const media::VideoCaptureParams& params, | 112 const media::VideoCaptureFormat& format, |
| 115 const VideoCaptureDeliverFrameCB& frame_callback) = 0; | 113 const VideoCaptureDeliverFrameCB& frame_callback) = 0; |
| 116 void OnStartDone(MediaStreamRequestResult result); | 114 void OnStartDone(MediaStreamRequestResult result); |
| 117 | 115 |
| 118 // An implementation must immediately stop capture video frames and must not | 116 // An implementation must immediately stop capture video frames and must not |
| 119 // call OnSupportedFormats after this method has been called. After this | 117 // call OnSupportedFormats after this method has been called. After this |
| 120 // method has been called, MediaStreamVideoSource may be deleted. | 118 // method has been called, MediaStreamVideoSource may be deleted. |
| 121 virtual void StopSourceImpl() = 0; | 119 virtual void StopSourceImpl() = 0; |
| 122 | 120 |
| 123 enum State { | 121 enum State { |
| 124 NEW, | 122 NEW, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 174 |
| 177 // NOTE: Weak pointers must be invalidated before all other member variables. | 175 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 178 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; | 176 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; |
| 179 | 177 |
| 180 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); | 178 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); |
| 181 }; | 179 }; |
| 182 | 180 |
| 183 } // namespace content | 181 } // namespace content |
| 184 | 182 |
| 185 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 183 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
| OLD | NEW |