Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate imports #139

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Crate"
3 changes: 1 addition & 2 deletions src/avutil/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ impl<'frame> AVFrameSideDataRef<'frame> {
#[cfg(test)]
mod test {
use super::*;
use crate::avcodec::AVCodec;
use crate::avutil::AVChannelLayout;
use crate::{avcodec::AVCodec, avutil::AVChannelLayout};

#[test]
fn test_get_buffer() {
Expand Down
12 changes: 6 additions & 6 deletions src/avutil/opt.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::error::Result;
use crate::ffi;
use crate::ffi::AVPixelFormat;
use crate::ffi::AVRational;
use crate::ffi::AVSampleFormat;
use crate::shared::RetUpgrade;
use crate::{
error::Result,
ffi,
ffi::{AVPixelFormat, AVRational, AVSampleFormat},
shared::RetUpgrade,
};
use std::ffi::{c_double, c_int, c_void, CStr};

/// - `name`: the name of the field to set
Expand Down
7 changes: 2 additions & 5 deletions src/avutil/pixdesc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::ffi;
use crate::shared::PointerUpgrade;
use crate::{ffi, shared::PointerUpgrade};

use std::ffi::CStr;
use std::ops::Deref;
use std::ptr::NonNull;
use std::{ffi::CStr, ops::Deref, ptr::NonNull};

pub use ffi::AVComponentDescriptor;

Expand Down
4 changes: 1 addition & 3 deletions src/avutil/timestamp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::ffi::av_q2d;
use crate::ffi::AVRational;
use crate::ffi::AV_NOPTS_VALUE;
use crate::ffi::{av_q2d, AVRational, AV_NOPTS_VALUE};
use std::ffi::c_double;

/// Get a string containing a timestamp representation.
Expand Down
12 changes: 7 additions & 5 deletions tests/decode_audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ use rsmpeg::{
ffi,
};
use rusty_ffmpeg::ffi::AV_INPUT_BUFFER_PADDING_SIZE;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
use std::slice::from_raw_parts;
use std::{ffi::CString, io::Read};
use std::{
ffi::CString,
fs::{self, File},
io::{Read, Write},
path::Path,
slice::from_raw_parts,
};

fn get_format_from_sample_fmt(sample_fmt: AVSampleFormat) -> Option<&'static str> {
let sample_fmt_entries = [
Expand Down
10 changes: 6 additions & 4 deletions tests/remux.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! RIIR: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remux.c
use anyhow::{Context, Result};
use cstr::cstr;
use rsmpeg::avcodec::AVPacket;
use rsmpeg::avformat::{AVFormatContextInput, AVFormatContextOutput};
use rsmpeg::avutil::{ts2str, ts2timestr};
use rsmpeg::ffi::AVRational;
use rsmpeg::{
avcodec::AVPacket,
avformat::{AVFormatContextInput, AVFormatContextOutput},
avutil::{ts2str, ts2timestr},
ffi::AVRational,
};
use std::ffi::CStr;

fn log_packet(time_base: AVRational, pkt: &AVPacket, tag: &str) {
Expand Down
Loading