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/formats/mp2t/mp2t_stream_parser.h" | 5 #include "media/formats/mp2t/mp2t_stream_parser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 497 } |
498 audio_encryption_scheme = current_audio_config_.encryption_scheme(); | 498 audio_encryption_scheme = current_audio_config_.encryption_scheme(); |
499 EXPECT_FALSE(audio_encryption_scheme.is_encrypted()); | 499 EXPECT_FALSE(audio_encryption_scheme.is_encrypted()); |
500 for (size_t i = 0; i + 1 < audio_buffer_capture_.size(); i++) { | 500 for (size_t i = 0; i + 1 < audio_buffer_capture_.size(); i++) { |
501 const auto& buffer = audio_buffer_capture_[i]; | 501 const auto& buffer = audio_buffer_capture_[i]; |
502 std::string unencrypted_audio_buffer( | 502 std::string unencrypted_audio_buffer( |
503 reinterpret_cast<const char*>(buffer->data()), buffer->data_size()); | 503 reinterpret_cast<const char*>(buffer->data()), buffer->data_size()); |
504 EXPECT_EQ(decrypted_audio_buffers[i], unencrypted_audio_buffer); | 504 EXPECT_EQ(decrypted_audio_buffers[i], unencrypted_audio_buffer); |
505 } | 505 } |
506 } | 506 } |
| 507 |
| 508 TEST_F(Mp2tStreamParserTest, PrepareForHLSSampleAES) { |
| 509 InitializeParser(); |
| 510 ParseMpeg2TsFile("bear-1280x720-hls-with-CAT.bin", 2048); |
| 511 parser_->Flush(); |
| 512 EncryptionScheme video_encryption_scheme = |
| 513 current_video_config_.encryption_scheme(); |
| 514 EXPECT_TRUE(video_encryption_scheme.is_encrypted()); |
| 515 EncryptionScheme audio_encryption_scheme = |
| 516 current_audio_config_.encryption_scheme(); |
| 517 EXPECT_TRUE(audio_encryption_scheme.is_encrypted()); |
| 518 } |
| 519 |
507 #endif | 520 #endif |
508 | 521 |
509 } // namespace mp2t | 522 } // namespace mp2t |
510 } // namespace media | 523 } // namespace media |
OLD | NEW |