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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Play the output buffer. This call must be called after |
237 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback | 237 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback |
238 // head position expressed in frames. | 238 // head position expressed in frames. |
239 int64 PlayOutputBuffer(int index, size_t size); | 239 int64 PlayOutputBuffer(int index, size_t size, size_t offset); |
240 | 240 |
241 // Set the volume of the audio output. | 241 // Set the volume of the audio output. |
242 void SetVolume(double volume); | 242 void SetVolume(double volume); |
243 | 243 |
244 private: | 244 private: |
245 explicit AudioCodecBridge(const std::string& mime); | 245 explicit AudioCodecBridge(const std::string& mime); |
246 | 246 |
247 // Configure the java MediaFormat object with the extra codec data passed in. | 247 // Configure the java MediaFormat object with the extra codec data passed in. |
248 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, | 248 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, |
249 const uint8* extra_data, size_t extra_data_size, | 249 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, | 294 VideoCodecBridge(const std::string& mime, |
295 bool is_secure, | 295 bool is_secure, |
296 MediaCodecDirection direction); | 296 MediaCodecDirection direction); |
297 | 297 |
298 int adaptive_playback_supported_for_testing_; | 298 int adaptive_playback_supported_for_testing_; |
299 }; | 299 }; |
300 | 300 |
301 } // namespace media | 301 } // namespace media |
302 | 302 |
303 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 303 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |