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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 stats->audio_memory_usage = stats_message.audio_memory_usage(); | 351 stats->audio_memory_usage = stats_message.audio_memory_usage(); |
352 stats->video_memory_usage = stats_message.video_memory_usage(); | 352 stats->video_memory_usage = stats_message.video_memory_usage(); |
353 // HACK: Set the following to prevent "disable video when hidden" logic in | 353 // HACK: Set the following to prevent "disable video when hidden" logic in |
354 // media::blink::WebMediaPlayerImpl. | 354 // media::blink::WebMediaPlayerImpl. |
355 stats->video_keyframe_distance_average = base::TimeDelta::Max(); | 355 stats->video_keyframe_distance_average = base::TimeDelta::Max(); |
356 } | 356 } |
357 | 357 |
358 void ConvertCdmKeyInfoToProto( | 358 void ConvertCdmKeyInfoToProto( |
359 const CdmKeysInfo& keys_information, | 359 const CdmKeysInfo& keys_information, |
360 pb::CdmClientOnSessionKeysChange* key_change_message) { | 360 pb::CdmClientOnSessionKeysChange* key_change_message) { |
361 for (const auto& info : keys_information) { | 361 for (auto* info : keys_information) { |
362 pb::CdmKeyInformation* key = key_change_message->add_key_information(); | 362 pb::CdmKeyInformation* key = key_change_message->add_key_information(); |
363 key->set_key_id(info->key_id.data(), info->key_id.size()); | 363 key->set_key_id(info->key_id.data(), info->key_id.size()); |
364 key->set_status(ToProtoCdmKeyInformation(info->status).value()); | 364 key->set_status(ToProtoCdmKeyInformation(info->status).value()); |
365 key->set_system_code(info->system_code); | 365 key->set_system_code(info->system_code); |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 void ConvertProtoToCdmKeyInfo( | 369 void ConvertProtoToCdmKeyInfo( |
370 const pb::CdmClientOnSessionKeysChange keychange_message, | 370 const pb::CdmClientOnSessionKeysChange keychange_message, |
371 CdmKeysInfo* key_information) { | 371 CdmKeysInfo* key_information) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 CdmPromiseResult::~CdmPromiseResult() = default; | 466 CdmPromiseResult::~CdmPromiseResult() = default; |
467 | 467 |
468 CdmPromiseResult CdmPromiseResult::SuccessResult() { | 468 CdmPromiseResult CdmPromiseResult::SuccessResult() { |
469 CdmPromiseResult result(static_cast<CdmPromise::Exception>(0), 0, ""); | 469 CdmPromiseResult result(static_cast<CdmPromise::Exception>(0), 0, ""); |
470 result.success_ = true; | 470 result.success_ = true; |
471 return result; | 471 return result; |
472 } | 472 } |
473 | 473 |
474 } // namespace remoting | 474 } // namespace remoting |
475 } // namespace media | 475 } // namespace media |
OLD | NEW |