| 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 #include "media/base/android/media_codec_bridge.h" | 5 #include "media/base/android/media_codec_bridge.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 kConfigureFlagEncode)) { | 709 kConfigureFlagEncode)) { |
| 710 return NULL; | 710 return NULL; |
| 711 } | 711 } |
| 712 | 712 |
| 713 return bridge->StartInternal() ? bridge.release() : NULL; | 713 return bridge->StartInternal() ? bridge.release() : NULL; |
| 714 } | 714 } |
| 715 | 715 |
| 716 VideoCodecBridge::VideoCodecBridge(const std::string& mime, | 716 VideoCodecBridge::VideoCodecBridge(const std::string& mime, |
| 717 bool is_secure, | 717 bool is_secure, |
| 718 MediaCodecDirection direction) | 718 MediaCodecDirection direction) |
| 719 : MediaCodecBridge(mime, is_secure, direction) {} | 719 : MediaCodecBridge(mime, is_secure, direction), |
| 720 adaptive_playback_supported_for_testing_(-1) {} |
| 720 | 721 |
| 721 void VideoCodecBridge::SetVideoBitrate(int bps) { | 722 void VideoCodecBridge::SetVideoBitrate(int bps) { |
| 722 JNIEnv* env = AttachCurrentThread(); | 723 JNIEnv* env = AttachCurrentThread(); |
| 723 Java_MediaCodecBridge_setVideoBitrate(env, media_codec(), bps); | 724 Java_MediaCodecBridge_setVideoBitrate(env, media_codec(), bps); |
| 724 } | 725 } |
| 725 | 726 |
| 726 void VideoCodecBridge::RequestKeyFrameSoon() { | 727 void VideoCodecBridge::RequestKeyFrameSoon() { |
| 727 JNIEnv* env = AttachCurrentThread(); | 728 JNIEnv* env = AttachCurrentThread(); |
| 728 Java_MediaCodecBridge_requestKeyFrameSoon(env, media_codec()); | 729 Java_MediaCodecBridge_requestKeyFrameSoon(env, media_codec()); |
| 729 } | 730 } |
| 730 | 731 |
| 732 bool VideoCodecBridge::IsAdaptivePlaybackSupported(int width, int height) { |
| 733 if (adaptive_playback_supported_for_testing_ == 0) |
| 734 return false; |
| 735 else if (adaptive_playback_supported_for_testing_ > 0) |
| 736 return true; |
| 737 JNIEnv* env = AttachCurrentThread(); |
| 738 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( |
| 739 env, media_codec(), width, height); |
| 740 } |
| 741 |
| 731 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { | 742 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { |
| 732 return RegisterNativesImpl(env); | 743 return RegisterNativesImpl(env); |
| 733 } | 744 } |
| 734 | 745 |
| 735 } // namespace media | 746 } // namespace media |
| OLD | NEW |