Commit Graph

179 Commits

Author SHA1 Message Date
6f0a14ee8b codec: fix codec description potential null ptr issue
Codecs may not have .long_name initialized.

Issue raised by Pilyushkin in #34.
2020-10-04 11:37:59 +08:00
5affb85148 codec: fix signature of Packet::write_interleaved
av_interleaved_write_frame never returns 1, so bool makes no sense:
https://github.com/FFmpeg/FFmpeg/blob/n4.3.1/libavformat/avformat.h#L2592-L2635

Fixes #25.
2020-08-08 22:48:01 +08:00
6f44fb79fd codec: deprecate encoder's encode/flush and decoder's decode 2020-08-08 01:16:44 +08:00
07fe207ac2 codec: implement DerefMut for encoder::Audio and encoder::Subtitle 2020-08-08 00:38:09 +08:00
363001febe codec: expose modern send/receive packet/frame APIs
avcodec_encode_video2()/avcodec_decode_video2/avcodec_encode_audio2()/avcodec_decode_audio4()
have been deprecated since FFmpeg 3.1, with modern
avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/avcodec_receive_packet()
as replacements.

This commit adds send_packet(), send_eof() and receive_frame() to
decoder::Opened; send_frame(), send_eof() and receive_packet() to
encoder::Encoder to expose these modern APIs.
2020-08-08 00:37:54 +08:00
516f8069f6 Packet setters 2020-08-07 22:43:53 +08:00
b28e852eb0 Implement automatic FFmpeg version detection
Based on ffmpeg-sys-next 4.3.2.
2020-08-02 11:44:13 +08:00
73b66ea438 Fix clippy::redundant_field_names 2020-07-26 01:01:13 +08:00
15c87a7837 Add FFmpeg 4.3 specific code 2020-06-17 01:51:38 +08:00
036c0e5b42 Fix duplicate enum variant issues for FFmpeg 3.4 2020-06-11 23:18:47 +08:00
307f52c002 Reformat code with latest cargo fmt 2020-06-02 17:54:31 +08:00
fcca68ae5e Add FFmpeg 4.2 specific code 2020-06-01 14:42:39 +08:00
a69a457e3a Add FFmpeg 4.1 specific code 2020-06-01 14:15:33 +08:00
6644a91da4 Update bitflags to 1.2 and fix namespacing 2020-06-01 13:06:34 +08:00
13a2354a2c Fix bare_trait_objects deprecation 2020-05-31 14:16:23 +08:00
587ec66592 Fix libc::int64_t deprecation 2020-05-31 13:34:24 +08:00
3056975836 Fix libc::uint32_t deprecation 2020-05-31 13:28:14 +08:00
a7eee9142f Revert 8199541 and guard with not(ffmpeg4) 2018-09-19 17:08:42 -04:00
0e05c0bb29 Mark new macros introduced in 2c5abbf as ffmpeg4 2018-09-19 16:54:16 -04:00
2c5abbfe33 Add missing macros (FFmpeg 4.0.2) 2018-09-10 16:22:16 -04:00
8199541f09 Drop obselete macros (obselete wrt FFmpeg 4.0) 2018-09-10 14:39:28 -04:00
0bcd4550b8 *: format code with rustfmt and fix clippy suggestions
* Add avformat_close_input call to clean up AVFormantContext
* Format code with rustfmt
* Fix clippy lint double_parens
* Fix clippy lint deref_addrof
* Fix clippy lint identity_conversion
* Fix clippy lint match_ref_pats
* Fix clippy lint cast_lossless
* Fix clippy lint cmp_null
* Fix clippy lint clone_on_ref_ptr
* Fix clippy lint map_clone
* Fix clippy lint needless_borrow
* Fix clippy lint needless_pass_by_value
* Fix clippy lints for examples
* Fix clippy lint unused_io_amount
* Fix clippy lint new_without_default
* Ignore inline_always clippy lint
* Add vim temp files to .gitignore
2018-04-10 16:06:42 +02:00
94ebdf143c *: add the newest enum values from ffmpeg-sys 2017-11-29 20:49:54 +01:00
7d980a693e *: fix warnings
- Don't use deprecated function for packet dropping
- Fix compiler warning about values, which do not need to be mutable
2017-09-19 14:36:35 +02:00
5afe774f40 crate: update bitflags 2017-07-10 11:35:49 +02:00
5ac0527bdc *: use latest ffmpeg-sys using bindgen
* Update bindings to newest ffmpeg version for new ffmpeg-sys, which is mostly generated by bindgen
* Bring back removed feature flags
* Fix whitespace formating
* Remove prepended enum names to enum variants
* Remove unneeded allows
2017-07-08 17:00:27 +02:00
9e933fa4fb codec/encoder/video: add colorspace and color_range accessors 2017-06-14 13:01:59 +02:00
meh
b48521108e *: update dependencies 2017-02-19 01:45:05 +01:00
edb6d91f59 codec/context: more Into 2016-12-03 01:44:56 +01:00
8609619a5d codec: impl AsMut for all Context wrappers 2016-12-03 01:43:30 +01:00
4df56b516f codec/parameters: impl AsRef for all codec::Context wrappers 2016-12-03 01:43:23 +01:00
36ac2513c1 codec/parameters: make api more flexible and consistent 2016-12-03 01:43:21 +01:00
f1ce26a137 codec/parameters: add medium and id methods 2016-12-03 01:42:40 +01:00
606847cc50 codec: introduce Parameters
As of ffmpeg 3.1, a new `AVCodecParameters` type and related API introduced.
This commit contains minimal changes to support new API.
2016-12-03 01:41:29 +01:00
e1c132bd08 codec/packet: add set_pts/dts methods 2016-11-29 01:07:26 +01:00
2ed824aaac *: upgrade to 3.2
Fix errors when built with https://github.com/meh/rust-ffmpeg-sys/pull/35.
2016-11-27 23:16:47 +01:00
859c01f268 codec/encoder/video: add missing feature flag (quant_bias) 2016-05-20 14:08:32 +02:00
e4fcdad658 codec/encoder/video: add missing feature flag (motion_est) 2016-05-20 14:08:32 +02:00
f5941792f9 codec/id: fix voxware feature name 2016-03-30 22:51:44 +02:00
meh
b6c92b2805 crate: check headers for ifdefs 2015-12-03 18:23:06 +01:00
meh
d2b6557fbc codec/encoder/audio: add open_with() constructor 2015-10-26 20:27:04 +01:00
meh
6bb6a806ed codec/encoder/video: add open_with() constructor 2015-10-26 20:26:21 +01:00
2cf4da707a codec/packet: unify duration() to return i64
As all other instances of timestamps (duration/pts/dts)
2015-10-25 22:33:22 +01:00
meh
01b5f74fb0 codec/subtitle: refactor Rect handling 2015-10-25 22:32:42 +01:00
meh
5677b0ee6e codec/packet: fix SideDataIter.size_hint 2015-10-25 22:32:02 +01:00
ac0ef697cf codec/decoder/opened: add flush method 2015-10-14 18:24:42 +02:00
meh
8b6e41f68c codec/packet/borrow: remove unused imports 2015-10-09 17:50:15 +02:00
meh
306b9c6698 codec/packet: refactoring to allow zero-copy packet creation 2015-10-09 14:09:35 +02:00
meh
7e2ebcf36b codec/packet: use size to know if a packet is empty 2015-10-07 16:20:46 +02:00
meh
132c514e3f *: returning &mut Self from setters was an awful idea
Deref breaks things.
2015-10-04 03:21:52 +02:00