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 // Specification of an encoding profile supported by an encoder. | 25 // Specification of an encoding profile supported by an encoder. |
26 struct SupportedProfile { | 26 struct MEDIA_EXPORT SupportedProfile { |
| 27 SupportedProfile(); |
| 28 ~SupportedProfile(); |
27 VideoCodecProfile profile; | 29 VideoCodecProfile profile; |
28 gfx::Size max_resolution; | 30 gfx::Size max_resolution; |
29 uint32 max_framerate_numerator; | 31 uint32 max_framerate_numerator; |
30 uint32 max_framerate_denominator; | 32 uint32 max_framerate_denominator; |
31 }; | 33 }; |
| 34 using SupportedProfiles = std::vector<SupportedProfile>; |
32 | 35 |
33 // Enumeration of potential errors generated by the API. | 36 // Enumeration of potential errors generated by the API. |
34 enum Error { | 37 enum Error { |
35 // An operation was attempted during an incompatible encoder state. | 38 // An operation was attempted during an incompatible encoder state. |
36 kIllegalStateError, | 39 kIllegalStateError, |
37 // Invalid argument was passed to an API method. | 40 // Invalid argument was passed to an API method. |
38 kInvalidArgumentError, | 41 kInvalidArgumentError, |
39 // A failure occurred at the GPU process or one of its dependencies. | 42 // A failure occurred at the GPU process or one of its dependencies. |
40 // Examples of such failures include GPU hardware failures, GPU driver | 43 // Examples of such failures include GPU hardware failures, GPU driver |
41 // failures, GPU library failures, GPU process programming errors, and so | 44 // failures, GPU library failures, GPU process programming errors, and so |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 protected: | 88 protected: |
86 // Clients are not owned by VEA instances and should not be deleted through | 89 // Clients are not owned by VEA instances and should not be deleted through |
87 // these pointers. | 90 // these pointers. |
88 virtual ~Client() {} | 91 virtual ~Client() {} |
89 }; | 92 }; |
90 | 93 |
91 // Video encoder functions. | 94 // Video encoder functions. |
92 | 95 |
93 // Returns a list of the supported codec profiles of the video encoder. This | 96 // Returns a list of the supported codec profiles of the video encoder. This |
94 // can be called before Initialize(). | 97 // can be called before Initialize(). |
95 virtual std::vector<SupportedProfile> GetSupportedProfiles() = 0; | 98 virtual SupportedProfiles GetSupportedProfiles() = 0; |
96 | 99 |
97 // Initializes the video encoder with specific configuration. Called once per | 100 // Initializes the video encoder with specific configuration. Called once per |
98 // encoder construction. This call is synchronous and returns true iff | 101 // encoder construction. This call is synchronous and returns true iff |
99 // initialization is successful. | 102 // initialization is successful. |
100 // Parameters: | 103 // Parameters: |
101 // |input_format| is the frame format of the input stream (as would be | 104 // |input_format| is the frame format of the input stream (as would be |
102 // reported by VideoFrame::format() for frames passed to Encode()). | 105 // reported by VideoFrame::format() for frames passed to Encode()). |
103 // |input_visible_size| is the resolution of the input stream (as would be | 106 // |input_visible_size| is the resolution of the input stream (as would be |
104 // reported by VideoFrame::visible_rect().size() for frames passed to | 107 // reported by VideoFrame::visible_rect().size() for frames passed to |
105 // Encode()). | 108 // Encode()). |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // uses "Destroy()" instead of trying to use the destructor. | 164 // uses "Destroy()" instead of trying to use the destructor. |
162 template <> | 165 template <> |
163 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { | 166 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { |
164 public: | 167 public: |
165 void operator()(void* video_encode_accelerator) const; | 168 void operator()(void* video_encode_accelerator) const; |
166 }; | 169 }; |
167 | 170 |
168 } // namespace base | 171 } // namespace base |
169 | 172 |
170 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 173 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |