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