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

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

Issue 2911063002: Deprecate NonThreadSafe in content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h in … (Closed)
Patch Set: merge .cc in same CL Created 3 years, 6 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GPU_JPEG_DECODER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 13
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/sequence_checker.h"
18 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
19 #include "base/threading/thread.h" 20 #include "base/threading/thread.h"
20 #include "content/common/content_export.h" 21 #include "content/common/content_export.h"
21 #include "media/capture/video/video_capture_jpeg_decoder.h" 22 #include "media/capture/video/video_capture_jpeg_decoder.h"
22 #include "media/video/jpeg_decode_accelerator.h" 23 #include "media/video/jpeg_decode_accelerator.h"
23 24
24 namespace gpu { 25 namespace gpu {
25 class GpuChannelHost; 26 class GpuChannelHost;
26 } 27 }
27 28
28 namespace content { 29 namespace content {
29 30
30 // Adapter to GpuJpegDecodeAccelerator for VideoCaptureDevice::Client. It takes 31 // Adapter to GpuJpegDecodeAccelerator for VideoCaptureDevice::Client. It takes
31 // care of GpuJpegDecodeAccelerator creation, shared memory, and threading 32 // care of GpuJpegDecodeAccelerator creation, shared memory, and threading
32 // issues. 33 // issues.
33 // 34 //
34 // All public methods except JpegDecodeAccelerator::Client ones should be called 35 // All public methods except JpegDecodeAccelerator::Client ones should be called
35 // on the same thread. JpegDecodeAccelerator::Client methods should be called on 36 // on the same thread. JpegDecodeAccelerator::Client methods should be called on
36 // the IO thread. 37 // the IO thread.
37 class CONTENT_EXPORT VideoCaptureGpuJpegDecoder 38 class CONTENT_EXPORT VideoCaptureGpuJpegDecoder
38 : public media::VideoCaptureJpegDecoder, 39 : public media::VideoCaptureJpegDecoder,
39 public media::JpegDecodeAccelerator::Client, 40 public media::JpegDecodeAccelerator::Client,
40 public base::NonThreadSafe,
41 public base::SupportsWeakPtr<VideoCaptureGpuJpegDecoder> { 41 public base::SupportsWeakPtr<VideoCaptureGpuJpegDecoder> {
42 public: 42 public:
43 // |decode_done_cb| is called on the IO thread when decode succeed. This can 43 // |decode_done_cb| is called on the IO thread when decode succeed. This can
44 // be on any thread. |decode_done_cb| is never called after 44 // be on any thread. |decode_done_cb| is never called after
45 // VideoCaptureGpuJpegDecoder is destroyed. 45 // VideoCaptureGpuJpegDecoder is destroyed.
46 VideoCaptureGpuJpegDecoder( 46 VideoCaptureGpuJpegDecoder(
47 DecodeDoneCB decode_done_cb, 47 DecodeDoneCB decode_done_cb,
48 base::Callback<void(const std::string&)> send_log_message_cb); 48 base::Callback<void(const std::string&)> send_log_message_cb);
49 ~VideoCaptureGpuJpegDecoder() override; 49 ~VideoCaptureGpuJpegDecoder() override;
50 50
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 // The id for current input BitstreamBuffer being decoded. 108 // The id for current input BitstreamBuffer being decoded.
109 int32_t in_buffer_id_; 109 int32_t in_buffer_id_;
110 110
111 // Shared memory to store JPEG stream buffer. The input BitstreamBuffer is 111 // Shared memory to store JPEG stream buffer. The input BitstreamBuffer is
112 // backed by this. 112 // backed by this.
113 std::unique_ptr<base::SharedMemory> in_shared_memory_; 113 std::unique_ptr<base::SharedMemory> in_shared_memory_;
114 114
115 STATUS decoder_status_; 115 STATUS decoder_status_;
116 116
117 SEQUENCE_CHECKER(sequence_checker_);
118
117 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder); 119 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder);
118 }; 120 };
119 121
120 } // namespace content 122 } // namespace content
121 123
122 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 124 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698