OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_decoder.h" | 5 #include "media/base/android/media_codec_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "media/base/android/media_codec_bridge.h" | 11 #include "media/base/android/media_codec_bridge.h" |
| 12 #include "media/base/media_util.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // Stop requesting new data in the kPrefetching state when the queue size | 18 // Stop requesting new data in the kPrefetching state when the queue size |
18 // reaches this limit. | 19 // reaches this limit. |
19 const int kPrefetchLimit = 8; | 20 const int kPrefetchLimit = 8; |
20 | 21 |
21 // Request new data in the kRunning state if the queue size is less than this. | 22 // Request new data in the kRunning state if the queue size is less than this. |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } else { | 761 } else { |
761 DVLOG(2) << class_name() << "::" << __FUNCTION__ | 762 DVLOG(2) << class_name() << "::" << __FUNCTION__ |
762 << ": QueueSecureInputBuffer pts:" << unit->timestamp | 763 << ": QueueSecureInputBuffer pts:" << unit->timestamp |
763 << " key_id size:" << unit->key_id.size() | 764 << " key_id size:" << unit->key_id.size() |
764 << " iv size:" << unit->iv.size() | 765 << " iv size:" << unit->iv.size() |
765 << " subsamples size:" << unit->subsamples.size(); | 766 << " subsamples size:" << unit->subsamples.size(); |
766 | 767 |
767 status = media_codec_bridge_->QueueSecureInputBuffer( | 768 status = media_codec_bridge_->QueueSecureInputBuffer( |
768 index, memory, unit->data.size(), unit->key_id, unit->iv, | 769 index, memory, unit->data.size(), unit->key_id, unit->iv, |
769 unit->subsamples.empty() ? nullptr : &unit->subsamples[0], | 770 unit->subsamples.empty() ? nullptr : &unit->subsamples[0], |
770 unit->subsamples.size(), unit->timestamp); | 771 unit->subsamples.size(), AesCtrEncryptionScheme(), unit->timestamp); |
771 } | 772 } |
772 | 773 |
773 switch (status) { | 774 switch (status) { |
774 case MEDIA_CODEC_OK: | 775 case MEDIA_CODEC_OK: |
775 break; | 776 break; |
776 | 777 |
777 case MEDIA_CODEC_ERROR: | 778 case MEDIA_CODEC_ERROR: |
778 DVLOG(0) << class_name() << "::" << __FUNCTION__ | 779 DVLOG(0) << class_name() << "::" << __FUNCTION__ |
779 << ": MEDIA_CODEC_ERROR: QueueInputBuffer failed"; | 780 << ": MEDIA_CODEC_ERROR: QueueInputBuffer failed"; |
780 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); | 781 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 RETURN_STRING(kStopping); | 1002 RETURN_STRING(kStopping); |
1002 RETURN_STRING(kInEmergencyStop); | 1003 RETURN_STRING(kInEmergencyStop); |
1003 RETURN_STRING(kError); | 1004 RETURN_STRING(kError); |
1004 } | 1005 } |
1005 return nullptr; // crash early | 1006 return nullptr; // crash early |
1006 } | 1007 } |
1007 | 1008 |
1008 #undef RETURN_STRING | 1009 #undef RETURN_STRING |
1009 | 1010 |
1010 } // namespace media | 1011 } // namespace media |
OLD | NEW |