| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Returns an AudioCodecBridge instance if |codec| is supported, or a NULL | 218 // Returns an AudioCodecBridge instance if |codec| is supported, or a NULL |
| 219 // pointer otherwise. | 219 // pointer otherwise. |
| 220 static AudioCodecBridge* Create(const AudioCodec& codec); | 220 static AudioCodecBridge* Create(const AudioCodec& codec); |
| 221 | 221 |
| 222 // See MediaCodecBridge::IsKnownUnaccelerated(). | 222 // See MediaCodecBridge::IsKnownUnaccelerated(). |
| 223 static bool IsKnownUnaccelerated(const AudioCodec& codec); | 223 static bool IsKnownUnaccelerated(const AudioCodec& codec); |
| 224 | 224 |
| 225 // Start the audio codec bridge. | 225 // Start the audio codec bridge. |
| 226 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, | 226 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, |
| 227 const uint8* extra_data, size_t extra_data_size, | 227 const uint8* extra_data, size_t extra_data_size, |
| 228 int64 codec_delay_ns, int64 seek_preroll_ns, |
| 228 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; | 229 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; |
| 229 | 230 |
| 230 // Play the output buffer. This call must be called after | 231 // Play the output buffer. This call must be called after |
| 231 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback | 232 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback |
| 232 // head position expressed in frames. | 233 // head position expressed in frames. |
| 233 int64 PlayOutputBuffer(int index, size_t size); | 234 int64 PlayOutputBuffer(int index, size_t size); |
| 234 | 235 |
| 235 // Set the volume of the audio output. | 236 // Set the volume of the audio output. |
| 236 void SetVolume(double volume); | 237 void SetVolume(double volume); |
| 237 | 238 |
| 238 private: | 239 private: |
| 239 explicit AudioCodecBridge(const std::string& mime); | 240 explicit AudioCodecBridge(const std::string& mime); |
| 240 | 241 |
| 241 // Configure the java MediaFormat object with the extra codec data passed in. | 242 // Configure the java MediaFormat object with the extra codec data passed in. |
| 242 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, | 243 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, |
| 243 const uint8* extra_data, size_t extra_data_size); | 244 const uint8* extra_data, size_t extra_data_size, |
| 245 int64 codec_delay_ns, int64 seek_preroll_ns); |
| 244 }; | 246 }; |
| 245 | 247 |
| 246 class MEDIA_EXPORT VideoCodecBridge : public MediaCodecBridge { | 248 class MEDIA_EXPORT VideoCodecBridge : public MediaCodecBridge { |
| 247 public: | 249 public: |
| 248 // See MediaCodecBridge::IsKnownUnaccelerated(). | 250 // See MediaCodecBridge::IsKnownUnaccelerated(). |
| 249 static bool IsKnownUnaccelerated(const VideoCodec& codec, | 251 static bool IsKnownUnaccelerated(const VideoCodec& codec, |
| 250 MediaCodecDirection direction); | 252 MediaCodecDirection direction); |
| 251 | 253 |
| 252 // Create, start, and return a VideoCodecBridge decoder or NULL on failure. | 254 // Create, start, and return a VideoCodecBridge decoder or NULL on failure. |
| 253 static VideoCodecBridge* CreateDecoder( | 255 static VideoCodecBridge* CreateDecoder( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 VideoCodecBridge(const std::string& mime, | 289 VideoCodecBridge(const std::string& mime, |
| 288 bool is_secure, | 290 bool is_secure, |
| 289 MediaCodecDirection direction); | 291 MediaCodecDirection direction); |
| 290 | 292 |
| 291 int adaptive_playback_supported_for_testing_; | 293 int adaptive_playback_supported_for_testing_; |
| 292 }; | 294 }; |
| 293 | 295 |
| 294 } // namespace media | 296 } // namespace media |
| 295 | 297 |
| 296 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ | 298 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ |
| OLD | NEW |