Skip to content

Commit 637e43c

Browse files
committed
Add annotations to allow fields which are never read
See #340
1 parent 30aa1f5 commit 637e43c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

mp4parse/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ struct BoxHeader {
330330
/// Offset to the start of the contained data (or header size).
331331
offset: u64,
332332
/// Uuid for extended type.
333+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
333334
uuid: Option<[u8; 16]>,
334335
}
335336

@@ -341,7 +342,9 @@ impl BoxHeader {
341342
/// File type box 'ftyp'.
342343
#[derive(Debug)]
343344
struct FileTypeBox {
345+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
344346
major_brand: FourCC,
347+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
345348
minor_version: u32,
346349
compatible_brands: TryVec<FourCC>,
347350
}
@@ -350,6 +353,7 @@ struct FileTypeBox {
350353
#[derive(Debug)]
351354
struct MovieHeaderBox {
352355
pub timescale: u32,
356+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
353357
duration: u64,
354358
}
355359

@@ -387,7 +391,9 @@ struct EditListBox {
387391
struct Edit {
388392
segment_duration: u64,
389393
media_time: i64,
394+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
390395
media_rate_integer: i16,
396+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
391397
media_rate_fraction: i16,
392398
}
393399

@@ -511,6 +517,7 @@ pub enum AudioCodecSpecific {
511517
#[derive(Debug)]
512518
pub struct AudioSampleEntry {
513519
pub codec_type: CodecType,
520+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
514521
data_reference_index: u16,
515522
pub channelcount: u32,
516523
pub samplesize: u16,
@@ -531,6 +538,7 @@ pub enum VideoCodecSpecific {
531538
#[derive(Debug)]
532539
pub struct VideoSampleEntry {
533540
pub codec_type: CodecType,
541+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
534542
data_reference_index: u16,
535543
pub width: u16,
536544
pub height: u16,
@@ -543,9 +551,11 @@ pub struct VideoSampleEntry {
543551
#[derive(Debug)]
544552
pub struct VPxConfigBox {
545553
/// An integer that specifies the VP codec profile.
554+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
546555
profile: u8,
547556
/// An integer that specifies a VP codec level all samples conform to the following table.
548557
/// For a description of the various levels, please refer to the VP9 Bitstream Specification.
558+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
549559
level: u8,
550560
/// An integer that specifies the bit depth of the luma and color components. Valid values
551561
/// are 8, 10, and 12.
@@ -555,12 +565,15 @@ pub struct VPxConfigBox {
555565
/// Really an enum defined by "VP Codec ISO Media File Format Binding".
556566
pub chroma_subsampling: u8,
557567
/// Really an enum defined by the "Transfer characteristics" section of ISO 23091-2:2019 § 8.2.
568+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
558569
transfer_characteristics: u8,
559570
/// Really an enum defined by the "Matrix coefficients" section of ISO 23091-2:2019 § 8.3.
560571
/// Available in 'VP Codec ISO Media File Format' version 1 only.
572+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
561573
matrix_coefficients: Option<u8>,
562574
/// Indicates the black level and range of the luma and chroma signals. 0 = legal range
563575
/// (e.g. 16-235 for 8 bit sample depth); 1 = full range (e.g. 0-255 for 8-bit sample depth).
576+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
564577
video_full_range_flag: bool,
565578
/// This is not used for VP8 and VP9 . Intended for binary codec initialization data.
566579
pub codec_init: TryVec<u8>,
@@ -601,6 +614,7 @@ pub struct FLACMetadataBlock {
601614
/// Represents a FLACSpecificBox 'dfLa'
602615
#[derive(Debug)]
603616
pub struct FLACSpecificBox {
617+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
604618
version: u8,
605619
pub blocks: TryVec<FLACMetadataBlock>,
606620
}
@@ -627,6 +641,7 @@ pub struct OpusSpecificBox {
627641
/// Represent an ALACSpecificBox 'alac'
628642
#[derive(Debug)]
629643
pub struct ALACSpecificBox {
644+
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
630645
version: u8,
631646
pub data: TryVec<u8>,
632647
}

0 commit comments

Comments
 (0)