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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // per encoder construction. | 98 // per encoder construction. |
99 // Parameters: | 99 // Parameters: |
100 // |input_format| is the frame format of the input stream (as would be | 100 // |input_format| is the frame format of the input stream (as would be |
101 // reported by VideoFrame::format() for frames passed to Encode()). | 101 // reported by VideoFrame::format() for frames passed to Encode()). |
102 // |input_visible_size| is the resolution of the input stream (as would be | 102 // |input_visible_size| is the resolution of the input stream (as would be |
103 // reported by VideoFrame::visible_rect().size() for frames passed to | 103 // reported by VideoFrame::visible_rect().size() for frames passed to |
104 // Encode()). | 104 // Encode()). |
105 // |output_profile| is the codec profile of the encoded output stream. | 105 // |output_profile| is the codec profile of the encoded output stream. |
106 // |initial_bitrate| is the initial bitrate of the encoded output stream, | 106 // |initial_bitrate| is the initial bitrate of the encoded output stream, |
107 // in bits per second. | 107 // in bits per second. |
| 108 // |client| is the client of this video encoder. The provided pointer must |
| 109 // be valid until Destroy() is called. |
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(VideoFrame::Format input_format, |
110 const gfx::Size& input_visible_size, | 112 const gfx::Size& input_visible_size, |
111 VideoCodecProfile output_profile, | 113 VideoCodecProfile output_profile, |
112 uint32 initial_bitrate) = 0; | 114 uint32 initial_bitrate, |
| 115 Client* client) = 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; |
120 | 123 |
121 // Send a bitstream buffer to the encoder to be used for storing future | 124 // Send a bitstream buffer to the encoder to be used for storing future |
122 // encoded output. Each call here with a given |buffer| will cause the buffer | 125 // encoded output. Each call here with a given |buffer| will cause the buffer |
(...skipping 14 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 |