| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 0, | 338 0, |
| 339 data_size, | 339 data_size, |
| 340 presentation_time.InMicroseconds(), | 340 presentation_time.InMicroseconds(), |
| 341 0)); | 341 0)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 MediaCodecStatus MediaCodecBridge::QueueSecureInputBuffer( | 344 MediaCodecStatus MediaCodecBridge::QueueSecureInputBuffer( |
| 345 int index, | 345 int index, |
| 346 const uint8* data, | 346 const uint8* data, |
| 347 size_t data_size, | 347 size_t data_size, |
| 348 const std::string& key_id, |
| 349 const std::string& iv, |
| 350 const std::vector<SubsampleEntry>& subsamples, |
| 351 const base::TimeDelta& presentation_time) { |
| 352 return QueueSecureInputBuffer( |
| 353 index, data, data_size, reinterpret_cast<const uint8_t*>(key_id.data()), |
| 354 key_id.size(), reinterpret_cast<const uint8_t*>(iv.data()), iv.size(), |
| 355 subsamples.empty() ? nullptr : &subsamples[0], subsamples.size(), |
| 356 presentation_time); |
| 357 } |
| 358 |
| 359 // TODO(timav): Combine this and above methods together keeping only the first |
| 360 // interface after we switch to Spitzer pipeline. |
| 361 MediaCodecStatus MediaCodecBridge::QueueSecureInputBuffer( |
| 362 int index, |
| 363 const uint8* data, |
| 364 size_t data_size, |
| 348 const uint8* key_id, | 365 const uint8* key_id, |
| 349 int key_id_size, | 366 int key_id_size, |
| 350 const uint8* iv, | 367 const uint8* iv, |
| 351 int iv_size, | 368 int iv_size, |
| 352 const SubsampleEntry* subsamples, | 369 const SubsampleEntry* subsamples, |
| 353 int subsamples_size, | 370 int subsamples_size, |
| 354 const base::TimeDelta& presentation_time) { | 371 const base::TimeDelta& presentation_time) { |
| 355 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size; | 372 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size; |
| 356 if (data_size > base::checked_cast<size_t>(kint32max)) | 373 if (data_size > base::checked_cast<size_t>(kint32max)) |
| 357 return MEDIA_CODEC_ERROR; | 374 return MEDIA_CODEC_ERROR; |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 JNIEnv* env = AttachCurrentThread(); | 885 JNIEnv* env = AttachCurrentThread(); |
| 869 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( | 886 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( |
| 870 env, media_codec(), width, height); | 887 env, media_codec(), width, height); |
| 871 } | 888 } |
| 872 | 889 |
| 873 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { | 890 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { |
| 874 return RegisterNativesImpl(env); | 891 return RegisterNativesImpl(env); |
| 875 } | 892 } |
| 876 | 893 |
| 877 } // namespace media | 894 } // namespace media |
| OLD | NEW |