23 Commits

Author SHA1 Message Date
FreezyLemon
7a8643f2cc
Migrate crates to Rust edition 2021 (#24)
* Migrate ffmpeg-sys to Edition 2021

* Migrate ffmpeg to Edition 2021

* Remove now-redundant imports

* Reorder imports after edition migration
2024-04-06 21:31:36 -04:00
FreezyLemon
9eab7820bb
Fix PadIter in FFmpeg pre-5.0 (#17) 2024-04-03 14:51:12 -04:00
Josh Holmer
e3d3c4a11e Fix ffmpeg 4.x 2023-03-07 13:29:18 -05:00
Josh Holmer
c6dd54003e Support ffmpeg 6.0
Closes #6
2023-03-07 13:21:43 -05:00
Polochon-street
22ad8b9598 Bump version to use ffmpeg 5 2022-02-11 17:58:42 +01:00
Zhiming Wang
f1ccd4e696
filter::Source: add close method
Expose av_buffersrc_close.
2020-08-03 18:49:14 +08:00
Zhiming Wang
1d0d42d81a
filter: test_paditer: register_all before testing the overlay filter
avfilter_register_all required on FFmpeg <4 before avfilter_get_by_name can
find the builtin filters.
2020-07-26 12:42:57 +08:00
Zhiming Wang
73b66ea438
Fix clippy::redundant_field_names 2020-07-26 01:01:13 +08:00
Zhiming Wang
6639f02b80
Fix filter::filter::PadIter to actually iterate
Bug caught by clippy:

  error: offset calculation on zero-sized value
    --> src/filter/filter.rs:98:33
     |
  98 |             let pad = Pad::wrap(self.ptr.offset(self.cur));
     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[deny(clippy::zst_offset)]` on by default
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset

The problem is that `AVFilterPad` is zero-sized:

  #[repr(C)]
  #[derive(Debug, Copy, Clone)]
  pub struct AVFilterPad {
      _unused: [u8; 0],
  }

which is in turn due to `AVFilterPad` being an opaque type in
`libavfilter/avfilter.h`:

  typedef struct AVFilterContext AVFilterContext;
  typedef struct AVFilterLink    AVFilterLink;
  typedef struct AVFilterPad     AVFilterPad;
  typedef struct AVFilterFormats AVFilterFormats;

Doing pointer arithmetic on an opaque (incomplete) type doesn't work. We have
to use the proper FFI calls to obtain info on individual pads. The API has to
be tweaked a bit; hopefully it doesn't break user programs (if it does it
should only break bugged ones...).

Fixes #20.
2020-07-25 23:34:27 +08:00
Zhiming Wang
e9870589b6
filter/mod: fix mutability 2018-09-10 16:22:28 -04:00
Tadas Barzdžius
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
Tadas Barzdžius
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
Tadas Barzdžius
5afe774f40 crate: update bitflags 2017-07-10 11:35:49 +02:00
Tadas Barzdžius
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
meh
b48521108e *: update dependencies 2017-02-19 01:45:05 +01:00
meh
132c514e3f *: returning &mut Self from setters was an awful idea
Deref breaks things.
2015-10-04 03:21:52 +02:00
lummax
56bb62eae3 filter/graph: implement Send and Sync 2015-09-30 18:02:09 +02:00
meh
510e8604b6 *: refactor setters to return self 2015-09-26 18:01:23 +02:00
meh
2ca44d08d4 *: fix UB with CString usage 2015-09-22 02:44:13 +02:00
lummax
4471ffc934 filter/source: add flush() method 2015-09-19 12:32:59 +02:00
lummax
056293a244 filter/graph: add dump() method 2015-09-09 20:25:27 +02:00
lummax
d1e693965c filter/sink: add set_frame_size() 2015-09-08 19:11:18 +02:00
meh
2a3a4e6169 filter: add avfilter wrapper 2015-09-04 16:36:04 +02:00