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

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

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments and rebase Created 4 years, 9 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 (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 // This file contains an implementation of VideoDecoderAccelerator 5 // This file contains an implementation of VideoDecoderAccelerator
6 // that utilizes hardware video decoder present on Intel CPUs. 6 // that utilizes hardware video decoder present on Intel CPUs.
7 7
8 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ 8 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
9 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ 9 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
10 10
11 #include <stddef.h> 11 #include <stddef.h>
12 #include <stdint.h> 12 #include <stdint.h>
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <queue> 16 #include <queue>
17 #include <utility> 17 #include <utility>
18 #include <vector> 18 #include <vector>
19 19
20 #include "base/logging.h" 20 #include "base/logging.h"
21 #include "base/macros.h" 21 #include "base/macros.h"
22 #include "base/memory/linked_ptr.h" 22 #include "base/memory/linked_ptr.h"
23 #include "base/memory/shared_memory.h"
24 #include "base/memory/weak_ptr.h" 23 #include "base/memory/weak_ptr.h"
25 #include "base/message_loop/message_loop.h" 24 #include "base/message_loop/message_loop.h"
26 #include "base/synchronization/condition_variable.h" 25 #include "base/synchronization/condition_variable.h"
27 #include "base/synchronization/lock.h" 26 #include "base/synchronization/lock.h"
28 #include "base/threading/thread.h" 27 #include "base/threading/thread.h"
29 #include "content/common/content_export.h" 28 #include "content/common/content_export.h"
29 #include "content/common/gpu/media/shared_memory_region.h"
30 #include "content/common/gpu/media/vaapi_wrapper.h" 30 #include "content/common/gpu/media/vaapi_wrapper.h"
31 #include "media/base/bitstream_buffer.h" 31 #include "media/base/bitstream_buffer.h"
32 #include "media/video/picture.h" 32 #include "media/video/picture.h"
33 #include "media/video/video_decode_accelerator.h" 33 #include "media/video/video_decode_accelerator.h"
34 34
35 namespace gl { 35 namespace gl {
36 class GLImage; 36 class GLImage;
37 } 37 }
38 38
39 namespace content { 39 namespace content {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // Protects input buffer and surface queues and state_. 203 // Protects input buffer and surface queues and state_.
204 base::Lock lock_; 204 base::Lock lock_;
205 State state_; 205 State state_;
206 206
207 // An input buffer awaiting consumption, provided by the client. 207 // An input buffer awaiting consumption, provided by the client.
208 struct InputBuffer { 208 struct InputBuffer {
209 InputBuffer(); 209 InputBuffer();
210 ~InputBuffer(); 210 ~InputBuffer();
211 211
212 int32_t id; 212 int32_t id;
213 size_t size; 213 scoped_ptr<SharedMemoryRegion> shm;
214 scoped_ptr<base::SharedMemory> shm;
215 }; 214 };
216 215
217 // Queue for incoming input buffers. 216 // Queue for incoming input buffers.
218 typedef std::queue<linked_ptr<InputBuffer> > InputBuffers; 217 typedef std::queue<linked_ptr<InputBuffer> > InputBuffers;
219 InputBuffers input_buffers_; 218 InputBuffers input_buffers_;
220 // Signalled when input buffers are queued onto the input_buffers_ queue. 219 // Signalled when input buffers are queued onto the input_buffers_ queue.
221 base::ConditionVariable input_ready_; 220 base::ConditionVariable input_ready_;
222 221
223 // Current input buffer at decoder. 222 // Current input buffer at decoder.
224 linked_ptr<InputBuffer> curr_input_buffer_; 223 linked_ptr<InputBuffer> curr_input_buffer_;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 311
313 // The WeakPtrFactory for |weak_this_|. 312 // The WeakPtrFactory for |weak_this_|.
314 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_; 313 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_;
315 314
316 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator); 315 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator);
317 }; 316 };
318 317
319 } // namespace content 318 } // namespace content
320 319
321 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ 320 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc ('k') | content/common/gpu/media/vaapi_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698