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