| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "media/video/capture/video_capture_device.h" | 12 #include "media/video/capture/video_capture_device.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class GpuJpegDecodeAcceleratorAdapter; |
| 15 class VideoCaptureBufferPool; | 16 class VideoCaptureBufferPool; |
| 16 class VideoCaptureController; | 17 class VideoCaptureController; |
| 17 | 18 |
| 18 // Receives events from the VideoCaptureDevice and posts them to a |controller_| | 19 // Receives events from the VideoCaptureDevice and posts them to a |controller_| |
| 19 // on the IO thread. An instance of this class may safely outlive its target | 20 // on the IO thread. An instance of this class may safely outlive its target |
| 20 // VideoCaptureController. This is a shallow class meant to convert incoming | 21 // VideoCaptureController. This is a shallow class meant to convert incoming |
| 21 // frames and holds no significant state. | 22 // frames and holds no significant state. |
| 22 // | 23 // |
| 23 // Methods of this class may be called from any thread, and in practice will | 24 // Methods of this class may be called from any thread, and in practice will |
| 24 // often be called on some auxiliary thread depending on the platform and the | 25 // often be called on some auxiliary thread depending on the platform and the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 54 const scoped_refptr<Buffer>& buffer, | 55 const scoped_refptr<Buffer>& buffer, |
| 55 const scoped_refptr<media::VideoFrame>& frame, | 56 const scoped_refptr<media::VideoFrame>& frame, |
| 56 const base::TimeTicks& timestamp) override; | 57 const base::TimeTicks& timestamp) override; |
| 57 void OnError(const std::string& reason) override; | 58 void OnError(const std::string& reason) override; |
| 58 void OnLog(const std::string& message) override; | 59 void OnLog(const std::string& message) override; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 // The controller to which we post events. | 62 // The controller to which we post events. |
| 62 const base::WeakPtr<VideoCaptureController> controller_; | 63 const base::WeakPtr<VideoCaptureController> controller_; |
| 63 | 64 |
| 65 // Hardware JPEG decoder. |
| 66 scoped_ptr<GpuJpegDecodeAcceleratorAdapter> external_jpeg_decoder_; |
| 67 |
| 64 // The pool of shared-memory buffers used for capturing. | 68 // The pool of shared-memory buffers used for capturing. |
| 65 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 69 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
| 66 | 70 |
| 67 media::VideoPixelFormat last_captured_pixel_format_; | 71 media::VideoPixelFormat last_captured_pixel_format_; |
| 68 | 72 |
| 69 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); | 73 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 | 76 |
| 73 } // namespace content | 77 } // namespace content |
| 74 | 78 |
| 75 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 79 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| OLD | NEW |