OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/remoting/proto_utils.h" | 5 #include "media/remoting/proto_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/big_endian.h" | 9 #include "base/big_endian.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 stats->audio_memory_usage = stats_message.audio_memory_usage(); | 344 stats->audio_memory_usage = stats_message.audio_memory_usage(); |
345 stats->video_memory_usage = stats_message.video_memory_usage(); | 345 stats->video_memory_usage = stats_message.video_memory_usage(); |
346 // HACK: Set the following to prevent "disable video when hidden" logic in | 346 // HACK: Set the following to prevent "disable video when hidden" logic in |
347 // media::blink::WebMediaPlayerImpl. | 347 // media::blink::WebMediaPlayerImpl. |
348 stats->video_keyframe_distance_average = base::TimeDelta::Max(); | 348 stats->video_keyframe_distance_average = base::TimeDelta::Max(); |
349 } | 349 } |
350 | 350 |
351 void ConvertCdmKeyInfoToProto( | 351 void ConvertCdmKeyInfoToProto( |
352 const CdmKeysInfo& keys_information, | 352 const CdmKeysInfo& keys_information, |
353 pb::CdmClientOnSessionKeysChange* key_change_message) { | 353 pb::CdmClientOnSessionKeysChange* key_change_message) { |
354 for (auto* info : keys_information) { | 354 for (auto& info : keys_information) { |
355 pb::CdmKeyInformation* key = key_change_message->add_key_information(); | 355 pb::CdmKeyInformation* key = key_change_message->add_key_information(); |
356 key->set_key_id(info->key_id.data(), info->key_id.size()); | 356 key->set_key_id(info->key_id.data(), info->key_id.size()); |
357 key->set_status(ToProtoCdmKeyInformation(info->status).value()); | 357 key->set_status(ToProtoCdmKeyInformation(info->status).value()); |
358 key->set_system_code(info->system_code); | 358 key->set_system_code(info->system_code); |
359 } | 359 } |
360 } | 360 } |
361 | 361 |
362 void ConvertProtoToCdmKeyInfo( | 362 void ConvertProtoToCdmKeyInfo( |
363 const pb::CdmClientOnSessionKeysChange keychange_message, | 363 const pb::CdmClientOnSessionKeysChange keychange_message, |
364 CdmKeysInfo* key_information) { | 364 CdmKeysInfo* key_information) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 CdmPromiseResult::~CdmPromiseResult() = default; | 459 CdmPromiseResult::~CdmPromiseResult() = default; |
460 | 460 |
461 CdmPromiseResult CdmPromiseResult::SuccessResult() { | 461 CdmPromiseResult CdmPromiseResult::SuccessResult() { |
462 CdmPromiseResult result(static_cast<CdmPromise::Exception>(0), 0, ""); | 462 CdmPromiseResult result(static_cast<CdmPromise::Exception>(0), 0, ""); |
463 result.success_ = true; | 463 result.success_ = true; |
464 return result; | 464 return result; |
465 } | 465 } |
466 | 466 |
467 } // namespace remoting | 467 } // namespace remoting |
468 } // namespace media | 468 } // namespace media |
OLD | NEW |