OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
6 #define MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // Create, start, and return a VideoCodecBridge encoder or NULL on failure. | 151 // Create, start, and return a VideoCodecBridge encoder or NULL on failure. |
152 static VideoCodecBridge* CreateEncoder( | 152 static VideoCodecBridge* CreateEncoder( |
153 const VideoCodec& codec, // e.g. media::kCodecVP8 | 153 const VideoCodec& codec, // e.g. media::kCodecVP8 |
154 const gfx::Size& size, // input frame size | 154 const gfx::Size& size, // input frame size |
155 int bit_rate, // bits/second | 155 int bit_rate, // bits/second |
156 int frame_rate, // frames/second | 156 int frame_rate, // frames/second |
157 int i_frame_interval, // count | 157 int i_frame_interval, // count |
158 int color_format); // MediaCodecInfo.CodecCapabilities. | 158 int color_format); // MediaCodecInfo.CodecCapabilities. |
159 | 159 |
160 void SetVideoBitrate(int bps); | 160 void SetVideoBitrate(int bps, int frame_rate); |
161 void RequestKeyFrameSoon(); | 161 void RequestKeyFrameSoon(); |
162 | 162 |
163 // Returns whether adaptive playback is supported for this object given | 163 // Returns whether adaptive playback is supported for this object given |
164 // the new size. | 164 // the new size. |
165 bool IsAdaptivePlaybackSupported(int width, int height); | 165 bool IsAdaptivePlaybackSupported(int width, int height); |
166 | 166 |
167 // Test-only method to set the return value of IsAdaptivePlaybackSupported(). | 167 // Test-only method to set the return value of IsAdaptivePlaybackSupported(). |
168 // Without this function, the return value of that function will be device | 168 // Without this function, the return value of that function will be device |
169 // dependent. If |adaptive_playback_supported| is equal to 0, the return value | 169 // dependent. If |adaptive_playback_supported| is equal to 0, the return value |
170 // will be false. If |adaptive_playback_supported| is larger than 0, the | 170 // will be false. If |adaptive_playback_supported| is larger than 0, the |
171 // return value will be true. | 171 // return value will be true. |
172 void set_adaptive_playback_supported_for_testing( | 172 void set_adaptive_playback_supported_for_testing( |
173 int adaptive_playback_supported) { | 173 int adaptive_playback_supported) { |
174 adaptive_playback_supported_for_testing_ = adaptive_playback_supported; | 174 adaptive_playback_supported_for_testing_ = adaptive_playback_supported; |
175 } | 175 } |
176 | 176 |
177 private: | 177 private: |
178 VideoCodecBridge(const std::string& mime, | 178 VideoCodecBridge(const std::string& mime, |
179 bool is_secure, | 179 bool is_secure, |
180 MediaCodecDirection direction, | 180 MediaCodecDirection direction, |
181 bool require_software_codec); | 181 bool require_software_codec); |
182 | 182 |
183 int adaptive_playback_supported_for_testing_; | 183 int adaptive_playback_supported_for_testing_; |
184 }; | 184 }; |
185 | 185 |
186 } // namespace media | 186 } // namespace media |
187 | 187 |
188 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ | 188 #endif // MEDIA_BASE_ANDROID_SDK_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |