| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 static bool IsConstraintSupported(const std::string& name); | 85 static bool IsConstraintSupported(const std::string& name); |
| 86 | 86 |
| 87 // Request underlying source to capture a new frame. | 87 // Request underlying source to capture a new frame. |
| 88 virtual void RequestRefreshFrame() {} | 88 virtual void RequestRefreshFrame() {} |
| 89 | 89 |
| 90 // Returns the task runner where video frames will be delivered on. | 90 // Returns the task runner where video frames will be delivered on. |
| 91 base::SingleThreadTaskRunner* io_task_runner() const; | 91 base::SingleThreadTaskRunner* io_task_runner() const; |
| 92 | 92 |
| 93 const media::VideoCaptureFormat* GetCurrentFormat() const; | 93 const media::VideoCaptureFormat* GetCurrentFormat() const; |
| 94 | 94 |
| 95 base::WeakPtr<MediaStreamVideoSource> GetWeakPtr() { |
| 96 return weak_factory_.GetWeakPtr(); |
| 97 } |
| 98 |
| 95 protected: | 99 protected: |
| 96 void DoStopSource() override; | 100 void DoStopSource() override; |
| 97 | 101 |
| 98 // Sets ready state and notifies the ready state to all registered tracks. | 102 // Sets ready state and notifies the ready state to all registered tracks. |
| 99 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); | 103 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); |
| 100 | 104 |
| 101 // Sets muted state and notifies it to all registered tracks. | 105 // Sets muted state and notifies it to all registered tracks. |
| 102 virtual void SetMutedState(bool state); | 106 virtual void SetMutedState(bool state); |
| 103 | 107 |
| 104 // An implementation must fetch the formats that can currently be used by | 108 // An implementation must fetch the formats that can currently be used by |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 193 |
| 190 // NOTE: Weak pointers must be invalidated before all other member variables. | 194 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 191 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; | 195 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; |
| 192 | 196 |
| 193 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); | 197 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); |
| 194 }; | 198 }; |
| 195 | 199 |
| 196 } // namespace content | 200 } // namespace content |
| 197 | 201 |
| 198 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 202 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
| OLD | NEW |