| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // An implementation must start capture frames using the resolution in | 105 // An implementation must start capture frames using the resolution in |
| 106 // |params|. When the source has started or the source failed to start | 106 // |params|. When the source has started or the source failed to start |
| 107 // OnStartDone must be called. An implementation must call | 107 // OnStartDone must be called. An implementation must call |
| 108 // invoke |frame_callback| on the IO thread with the captured frames. | 108 // invoke |frame_callback| on the IO thread with the captured frames. |
| 109 // TODO(perkj): pass a VideoCaptureFormats instead of VideoCaptureParams for | 109 // TODO(perkj): pass a VideoCaptureFormats instead of VideoCaptureParams for |
| 110 // subclasses to customize. | 110 // subclasses to customize. |
| 111 virtual void StartSourceImpl( | 111 virtual void StartSourceImpl( |
| 112 const media::VideoCaptureParams& params, | 112 const media::VideoCaptureParams& params, |
| 113 const VideoCaptureDeliverFrameCB& frame_callback) = 0; | 113 const VideoCaptureDeliverFrameCB& frame_callback) = 0; |
| 114 void OnStartDone(bool success); | 114 void OnStartDone(MediaStreamRequestResult result); |
| 115 | 115 |
| 116 // An implementation must immediately stop capture video frames and must not | 116 // An implementation must immediately stop capture video frames and must not |
| 117 // call OnSupportedFormats after this method has been called. After this | 117 // call OnSupportedFormats after this method has been called. After this |
| 118 // method has been called, MediaStreamVideoSource may be deleted. | 118 // method has been called, MediaStreamVideoSource may be deleted. |
| 119 virtual void StopSourceImpl() = 0; | 119 virtual void StopSourceImpl() = 0; |
| 120 | 120 |
| 121 enum State { | 121 enum State { |
| 122 NEW, | 122 NEW, |
| 123 RETRIEVING_CAPABILITIES, | 123 RETRIEVING_CAPABILITIES, |
| 124 STARTING, | 124 STARTING, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 // NOTE: Weak pointers must be invalidated before all other member variables. | 176 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 177 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; | 177 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); | 179 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 } // namespace content | 182 } // namespace content |
| 183 | 183 |
| 184 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 184 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
| OLD | NEW |