1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2025-04-15 08:14:15 +00:00
This commit is contained in:
damitha 2025-03-20 07:07:27 +11:00
parent e850368b23
commit 1199aa88f9
3 changed files with 8 additions and 6 deletions

View file

@ -65,6 +65,7 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
es_id: 1,
object_type_indication: 0x40,
stream_type: 5,
buffer_size_db: 0,
}),
MediaType::OPUS => MediaConfig::OpusConfig(OpusConfig {
bitrate: track.bitrate(),

View file

@ -305,7 +305,6 @@ fn write_desc<W: Write>(writer: &mut W, tag: u8, size: u32) -> Result<u64> {
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize)]
pub struct ESDescriptor {
pub es_id: u16,
pub dec_config: DecoderConfigDescriptor,
pub sl_config: SLConfigDescriptor,
}
@ -313,7 +312,7 @@ pub struct ESDescriptor {
impl ESDescriptor {
pub fn new(config: &AacConfig) -> Self {
Self {
es_id: 1,
es_id: config.es_id,
dec_config: DecoderConfigDescriptor::new(config),
sl_config: SLConfigDescriptor::new(),
}
@ -400,11 +399,11 @@ pub struct DecoderConfigDescriptor {
impl DecoderConfigDescriptor {
pub fn new(config: &AacConfig) -> Self {
Self {
object_type_indication: config.object_type_indication, // XXX AAC
stream_type: config.stream_type, // XXX Audio
object_type_indication: config.object_type_indication,
stream_type: config.stream_type,
up_stream: 0,
buffer_size_db: 0,
max_bitrate: config.bitrate, // XXX
buffer_size_db: config.buffer_size_db,
max_bitrate: config.bitrate,
avg_bitrate: config.bitrate,
dec_specific: DecoderSpecificDescriptor::new(config),
}

View file

@ -619,6 +619,7 @@ pub struct AacConfig {
pub es_id: u16,
pub object_type_indication: u8,
pub stream_type: u8,
pub buffer_size_db: u8,
}
impl Default for AacConfig {
@ -631,6 +632,7 @@ impl Default for AacConfig {
es_id: 1,
object_type_indication: 0x40,
stream_type: 5,
buffer_size_db: 0,
}
}
}