| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // TODO(dougsteed). Consider adding support for the following: | 41 // TODO(dougsteed). Consider adding support for the following: |
| 42 // const int64_t kSampleAESPrivateDataIndicatorAC3 = 0x61633364; | 42 // const int64_t kSampleAESPrivateDataIndicatorAC3 = 0x61633364; |
| 43 // const int64_t kSampleAESPrivateDataIndicatorEAC3 = 0x65633364; | 43 // const int64_t kSampleAESPrivateDataIndicatorEAC3 = 0x65633364; |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 enum StreamType { | 48 enum StreamType { |
| 49 // ISO-13818.1 / ITU H.222 Table 2.34 "Stream type assignments" | 49 // ISO-13818.1 / ITU H.222 Table 2.34 "Stream type assignments" |
| 50 kStreamTypeMpeg1Audio = 0x3, | 50 kStreamTypeMpeg1Audio = 0x3, |
| 51 // ISO/IEC 13818-3 Audio (MPEG-2) |
| 52 kStreamTypeMpeg2Audio = 0x4, |
| 51 kStreamTypeAAC = 0xf, | 53 kStreamTypeAAC = 0xf, |
| 52 kStreamTypeAVC = 0x1b, | 54 kStreamTypeAVC = 0x1b, |
| 53 #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) | 55 #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) |
| 54 kStreamTypeAACWithSampleAES = 0xcf, | 56 kStreamTypeAACWithSampleAES = 0xcf, |
| 55 kStreamTypeAVCWithSampleAES = 0xdb, | 57 kStreamTypeAVCWithSampleAES = 0xdb, |
| 56 // TODO(dougsteed). Consider adding support for the following: | 58 // TODO(dougsteed). Consider adding support for the following: |
| 57 // kStreamTypeAC3WithSampleAES = 0xc1, | 59 // kStreamTypeAC3WithSampleAES = 0xc1, |
| 58 // kStreamTypeEAC3WithSampleAES = 0xc2, | 60 // kStreamTypeEAC3WithSampleAES = 0xc2, |
| 59 #endif | 61 #endif |
| 60 }; | 62 }; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 es_parser.reset( | 416 es_parser.reset( |
| 415 new EsParserAdts( | 417 new EsParserAdts( |
| 416 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged, | 418 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged, |
| 417 base::Unretained(this), | 419 base::Unretained(this), |
| 418 pes_pid), | 420 pes_pid), |
| 419 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer, | 421 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer, |
| 420 base::Unretained(this), | 422 base::Unretained(this), |
| 421 pes_pid), | 423 pes_pid), |
| 422 sbr_in_mimetype_)); | 424 sbr_in_mimetype_)); |
| 423 is_audio = true; | 425 is_audio = true; |
| 424 } else if (stream_type == kStreamTypeMpeg1Audio) { | 426 } else if (stream_type == kStreamTypeMpeg1Audio || |
| 427 stream_type == kStreamTypeMpeg2Audio) { |
| 425 es_parser.reset(new EsParserMpeg1Audio( | 428 es_parser.reset(new EsParserMpeg1Audio( |
| 426 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged, | 429 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged, |
| 427 base::Unretained(this), pes_pid), | 430 base::Unretained(this), pes_pid), |
| 428 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer, base::Unretained(this), | 431 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer, base::Unretained(this), |
| 429 pes_pid), | 432 pes_pid), |
| 430 media_log_)); | 433 media_log_)); |
| 431 is_audio = true; | 434 is_audio = true; |
| 432 #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) | 435 #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) |
| 433 } else if (stream_type == kStreamTypeAVCWithSampleAES && | 436 } else if (stream_type == kStreamTypeAVCWithSampleAES && |
| 434 descriptors.HasPrivateDataIndicator( | 437 descriptors.HasPrivateDataIndicator( |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 810 |
| 808 void Mp2tStreamParser::RegisterPsshBoxes( | 811 void Mp2tStreamParser::RegisterPsshBoxes( |
| 809 const std::vector<uint8_t>& init_data) { | 812 const std::vector<uint8_t>& init_data) { |
| 810 encrypted_media_init_data_cb_.Run(EmeInitDataType::CENC, init_data); | 813 encrypted_media_init_data_cb_.Run(EmeInitDataType::CENC, init_data); |
| 811 } | 814 } |
| 812 | 815 |
| 813 #endif | 816 #endif |
| 814 | 817 |
| 815 } // namespace mp2t | 818 } // namespace mp2t |
| 816 } // namespace media | 819 } // namespace media |
| OLD | NEW |