Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Side by Side Diff: content/browser/renderer_host/media/video_capture_device_client.h

Issue 1016773002: MJPEG acceleration for video capture using VAAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reuse VASurface Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 GpuJpegDecoder;
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 scoped_ptr<Buffer> buffer, 63 scoped_ptr<Buffer> buffer,
63 const scoped_refptr<media::VideoFrame>& frame, 64 const scoped_refptr<media::VideoFrame>& frame,
64 const base::TimeTicks& timestamp) override; 65 const base::TimeTicks& timestamp) override;
65 void OnError(const std::string& reason) override; 66 void OnError(const std::string& reason) override;
66 void OnLog(const std::string& message) override; 67 void OnLog(const std::string& message) override;
67 68
68 private: 69 private:
69 // The controller to which we post events. 70 // The controller to which we post events.
70 const base::WeakPtr<VideoCaptureController> controller_; 71 const base::WeakPtr<VideoCaptureController> controller_;
71 72
73 // Hardware JPEG decoder.
74 scoped_ptr<GpuJpegDecoder> external_jpeg_decoder_;
75
72 // The pool of shared-memory buffers used for capturing. 76 // The pool of shared-memory buffers used for capturing.
73 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; 77 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
74 78
75 // Internal delegate for GpuMemoryBuffer-into-VideoFrame wrapping. 79 // Internal delegate for GpuMemoryBuffer-into-VideoFrame wrapping.
76 class TextureWrapHelper; 80 class TextureWrapHelper;
77 scoped_refptr<TextureWrapHelper> texture_wrap_helper_; 81 scoped_refptr<TextureWrapHelper> texture_wrap_helper_;
78 // Reference to Capture Thread task runner, where |texture_wrap_helper_| 82 // Reference to Capture Thread task runner, where |texture_wrap_helper_|
79 // lives. 83 // lives.
80 const scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; 84 const scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
81 85
82 media::VideoPixelFormat last_captured_pixel_format_; 86 media::VideoPixelFormat last_captured_pixel_format_;
83 87
84 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); 88 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient);
85 }; 89 };
86 90
87 91
88 } // namespace content 92 } // namespace content
89 93
90 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_ 94 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698