| 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 CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/media/video_capture.h" | 14 #include "content/common/media/video_capture.h" |
| 15 #include "content/public/renderer/media_stream_video_sink.h" | 15 #include "content/public/renderer/media_stream_video_sink.h" |
| 16 #include "content/renderer/media/video_capture_message_filter.h" | 16 #include "content/renderer/media/video_capture_message_filter.h" |
| 17 #include "media/base/video_capture_types.h" | 17 #include "media/base/video_capture_types.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
| 21 } // namespace base | 21 } // namespace base |
| 22 | 22 |
| 23 namespace gpu { | |
| 24 struct MailboxHolder; | |
| 25 } // namespace gpu | |
| 26 | |
| 27 namespace media { | 23 namespace media { |
| 28 class VideoFrame; | 24 class VideoFrame; |
| 29 } // namespace media | 25 } // namespace media |
| 30 | 26 |
| 31 namespace content { | 27 namespace content { |
| 32 | 28 |
| 33 // VideoCaptureImpl represents a capture device in renderer process. It provides | 29 // VideoCaptureImpl represents a capture device in renderer process. It provides |
| 34 // interfaces for clients to Start/Stop capture. It also communicates to clients | 30 // interfaces for clients to Start/Stop capture. It also communicates to clients |
| 35 // when buffer is ready, state of capture device is changed. | 31 // when buffer is ready, state of capture device is changed. |
| 36 | 32 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const gfx::Size& size, | 112 const gfx::Size& size, |
| 117 int buffer_id) override; | 113 int buffer_id) override; |
| 118 void OnBufferDestroyed(int buffer_id) override; | 114 void OnBufferDestroyed(int buffer_id) override; |
| 119 void OnBufferReceived( | 115 void OnBufferReceived( |
| 120 int buffer_id, | 116 int buffer_id, |
| 121 base::TimeTicks timestamp, | 117 base::TimeTicks timestamp, |
| 122 const base::DictionaryValue& metadata, | 118 const base::DictionaryValue& metadata, |
| 123 media::VideoPixelFormat pixel_format, | 119 media::VideoPixelFormat pixel_format, |
| 124 media::VideoFrame::StorageType storage_type, | 120 media::VideoFrame::StorageType storage_type, |
| 125 const gfx::Size& coded_size, | 121 const gfx::Size& coded_size, |
| 126 const gfx::Rect& visible_rect, | 122 const gfx::Rect& visible_rect) override; |
| 127 const gpu::MailboxHolder& mailbox_holder) override; | |
| 128 void OnStateChanged(VideoCaptureState state) override; | 123 void OnStateChanged(VideoCaptureState state) override; |
| 129 void OnDeviceSupportedFormatsEnumerated( | 124 void OnDeviceSupportedFormatsEnumerated( |
| 130 const media::VideoCaptureFormats& supported_formats) override; | 125 const media::VideoCaptureFormats& supported_formats) override; |
| 131 void OnDeviceFormatsInUseReceived( | 126 void OnDeviceFormatsInUseReceived( |
| 132 const media::VideoCaptureFormats& formats_in_use) override; | 127 const media::VideoCaptureFormats& formats_in_use) override; |
| 133 void OnDelegateAdded(int32 device_id) override; | 128 void OnDelegateAdded(int32 device_id) override; |
| 134 | 129 |
| 135 // Sends an IPC message to browser process when all clients are done with the | 130 // Sends an IPC message to browser process when all clients are done with the |
| 136 // buffer. | 131 // buffer. |
| 137 void OnClientBufferFinished(int buffer_id, | 132 void OnClientBufferFinished(int buffer_id, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // in |client_buffers_|. | 195 // in |client_buffers_|. |
| 201 // NOTE: Weak pointers must be invalidated before all other member variables. | 196 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 202 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; | 197 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; |
| 203 | 198 |
| 204 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); | 199 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); |
| 205 }; | 200 }; |
| 206 | 201 |
| 207 } // namespace content | 202 } // namespace content |
| 208 | 203 |
| 209 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 204 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| OLD | NEW |