Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: media/base/android/sdk_media_codec_bridge.cc

Issue 2114473002: Remove usage of MediaCodec.getName(), use proxy instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/sdk_media_codec_bridge.h" 5 #include "media/base/android/sdk_media_codec_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return MEDIA_CODEC_ERROR; 327 return MEDIA_CODEC_ERROR;
328 const size_t total_capacity = env->GetDirectBufferCapacity(j_buffer.obj()); 328 const size_t total_capacity = env->GetDirectBufferCapacity(j_buffer.obj());
329 CHECK_GE(total_capacity, offset); 329 CHECK_GE(total_capacity, offset);
330 *addr = reinterpret_cast<const uint8_t*>( 330 *addr = reinterpret_cast<const uint8_t*>(
331 env->GetDirectBufferAddress(j_buffer.obj())) + 331 env->GetDirectBufferAddress(j_buffer.obj())) +
332 offset; 332 offset;
333 *capacity = total_capacity - offset; 333 *capacity = total_capacity - offset;
334 return MEDIA_CODEC_OK; 334 return MEDIA_CODEC_OK;
335 } 335 }
336 336
337 bool SdkMediaCodecBridge::IsSoftwareCodec() {
338 JNIEnv* env = AttachCurrentThread();
339 return Java_MediaCodecBridge_isSoftwareCodec(env, j_media_codec_.obj());
340 }
341
342 // static 337 // static
343 bool SdkMediaCodecBridge::RegisterSdkMediaCodecBridge(JNIEnv* env) { 338 bool SdkMediaCodecBridge::RegisterSdkMediaCodecBridge(JNIEnv* env) {
344 return RegisterNativesImpl(env); 339 return RegisterNativesImpl(env);
345 } 340 }
346 341
347 // static 342 // static
348 AudioCodecBridge* AudioCodecBridge::Create(const AudioCodec& codec) { 343 AudioCodecBridge* AudioCodecBridge::Create(const AudioCodec& codec) {
349 if (!MediaCodecUtil::IsMediaCodecAvailable()) 344 if (!MediaCodecUtil::IsMediaCodecAvailable())
350 return nullptr; 345 return nullptr;
351 346
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 if (adaptive_playback_supported_for_testing_ == 0) 700 if (adaptive_playback_supported_for_testing_ == 0)
706 return false; 701 return false;
707 else if (adaptive_playback_supported_for_testing_ > 0) 702 else if (adaptive_playback_supported_for_testing_ > 0)
708 return true; 703 return true;
709 JNIEnv* env = AttachCurrentThread(); 704 JNIEnv* env = AttachCurrentThread();
710 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), 705 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(),
711 width, height); 706 width, height);
712 } 707 }
713 708
714 } // namespace media 709 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698