feat: transcode custom io

This commit is contained in:
kieran 2024-12-21 19:35:00 +00:00
parent 76333375d8
commit de2050cec0
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -33,6 +33,19 @@ impl Transcoder {
}) })
} }
/// Create a new transcoder from both a muxer and a demuxer
pub unsafe fn new_custom_io(demuxer: Demuxer, muxer: Muxer) -> Self {
Self {
demuxer,
decoder: Decoder::new(),
scalers: HashMap::new(),
resampler: HashMap::new(),
encoders: HashMap::new(),
copy_stream: HashMap::new(),
muxer,
}
}
/// Prepare the transcoder by probing the input /// Prepare the transcoder by probing the input
pub unsafe fn prepare(&mut self) -> Result<DemuxerInfo> { pub unsafe fn prepare(&mut self) -> Result<DemuxerInfo> {
self.demuxer.probe_input() self.demuxer.probe_input()