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