|
1 | 1 | use crate::aac::{AACProperties, AacFile}; |
2 | 2 | use crate::ape::{ApeFile, ApeProperties}; |
3 | 3 | use crate::config::ParseOptions; |
| 4 | +use crate::ebml::{ |
| 5 | + AudioTrackDescriptor, AudioTrackSettings, EbmlFile, EbmlHeaderProperties, EbmlProperties, |
| 6 | + SegmentInfo, |
| 7 | +}; |
4 | 8 | use crate::file::AudioFile; |
5 | 9 | use crate::flac::{FlacFile, FlacProperties}; |
6 | 10 | use crate::iff::aiff::{AiffFile, AiffProperties}; |
@@ -67,6 +71,42 @@ const FLAC_PROPERTIES: FlacProperties = FlacProperties { |
67 | 71 | signature: 164_506_065_180_489_231_127_156_351_872_182_799_315, |
68 | 72 | }; |
69 | 73 |
|
| 74 | +#[allow(non_snake_case)] |
| 75 | +fn MKA_PROPERTIES() -> EbmlProperties { |
| 76 | + EbmlProperties { |
| 77 | + header: EbmlHeaderProperties { |
| 78 | + version: 1, |
| 79 | + read_version: 1, |
| 80 | + max_id_length: 4, |
| 81 | + max_size_length: 8, |
| 82 | + doc_type: String::from("matroska"), |
| 83 | + doc_type_version: 4, |
| 84 | + doc_type_read_version: 0, |
| 85 | + }, |
| 86 | + extensions: Vec::new(), |
| 87 | + segment_info: SegmentInfo { |
| 88 | + timestamp_scale: 1000000, |
| 89 | + muxing_app: String::from("Lavf60.3.100"), |
| 90 | + writing_app: String::from("Lavf60.3.100"), |
| 91 | + }, |
| 92 | + audio_tracks: vec![AudioTrackDescriptor { |
| 93 | + number: 0, |
| 94 | + uid: 0, |
| 95 | + language: String::new(), |
| 96 | + default_duration: 0, |
| 97 | + codec_id: String::new(), |
| 98 | + codec_private: vec![], |
| 99 | + settings: AudioTrackSettings { |
| 100 | + sampling_frequency: 0, |
| 101 | + output_sampling_frequency: 0, |
| 102 | + channels: 0, |
| 103 | + bit_depth: None, |
| 104 | + emphasis: None, |
| 105 | + }, |
| 106 | + }], |
| 107 | + } |
| 108 | +} |
| 109 | + |
70 | 110 | const MP1_PROPERTIES: MpegProperties = MpegProperties { |
71 | 111 | version: MpegVersion::V1, |
72 | 112 | layer: Layer::Layer1, |
@@ -325,6 +365,14 @@ fn flac_properties() { |
325 | 365 | ) |
326 | 366 | } |
327 | 367 |
|
| 368 | +#[test_log::test] |
| 369 | +fn mka_properties() { |
| 370 | + assert_eq!( |
| 371 | + get_properties::<EbmlFile>("tests/files/assets/minimal/full_test.mka"), |
| 372 | + MKA_PROPERTIES() |
| 373 | + ); |
| 374 | +} |
| 375 | + |
328 | 376 | #[test_log::test] |
329 | 377 | fn mp1_properties() { |
330 | 378 | assert_eq!( |
|
0 commit comments