Chromium Code Reviews| 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_MEDIA_CODEC_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 | 226 |
| 227 // See MediaCodecBridge::IsKnownUnaccelerated(). | 227 // See MediaCodecBridge::IsKnownUnaccelerated(). |
| 228 static bool IsKnownUnaccelerated(const AudioCodec& codec); | 228 static bool IsKnownUnaccelerated(const AudioCodec& codec); |
| 229 | 229 |
| 230 // Start the audio codec bridge. | 230 // Start the audio codec bridge. |
| 231 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, | 231 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, |
| 232 const uint8* extra_data, size_t extra_data_size, | 232 const uint8* extra_data, size_t extra_data_size, |
| 233 int64 codec_delay_ns, int64 seek_preroll_ns, | 233 int64 codec_delay_ns, int64 seek_preroll_ns, |
| 234 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; | 234 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; |
| 235 | 235 |
| 236 // Play the output buffer. This call must be called after | 236 // Plays the output buffer right away or save for later playback if |postpone| |
| 237 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback | 237 // is set to true. This call must be called after DequeueOutputBuffer() and |
| 238 // head position expressed in frames. | 238 // before ReleaseOutputBuffer. The data is extracted from the output buffers |
| 239 int64 PlayOutputBuffer(int index, size_t size); | 239 // using |index| and |size|. Returns the playback head position expressed |
| 240 // in frames. | |
| 241 // When |postpone| is set to true, the next PlayOutputBuffer() should have | |
| 242 // postpone == false, and if will play two buffers: the postponed one and | |
|
wolenetz
2015/08/20 23:39:12
nit: s/if/it/
Tima Vaisburd
2015/08/21 20:18:24
Done.
| |
| 243 // the one identified by |index|. | |
| 244 int64 PlayOutputBuffer(int index, size_t size, bool postpone = false); | |
| 240 | 245 |
| 241 // Set the volume of the audio output. | 246 // Set the volume of the audio output. |
| 242 void SetVolume(double volume); | 247 void SetVolume(double volume); |
| 243 | 248 |
| 244 private: | 249 private: |
| 245 explicit AudioCodecBridge(const std::string& mime); | 250 explicit AudioCodecBridge(const std::string& mime); |
| 246 | 251 |
| 247 // Configure the java MediaFormat object with the extra codec data passed in. | 252 // Configure the java MediaFormat object with the extra codec data passed in. |
| 248 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, | 253 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, |
| 249 const uint8* extra_data, size_t extra_data_size, | 254 const uint8* extra_data, size_t extra_data_size, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 VideoCodecBridge(const std::string& mime, | 299 VideoCodecBridge(const std::string& mime, |
| 295 bool is_secure, | 300 bool is_secure, |
| 296 MediaCodecDirection direction); | 301 MediaCodecDirection direction); |
| 297 | 302 |
| 298 int adaptive_playback_supported_for_testing_; | 303 int adaptive_playback_supported_for_testing_; |
| 299 }; | 304 }; |
| 300 | 305 |
| 301 } // namespace media | 306 } // namespace media |
| 302 | 307 |
| 303 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 308 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |