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

Side by Side Diff: content/common/gpu/media/v4l2_image_processor.h

Issue 826663002: Support multiple video decoders and encoders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address piman's review comments Created 5 years, 11 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 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_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void Process(const scoped_refptr<media::VideoFrame>& frame, 51 void Process(const scoped_refptr<media::VideoFrame>& frame,
52 const FrameReadyCB& cb); 52 const FrameReadyCB& cb);
53 53
54 // Stop all processing and clean up. 54 // Stop all processing and clean up.
55 void Destroy(); 55 void Destroy();
56 56
57 private: 57 private:
58 // Record for input buffers. 58 // Record for input buffers.
59 struct InputRecord { 59 struct InputRecord {
60 InputRecord(); 60 InputRecord();
61 ~InputRecord();
61 scoped_refptr<media::VideoFrame> frame; 62 scoped_refptr<media::VideoFrame> frame;
62 bool at_device; 63 bool at_device;
63 }; 64 };
64 65
65 // Record for output buffers. 66 // Record for output buffers.
66 struct OutputRecord { 67 struct OutputRecord {
67 OutputRecord(); 68 OutputRecord();
69 ~OutputRecord();
68 bool at_device; 70 bool at_device;
69 bool at_client; 71 bool at_client;
70 std::vector<int> fds; 72 std::vector<int> fds;
71 }; 73 };
72 74
73 // Job record. Jobs are processed in a FIFO order. This is separate from 75 // Job record. Jobs are processed in a FIFO order. This is separate from
74 // InputRecord, because an InputRecord may be returned before we dequeue 76 // InputRecord, because an InputRecord may be returned before we dequeue
75 // the corresponding output buffer. It can't always be associated with 77 // the corresponding output buffer. It can't always be associated with
76 // an OutputRecord immediately either, because at the time of submission we 78 // an OutputRecord immediately either, because at the time of submission we
77 // may not have one available (and don't need one to submit input to the 79 // may not have one available (and don't need one to submit input to the
78 // device). 80 // device).
79 struct JobRecord { 81 struct JobRecord {
80 JobRecord(); 82 JobRecord();
83 ~JobRecord();
81 scoped_refptr<media::VideoFrame> frame; 84 scoped_refptr<media::VideoFrame> frame;
82 FrameReadyCB ready_cb; 85 FrameReadyCB ready_cb;
83 }; 86 };
84 87
85 enum { 88 enum {
86 // Arbitrarily tuned. 89 // Arbitrarily tuned.
87 kInputBufferCount = 2, 90 kInputBufferCount = 2,
88 kOutputBufferCount = 2, 91 kOutputBufferCount = 2,
89 }; 92 };
90 93
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 171
169 // Weak factory for producing weak pointers on the device_thread_ 172 // Weak factory for producing weak pointers on the device_thread_
170 base::WeakPtrFactory<V4L2ImageProcessor> device_weak_factory_; 173 base::WeakPtrFactory<V4L2ImageProcessor> device_weak_factory_;
171 174
172 DISALLOW_COPY_AND_ASSIGN(V4L2ImageProcessor); 175 DISALLOW_COPY_AND_ASSIGN(V4L2ImageProcessor);
173 }; 176 };
174 177
175 } // namespace content 178 } // namespace content
176 179
177 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_ 180 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_PROCESSOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/common/gpu/media/v4l2_image_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698