| 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 <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "media/base/bitstream_buffer.h" | 13 #include "media/base/bitstream_buffer.h" |
| 13 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 14 #include "media/base/video_decoder_config.h" | 15 #include "media/base/video_decoder_config.h" |
| 15 #include "media/base/video_frame.h" | 16 #include "media/base/video_frame.h" |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual void Destroy() = 0; | 149 virtual void Destroy() = 0; |
| 149 | 150 |
| 150 protected: | 151 protected: |
| 151 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 152 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
| 152 // will Destroy() it properly by default. | 153 // will Destroy() it properly by default. |
| 153 virtual ~VideoEncodeAccelerator(); | 154 virtual ~VideoEncodeAccelerator(); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 } // namespace media | 157 } // namespace media |
| 157 | 158 |
| 158 namespace base { | 159 namespace std { |
| 159 | 160 |
| 160 template <class T> | 161 // Specialize std::default_delete so that scoped_ptr<VideoEncodeAccelerator> |
| 161 struct DefaultDeleter; | |
| 162 | |
| 163 // Specialize DefaultDeleter so that scoped_ptr<VideoEncodeAccelerator> always | |
| 164 // uses "Destroy()" instead of trying to use the destructor. | 162 // uses "Destroy()" instead of trying to use the destructor. |
| 165 template <> | 163 template <> |
| 166 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { | 164 struct MEDIA_EXPORT default_delete<media::VideoEncodeAccelerator> { |
| 167 public: | 165 void operator()(media::VideoEncodeAccelerator* vea) const; |
| 168 void operator()(void* video_encode_accelerator) const; | |
| 169 }; | 166 }; |
| 170 | 167 |
| 171 } // namespace base | 168 } // namespace std |
| 172 | 169 |
| 173 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 170 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
| OLD | NEW |