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

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

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_
7 7
8 #include "base/memory/linked_ptr.h" 8 #include "base/memory/linked_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Client* client_; 80 Client* client_;
81 81
82 // WeakPtr<> pointing to |this| for use in posting tasks from the decoder 82 // WeakPtr<> pointing to |this| for use in posting tasks from the decoder
83 // thread back to the ChildThread. Because the decoder thread is a member of 83 // thread back to the ChildThread. Because the decoder thread is a member of
84 // this class, any task running on the decoder thread is guaranteed that this 84 // this class, any task running on the decoder thread is guaranteed that this
85 // object is still alive. As a result, tasks posted from ChildThread to 85 // object is still alive. As a result, tasks posted from ChildThread to
86 // decoder thread should use base::Unretained(this), and tasks posted from the 86 // decoder thread should use base::Unretained(this), and tasks posted from the
87 // decoder thread to the ChildThread should use |weak_this_|. 87 // decoder thread to the ChildThread should use |weak_this_|.
88 base::WeakPtr<VaapiJpegDecodeAccelerator> weak_this_; 88 base::WeakPtr<VaapiJpegDecodeAccelerator> weak_this_;
89 89
90 scoped_ptr<VaapiWrapper> vaapi_wrapper_; 90 scoped_refptr<VaapiWrapper> vaapi_wrapper_;
91 91
92 // Comes after vaapi_wrapper_ to ensure its destructor is executed before 92 // Comes after vaapi_wrapper_ to ensure its destructor is executed before
93 // |vaapi_wrapper_| is destroyed. 93 // |vaapi_wrapper_| is destroyed.
94 scoped_ptr<VaapiJpegDecoder> decoder_; 94 scoped_ptr<VaapiJpegDecoder> decoder_;
95 base::Thread decoder_thread_; 95 base::Thread decoder_thread_;
96 // Use this to post tasks to |decoder_thread_| instead of 96 // Use this to post tasks to |decoder_thread_| instead of
97 // |decoder_thread_.task_runner()| because the latter will be NULL once 97 // |decoder_thread_.task_runner()| because the latter will be NULL once
98 // |decoder_thread_.Stop()| returns. 98 // |decoder_thread_.Stop()| returns.
99 scoped_refptr<base::SingleThreadTaskRunner> decoder_task_runner_; 99 scoped_refptr<base::SingleThreadTaskRunner> decoder_task_runner_;
100 100
101 // The current VA surface for decoding. 101 // The current VA surface for decoding.
102 VASurfaceID va_surface_id_; 102 VASurfaceID va_surface_id_;
103 // The coded size associated with |va_surface_id_|. 103 // The coded size associated with |va_surface_id_|.
104 gfx::Size coded_size_; 104 gfx::Size coded_size_;
105 // The VA RT format associated with |va_surface_id_|. 105 // The VA RT format associated with |va_surface_id_|.
106 unsigned int va_rt_format_; 106 unsigned int va_rt_format_;
107 107
108 // The WeakPtrFactory for |weak_this_|. 108 // The WeakPtrFactory for |weak_this_|.
109 base::WeakPtrFactory<VaapiJpegDecodeAccelerator> weak_this_factory_; 109 base::WeakPtrFactory<VaapiJpegDecodeAccelerator> weak_this_factory_;
110 110
111 DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecodeAccelerator); 111 DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecodeAccelerator);
112 }; 112 };
113 113
114 } // namespace content 114 } // namespace content
115 115
116 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ 116 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_drm_picture.cc ('k') | content/common/gpu/media/vaapi_jpeg_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698