| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/common/media_type_converters.h" | 5 #include "media/mojo/common/media_type_converters.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 mojo_decrypt_config->subsamples = | 410 mojo_decrypt_config->subsamples = |
| 411 Array<media::mojom::SubsampleEntryPtr>::From(input.subsamples()); | 411 Array<media::mojom::SubsampleEntryPtr>::From(input.subsamples()); |
| 412 return mojo_decrypt_config; | 412 return mojo_decrypt_config; |
| 413 } | 413 } |
| 414 | 414 |
| 415 // static | 415 // static |
| 416 std::unique_ptr<media::DecryptConfig> | 416 std::unique_ptr<media::DecryptConfig> |
| 417 TypeConverter<std::unique_ptr<media::DecryptConfig>, | 417 TypeConverter<std::unique_ptr<media::DecryptConfig>, |
| 418 media::mojom::DecryptConfigPtr>:: | 418 media::mojom::DecryptConfigPtr>:: |
| 419 Convert(const media::mojom::DecryptConfigPtr& input) { | 419 Convert(const media::mojom::DecryptConfigPtr& input) { |
| 420 return base::WrapUnique(new media::DecryptConfig( | 420 return base::MakeUnique<media::DecryptConfig>( |
| 421 input->key_id, input->iv, | 421 input->key_id, input->iv, |
| 422 input->subsamples.To<std::vector<media::SubsampleEntry>>())); | 422 input->subsamples.To<std::vector<media::SubsampleEntry>>()); |
| 423 } | 423 } |
| 424 | 424 |
| 425 // static | 425 // static |
| 426 media::mojom::DecoderBufferPtr | 426 media::mojom::DecoderBufferPtr |
| 427 TypeConverter<media::mojom::DecoderBufferPtr, | 427 TypeConverter<media::mojom::DecoderBufferPtr, |
| 428 scoped_refptr<media::DecoderBuffer>>:: | 428 scoped_refptr<media::DecoderBuffer>>:: |
| 429 Convert(const scoped_refptr<media::DecoderBuffer>& input) { | 429 Convert(const scoped_refptr<media::DecoderBuffer>& input) { |
| 430 DCHECK(input); | 430 DCHECK(input); |
| 431 | 431 |
| 432 media::mojom::DecoderBufferPtr mojo_buffer( | 432 media::mojom::DecoderBufferPtr mojo_buffer( |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 info->status = static_cast<media::mojom::CdmKeyStatus>(input.status); | 583 info->status = static_cast<media::mojom::CdmKeyStatus>(input.status); |
| 584 info->system_code = input.system_code; | 584 info->system_code = input.system_code; |
| 585 return info; | 585 return info; |
| 586 } | 586 } |
| 587 | 587 |
| 588 // static | 588 // static |
| 589 std::unique_ptr<media::CdmKeyInformation> | 589 std::unique_ptr<media::CdmKeyInformation> |
| 590 TypeConverter<std::unique_ptr<media::CdmKeyInformation>, | 590 TypeConverter<std::unique_ptr<media::CdmKeyInformation>, |
| 591 media::mojom::CdmKeyInformationPtr>:: | 591 media::mojom::CdmKeyInformationPtr>:: |
| 592 Convert(const media::mojom::CdmKeyInformationPtr& input) { | 592 Convert(const media::mojom::CdmKeyInformationPtr& input) { |
| 593 return base::WrapUnique(new media::CdmKeyInformation( | 593 return base::MakeUnique<media::CdmKeyInformation>( |
| 594 input->key_id.storage(), | 594 input->key_id.storage(), |
| 595 static_cast<media::CdmKeyInformation::KeyStatus>(input->status), | 595 static_cast<media::CdmKeyInformation::KeyStatus>(input->status), |
| 596 input->system_code)); | 596 input->system_code); |
| 597 } | 597 } |
| 598 | 598 |
| 599 // static | 599 // static |
| 600 media::mojom::CdmConfigPtr | 600 media::mojom::CdmConfigPtr |
| 601 TypeConverter<media::mojom::CdmConfigPtr, media::CdmConfig>::Convert( | 601 TypeConverter<media::mojom::CdmConfigPtr, media::CdmConfig>::Convert( |
| 602 const media::CdmConfig& input) { | 602 const media::CdmConfig& input) { |
| 603 media::mojom::CdmConfigPtr config(media::mojom::CdmConfig::New()); | 603 media::mojom::CdmConfigPtr config(media::mojom::CdmConfig::New()); |
| 604 config->allow_distinctive_identifier = input.allow_distinctive_identifier; | 604 config->allow_distinctive_identifier = input.allow_distinctive_identifier; |
| 605 config->allow_persistent_state = input.allow_persistent_state; | 605 config->allow_persistent_state = input.allow_persistent_state; |
| 606 config->use_hw_secure_codecs = input.use_hw_secure_codecs; | 606 config->use_hw_secure_codecs = input.use_hw_secure_codecs; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 static_cast<media::VideoPixelFormat>(input->format), input->coded_size, | 712 static_cast<media::VideoPixelFormat>(input->format), input->coded_size, |
| 713 input->visible_rect, input->natural_size, std::move(input->frame_data), | 713 input->visible_rect, input->natural_size, std::move(input->frame_data), |
| 714 base::saturated_cast<size_t>(input->frame_data_size), | 714 base::saturated_cast<size_t>(input->frame_data_size), |
| 715 base::saturated_cast<size_t>(input->y_offset), | 715 base::saturated_cast<size_t>(input->y_offset), |
| 716 base::saturated_cast<size_t>(input->u_offset), | 716 base::saturated_cast<size_t>(input->u_offset), |
| 717 base::saturated_cast<size_t>(input->v_offset), input->y_stride, | 717 base::saturated_cast<size_t>(input->v_offset), input->y_stride, |
| 718 input->u_stride, input->v_stride, input->timestamp); | 718 input->u_stride, input->v_stride, input->timestamp); |
| 719 } | 719 } |
| 720 | 720 |
| 721 } // namespace mojo | 721 } // namespace mojo |
| OLD | NEW |