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 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 const std::string& iv, | 35 const std::string& iv, |
36 const std::vector<SubsampleEntry>& subsamples, | 36 const std::vector<SubsampleEntry>& subsamples, |
37 const base::TimeDelta& presentation_time) { | 37 const base::TimeDelta& presentation_time) { |
38 const std::vector<char> key_vec(key_id.begin(), key_id.end()); | 38 const std::vector<char> key_vec(key_id.begin(), key_id.end()); |
39 const std::vector<char> iv_vec(iv.begin(), iv.end()); | 39 const std::vector<char> iv_vec(iv.begin(), iv.end()); |
40 return QueueSecureInputBuffer(index, data, data_size, key_vec, iv_vec, | 40 return QueueSecureInputBuffer(index, data, data_size, key_vec, iv_vec, |
41 subsamples.empty() ? nullptr : &subsamples[0], | 41 subsamples.empty() ? nullptr : &subsamples[0], |
42 subsamples.size(), presentation_time); | 42 subsamples.size(), presentation_time); |
43 } | 43 } |
44 | 44 |
45 int MediaCodecBridge::GetOutputBuffersCount() { | |
46 return 0; | |
47 } | |
48 | |
49 size_t MediaCodecBridge::GetOutputBuffersCapacity() { | |
50 return 0; | |
51 } | |
52 | |
53 bool MediaCodecBridge::FillInputBuffer(int index, | 45 bool MediaCodecBridge::FillInputBuffer(int index, |
54 const uint8_t* data, | 46 const uint8_t* data, |
55 size_t size) { | 47 size_t size) { |
56 uint8_t* dst = nullptr; | 48 uint8_t* dst = nullptr; |
57 size_t capacity = 0; | 49 size_t capacity = 0; |
58 GetInputBuffer(index, &dst, &capacity); | 50 GetInputBuffer(index, &dst, &capacity); |
59 CHECK(dst); | 51 CHECK(dst); |
60 | 52 |
61 if (size > capacity) { | 53 if (size > capacity) { |
62 LOG(ERROR) << "Input buffer size " << size | 54 LOG(ERROR) << "Input buffer size " << size |
63 << " exceeds MediaCodec input buffer capacity: " << capacity; | 55 << " exceeds MediaCodec input buffer capacity: " << capacity; |
64 return false; | 56 return false; |
65 } | 57 } |
66 | 58 |
67 memcpy(dst, data, size); | 59 memcpy(dst, data, size); |
68 return true; | 60 return true; |
69 } | 61 } |
70 | 62 |
71 } // namespace media | 63 } // namespace media |
OLD | NEW |