| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (j_media_codec_.obj()) | 104 if (j_media_codec_.obj()) |
| 105 Java_MediaCodecBridge_release(env, j_media_codec_.obj()); | 105 Java_MediaCodecBridge_release(env, j_media_codec_.obj()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void MediaCodecBridge::StartInternal() { | 108 void MediaCodecBridge::StartInternal() { |
| 109 JNIEnv* env = AttachCurrentThread(); | 109 JNIEnv* env = AttachCurrentThread(); |
| 110 Java_MediaCodecBridge_start(env, j_media_codec_.obj()); | 110 Java_MediaCodecBridge_start(env, j_media_codec_.obj()); |
| 111 GetOutputBuffers(); | 111 GetOutputBuffers(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void MediaCodecBridge::Reset() { | 114 MediaCodecStatus MediaCodecBridge::Reset() { |
| 115 JNIEnv* env = AttachCurrentThread(); | 115 JNIEnv* env = AttachCurrentThread(); |
| 116 Java_MediaCodecBridge_flush(env, j_media_codec_.obj()); | 116 return static_cast<MediaCodecStatus>( |
| 117 Java_MediaCodecBridge_flush(env, j_media_codec_.obj())); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void MediaCodecBridge::Stop() { | 120 void MediaCodecBridge::Stop() { |
| 120 JNIEnv* env = AttachCurrentThread(); | 121 JNIEnv* env = AttachCurrentThread(); |
| 121 Java_MediaCodecBridge_stop(env, j_media_codec_.obj()); | 122 Java_MediaCodecBridge_stop(env, j_media_codec_.obj()); |
| 122 } | 123 } |
| 123 | 124 |
| 124 void MediaCodecBridge::GetOutputFormat(int* width, int* height) { | 125 void MediaCodecBridge::GetOutputFormat(int* width, int* height) { |
| 125 JNIEnv* env = AttachCurrentThread(); | 126 JNIEnv* env = AttachCurrentThread(); |
| 126 | 127 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 VideoCodecBridge* VideoCodecBridge::Create(const VideoCodec codec) { | 439 VideoCodecBridge* VideoCodecBridge::Create(const VideoCodec codec) { |
| 439 const std::string mime = VideoCodecToMimeType(codec); | 440 const std::string mime = VideoCodecToMimeType(codec); |
| 440 return mime.empty() ? NULL : new VideoCodecBridge(mime); | 441 return mime.empty() ? NULL : new VideoCodecBridge(mime); |
| 441 } | 442 } |
| 442 | 443 |
| 443 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { | 444 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { |
| 444 return RegisterNativesImpl(env); | 445 return RegisterNativesImpl(env); |
| 445 } | 446 } |
| 446 | 447 |
| 447 } // namespace media | 448 } // namespace media |
| OLD | NEW |