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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Clients are not owned by VEA instances and should not be deleted through | 90 // Clients are not owned by VEA instances and should not be deleted through |
91 // these pointers. | 91 // these pointers. |
92 virtual ~Client() {} | 92 virtual ~Client() {} |
93 }; | 93 }; |
94 | 94 |
95 // Video encoder functions. | 95 // Video encoder functions. |
96 | 96 |
97 // Initialize the video encoder with a specific configuration. Called once | 97 // Initialize the video encoder with a specific configuration. Called once |
98 // per encoder construction. | 98 // per encoder construction. |
99 // Parameters: | 99 // Parameters: |
| 100 // |client| is the client of this video encoder. The provided pointer must |
| 101 // be valid until Destroy() is called. |
100 // |input_format| is the frame format of the input stream (as would be | 102 // |input_format| is the frame format of the input stream (as would be |
101 // reported by VideoFrame::format() for frames passed to Encode()). | 103 // reported by VideoFrame::format() for frames passed to Encode()). |
102 // |input_visible_size| is the resolution of the input stream (as would be | 104 // |input_visible_size| is the resolution of the input stream (as would be |
103 // reported by VideoFrame::visible_rect().size() for frames passed to | 105 // reported by VideoFrame::visible_rect().size() for frames passed to |
104 // Encode()). | 106 // Encode()). |
105 // |output_profile| is the codec profile of the encoded output stream. | 107 // |output_profile| is the codec profile of the encoded output stream. |
106 // |initial_bitrate| is the initial bitrate of the encoded output stream, | 108 // |initial_bitrate| is the initial bitrate of the encoded output stream, |
107 // in bits per second. | 109 // in bits per second. |
108 // TODO(sheu): handle resolution changes. http://crbug.com/249944 | 110 // TODO(sheu): handle resolution changes. http://crbug.com/249944 |
109 virtual void Initialize(media::VideoFrame::Format input_format, | 111 virtual void Initialize(Client* client, |
| 112 VideoFrame::Format input_format, |
110 const gfx::Size& input_visible_size, | 113 const gfx::Size& input_visible_size, |
111 VideoCodecProfile output_profile, | 114 VideoCodecProfile output_profile, |
112 uint32 initial_bitrate) = 0; | 115 uint32 initial_bitrate) = 0; |
113 | 116 |
114 // Encodes the given frame. | 117 // Encodes the given frame. |
115 // Parameters: | 118 // Parameters: |
116 // |frame| is the VideoFrame that is to be encoded. | 119 // |frame| is the VideoFrame that is to be encoded. |
117 // |force_keyframe| forces the encoding of a keyframe for this frame. | 120 // |force_keyframe| forces the encoding of a keyframe for this frame. |
118 virtual void Encode(const scoped_refptr<VideoFrame>& frame, | 121 virtual void Encode(const scoped_refptr<VideoFrame>& frame, |
119 bool force_keyframe) = 0; | 122 bool force_keyframe) = 0; |
(...skipping 17 matching lines...) Expand all Loading... |
137 // immediately and the component is freed. This call may asynchronously free | 140 // immediately and the component is freed. This call may asynchronously free |
138 // system resources, but its client-visible effects are synchronous. After | 141 // system resources, but its client-visible effects are synchronous. After |
139 // this method returns no more callbacks will be made on the client. Deletes | 142 // this method returns no more callbacks will be made on the client. Deletes |
140 // |this| unconditionally, so make sure to drop all pointers to it! | 143 // |this| unconditionally, so make sure to drop all pointers to it! |
141 virtual void Destroy() = 0; | 144 virtual void Destroy() = 0; |
142 }; | 145 }; |
143 | 146 |
144 } // namespace media | 147 } // namespace media |
145 | 148 |
146 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ | 149 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |