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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 // See MediaCodecBridge::IsKnownUnaccelerated(). | 216 // See MediaCodecBridge::IsKnownUnaccelerated(). |
217 static bool IsKnownUnaccelerated(const AudioCodec& codec); | 217 static bool IsKnownUnaccelerated(const AudioCodec& codec); |
218 | 218 |
219 // Start the audio codec bridge. | 219 // Start the audio codec bridge. |
220 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, | 220 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, |
221 const uint8* extra_data, size_t extra_data_size, | 221 const uint8* extra_data, size_t extra_data_size, |
222 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; | 222 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; |
223 | 223 |
224 // Play the output buffer. This call must be called after | 224 // Play the output buffer. This call must be called after |
225 // DequeueOutputBuffer() and before ReleaseOutputBuffer. | 225 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback |
226 void PlayOutputBuffer(int index, size_t size); | 226 // head position expressed in frames. |
| 227 int64 PlayOutputBuffer(int index, size_t size); |
227 | 228 |
228 // Set the volume of the audio output. | 229 // Set the volume of the audio output. |
229 void SetVolume(double volume); | 230 void SetVolume(double volume); |
230 | 231 |
231 private: | 232 private: |
232 explicit AudioCodecBridge(const std::string& mime); | 233 explicit AudioCodecBridge(const std::string& mime); |
233 | 234 |
234 // Configure the java MediaFormat object with the extra codec data passed in. | 235 // Configure the java MediaFormat object with the extra codec data passed in. |
235 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, | 236 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, |
236 const uint8* extra_data, size_t extra_data_size); | 237 const uint8* extra_data, size_t extra_data_size); |
(...skipping 27 matching lines...) Expand all Loading... |
264 | 265 |
265 private: | 266 private: |
266 VideoCodecBridge(const std::string& mime, | 267 VideoCodecBridge(const std::string& mime, |
267 bool is_secure, | 268 bool is_secure, |
268 MediaCodecDirection direction); | 269 MediaCodecDirection direction); |
269 }; | 270 }; |
270 | 271 |
271 } // namespace media | 272 } // namespace media |
272 | 273 |
273 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 274 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
OLD | NEW |