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

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

Issue 2058113002: Add 'cbcs' encryption scheme support in Android media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/media_codec_bridge.h" 5 #include "media/base/android/media_codec_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 16 matching lines...) Expand all
27 27
28 MediaCodecBridge::~MediaCodecBridge() {} 28 MediaCodecBridge::~MediaCodecBridge() {}
29 29
30 MediaCodecStatus MediaCodecBridge::QueueSecureInputBuffer( 30 MediaCodecStatus MediaCodecBridge::QueueSecureInputBuffer(
31 int index, 31 int index,
32 const uint8_t* data, 32 const uint8_t* data,
33 size_t data_size, 33 size_t data_size,
34 const std::string& key_id, 34 const std::string& key_id,
35 const std::string& iv, 35 const std::string& iv,
36 const std::vector<SubsampleEntry>& subsamples, 36 const std::vector<SubsampleEntry>& subsamples,
37 const EncryptionScheme& encryption_scheme,
37 const base::TimeDelta& presentation_time) { 38 const base::TimeDelta& presentation_time) {
38 const std::vector<char> key_vec(key_id.begin(), key_id.end()); 39 const std::vector<char> key_vec(key_id.begin(), key_id.end());
39 const std::vector<char> iv_vec(iv.begin(), iv.end()); 40 const std::vector<char> iv_vec(iv.begin(), iv.end());
40 return QueueSecureInputBuffer(index, data, data_size, key_vec, iv_vec, 41 return QueueSecureInputBuffer(index, data, data_size, key_vec, iv_vec,
41 subsamples.empty() ? nullptr : &subsamples[0], 42 subsamples.empty() ? nullptr : &subsamples[0],
42 subsamples.size(), presentation_time); 43 subsamples.size(), encryption_scheme,
44 presentation_time);
43 } 45 }
44 46
45 MediaCodecStatus MediaCodecBridge::CopyFromOutputBuffer(int index, 47 MediaCodecStatus MediaCodecBridge::CopyFromOutputBuffer(int index,
46 size_t offset, 48 size_t offset,
47 void* dst, 49 void* dst,
48 size_t num) { 50 size_t num) {
49 const uint8_t* src_data = nullptr; 51 const uint8_t* src_data = nullptr;
50 size_t src_capacity = 0; 52 size_t src_capacity = 0;
51 MediaCodecStatus status = 53 MediaCodecStatus status =
52 GetOutputBufferAddress(index, offset, &src_data, &src_capacity); 54 GetOutputBufferAddress(index, offset, &src_data, &src_capacity);
(...skipping 19 matching lines...) Expand all
72 LOG(ERROR) << "Input buffer size " << size 74 LOG(ERROR) << "Input buffer size " << size
73 << " exceeds MediaCodec input buffer capacity: " << capacity; 75 << " exceeds MediaCodec input buffer capacity: " << capacity;
74 return false; 76 return false;
75 } 77 }
76 78
77 memcpy(dst, data, size); 79 memcpy(dst, data, size);
78 return true; 80 return true;
79 } 81 }
80 82
81 } // namespace media 83 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698