OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 virtual void RequestEncodingParametersChange(uint32 bitrate, | 137 virtual void RequestEncodingParametersChange(uint32 bitrate, |
138 uint32 framerate) = 0; | 138 uint32 framerate) = 0; |
139 | 139 |
140 // Destroys the encoder: all pending inputs and outputs are dropped | 140 // Destroys the encoder: all pending inputs and outputs are dropped |
141 // immediately and the component is freed. This call may asynchronously free | 141 // immediately and the component is freed. This call may asynchronously free |
142 // system resources, but its client-visible effects are synchronous. After | 142 // system resources, but its client-visible effects are synchronous. After |
143 // this method returns no more callbacks will be made on the client. Deletes | 143 // this method returns no more callbacks will be made on the client. Deletes |
144 // |this| unconditionally, so make sure to drop all pointers to it! | 144 // |this| unconditionally, so make sure to drop all pointers to it! |
145 virtual void Destroy() = 0; | 145 virtual void Destroy() = 0; |
146 | 146 |
147 protected: | |
148 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 147 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
Pawel Osciak
2014/12/26 01:11:36
Please don't remove protected.
henryhsu
2014/12/26 08:40:41
oh ok. I removed this is due to ScopedVector. Now
| |
149 // will Destroy() it properly by default. | 148 // will Destroy() it properly by default. |
150 virtual ~VideoEncodeAccelerator(); | 149 virtual ~VideoEncodeAccelerator(); |
151 }; | 150 }; |
152 | 151 |
153 } // namespace media | 152 } // namespace media |
154 | 153 |
155 namespace base { | 154 namespace base { |
156 | 155 |
157 template <class T> | 156 template <class T> |
158 struct DefaultDeleter; | 157 struct DefaultDeleter; |
159 | 158 |
160 // Specialize DefaultDeleter so that scoped_ptr<VideoEncodeAccelerator> always | 159 // Specialize DefaultDeleter so that scoped_ptr<VideoEncodeAccelerator> always |
161 // uses "Destroy()" instead of trying to use the destructor. | 160 // uses "Destroy()" instead of trying to use the destructor. |
162 template <> | 161 template <> |
163 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { | 162 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { |
164 public: | 163 public: |
165 void operator()(void* video_encode_accelerator) const; | 164 void operator()(void* video_encode_accelerator) const; |
166 }; | 165 }; |
167 | 166 |
168 } // namespace base | 167 } // namespace base |
169 | 168 |
170 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 169 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |