Commit Graph
507 Commits
Author SHA1 Message Date
Luke Street e6fc7fc80e fix(format): skip avio_open when format has AVFMT_NOFILE
Avoids creating empty files for parameterized output paths and similar.
2023-10-31 10:37:50 -04:00
eba4efef0c fix: use explicit types for lifetime transmutation
This fixes an accidental transmute (found by @projectgus) from an &Input to a &Context,
which was only working accidentally by type layout coincidence.

Co-Authored-By: Angus Gratton <gus@projectgus.com>
2023-09-04 14:15:38 +02:00
tilpner 825e0d4484 feat(codec/packet, util/frame): expose time_base fields 2023-08-29 16:09:37 +02:00
tilpner 3d6efeba5e fix(codec, format)!: detect unset time_bases, allow unsetting time_base
Instead of silently passing possibly unset `time_base`s back into ffmpeg,
force users to explicitly handle (even if just by early panic) their absence.

BREAKING CHANGE: `time_base` and `set_time_base` functions now
return/accept Option<Rational> (±Into). `unwrap`/`expect` is a valid way
to surface this unwanted state early in user code.

For symmetry, `set_time_base` also allows unsetting by passing a `None`,
so all existing calls (with non-zero timebases) need to wrap the
argument in `Some`.
2023-08-29 16:09:37 +02:00
tilpner df08039eeb refactor: use Rational::non_zero instead of manual comparisons 2023-08-29 16:09:33 +02:00
tilpner 23dde387b7 feat(util/rational): add Rational::non_zero for guarding against zero-valued Rationals 2023-08-29 15:53:09 +02:00
tilpnerandTill Höppner 4486c6d4b7 feat(util/error): print error tags in Debug if in ascii-range 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner d34e233d45 fix(format): properly mark contexts using custom IO, and call avio_close if they don't 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 1d7022e63d feat(util/frame): add method to check if a frame is writable 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 1172d4eb6a feat(codec/parameters): add convenience functions to create De-/Encoders from codec parameters 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 969d8d3c9d style(codec): re-export Encoder, Decoder 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 9d4679ebd7 feat(codec): expose frame_rate via Context, for Deref usage...
through Encoder and Decoder
2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 0b54b62ebf style(codec/decoder): expose time_base via Context Deref only 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner df3a0c0283 fix(codec/context): implement Clone without avcodec_copy_context, removed in 5.0 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner a7486b5e0d feat(codec/context): add convenience function for retrieving parameters from a codec context 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner ad3f8c68a9 fix(codec/parameters): impl From for Parameters for impl Deref<Target=Context> over AsRef 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner c51ba1e289 fix(codec/decoder/audio): remove frame_start, removed in 5.0 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 807a16d1a0 fix(format/stream): adjust for removed stream codec, removed in 5.0 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 70fae591d3 feat(format/stream): expose frame-rate guessing 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner be43de0157 feat(format/stream): add Stream::decoder to initialize a decoder context from stream metadata 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner cb5ed6dcf4 style(format/io): silence unused-result warning 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 946e9bae4f feat(format/context): add flush function for frag_custom 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 873ea651fc feat(codec/packet): expose opaque field 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner e63a0a5047 fix(codec/packet): clone by referencing packet data 2023-05-24 17:22:59 +02:00
tilpnerandTill Höppner 9c659e2072 fix(format/context): stop specifying codec during stream creation, it does nothing and is confusing 2023-05-24 17:22:59 +02:00