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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "media/base/bitstream_buffer.h" | 12 #include "media/base/bitstream_buffer.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "media/base/video_decoder_config.h" | 14 #include "media/base/video_decoder_config.h" |
15 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 class BitstreamBuffer; | 19 class BitstreamBuffer; |
20 class VideoFrame; | 20 class VideoFrame; |
21 | 21 |
22 // Video encoder interface. | 22 // Video encoder interface. |
23 class MEDIA_EXPORT VideoEncodeAccelerator { | 23 class MEDIA_EXPORT VideoEncodeAccelerator { |
24 public: | 24 public: |
25 virtual ~VideoEncodeAccelerator(); | |
26 | |
27 // Specification of an encoding profile supported by an encoder. | 25 // Specification of an encoding profile supported by an encoder. |
28 struct SupportedProfile { | 26 struct SupportedProfile { |
29 VideoCodecProfile profile; | 27 VideoCodecProfile profile; |
30 gfx::Size max_resolution; | 28 gfx::Size max_resolution; |
31 struct { | 29 struct { |
32 uint32 numerator; | 30 uint32 numerator; |
33 uint32 denominator; | 31 uint32 denominator; |
34 } max_framerate; | 32 } max_framerate; |
35 }; | 33 }; |
36 | 34 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // |framerate| is the requested new framerate, in frames per second. | 134 // |framerate| is the requested new framerate, in frames per second. |
137 virtual void RequestEncodingParametersChange(uint32 bitrate, | 135 virtual void RequestEncodingParametersChange(uint32 bitrate, |
138 uint32 framerate) = 0; | 136 uint32 framerate) = 0; |
139 | 137 |
140 // Destroys the encoder: all pending inputs and outputs are dropped | 138 // Destroys the encoder: all pending inputs and outputs are dropped |
141 // immediately and the component is freed. This call may asynchronously free | 139 // immediately and the component is freed. This call may asynchronously free |
142 // system resources, but its client-visible effects are synchronous. After | 140 // system resources, but its client-visible effects are synchronous. After |
143 // this method returns no more callbacks will be made on the client. Deletes | 141 // 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! | 142 // |this| unconditionally, so make sure to drop all pointers to it! |
145 virtual void Destroy() = 0; | 143 virtual void Destroy() = 0; |
| 144 |
| 145 protected: |
| 146 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
| 147 // will Destroy() it properly by default. |
| 148 virtual ~VideoEncodeAccelerator(); |
146 }; | 149 }; |
147 | 150 |
148 } // namespace media | 151 } // namespace media |
149 | 152 |
| 153 namespace base { |
| 154 |
| 155 template <class T> |
| 156 struct DefaultDeleter; |
| 157 |
| 158 // Specialize DefaultDeleter so that scoped_ptr<VideoEncodeAccelerator> always |
| 159 // uses "Destroy()" instead of trying to use the destructor. |
| 160 template <> |
| 161 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { |
| 162 public: |
| 163 void operator()(void* video_encode_accelerator) const; |
| 164 }; |
| 165 |
| 166 } // namespace base |
| 167 |
150 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 168 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |