Skip to content

Commit af53632

Browse files
committed
fmt
1 parent 6d2e59b commit af53632

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

example/src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use rustsynth::{
22
core::CoreRef,
3-
filter::{
4-
traits::{Filter},
5-
FilterDependency, FilterMode, RequestPattern,
6-
},
3+
filter::{traits::Filter, FilterDependency, FilterMode, RequestPattern},
74
frame::{Frame, FrameContext},
85
map::Map,
96
node::Node,
@@ -17,7 +14,7 @@ mod plugin {
1714
const NAMESPACE: &'static str = "example";
1815
const ID: &'static str = "com.example.invert";
1916
const NAME: &'static str = "Example Plugin";
20-
const PLUGIN_VER: i32 = MakeVersion!(1,0);
17+
const PLUGIN_VER: i32 = MakeVersion!(1, 0);
2118
const API_VER: i32 = ffi::VAPOURSYNTH_API_VERSION;
2219
const FLAGS: i32 = PluginConfigFlags::NONE.bits();
2320

@@ -63,15 +60,15 @@ mod plugin {
6360
let height = src.get_height(0);
6461
let width = src.get_width(0);
6562
let mut dst = Frame::new_video_frame(&core, width, height, &vf, Some(&src));
66-
63+
6764
// Actually do the invert operation
6865
for plane in 0..vf.num_planes {
6966
let srcp = src.get_read_ptr(plane);
7067
let dstp = dst.get_write_ptr(plane);
7168
let stride = src.get_stride(plane) as usize;
7269
let h = src.get_height(plane) as usize;
7370
let w = src.get_width(plane) as usize;
74-
71+
7572
for y in 0..h {
7673
for x in 0..w {
7774
unsafe {
@@ -81,8 +78,7 @@ mod plugin {
8178
}
8279
}
8380
}
84-
drop(src); // Free input frame ASAP
85-
Ok(dst)
81+
Ok(dst)
8682
}
8783
}
8884

rustsynth/src/filter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustsynth_sys::{VSActivationReason, VSFilterMode};
22

33
use crate::ffi;
44
use crate::ffi::VSRequestPattern;
5-
use crate::frame::{FrameContext, Frame};
5+
use crate::frame::{Frame, FrameContext};
66
use crate::node::Node;
77

88
pub struct FilterDependency {

rustsynth/src/frame.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ pub struct Frame<'core> {
5757
_owner: PhantomData<&'core ()>,
5858
}
5959

60-
6160
unsafe impl<'core> Send for Frame<'core> {}
6261
unsafe impl<'core> Sync for Frame<'core> {}
6362

64-
6563
impl<'core> Drop for Frame<'core> {
6664
fn drop(&mut self) {
6765
unsafe { API::get_cached().free_frame(self.handle.as_ptr()) }
@@ -200,7 +198,7 @@ impl<'core> Frame<'core> {
200198
#[inline]
201199
pub fn get_read_ptr(&self, plane: i32) -> *const u8 {
202200
unsafe { API::get_cached().get_frame_read_ptr(self.handle.as_ref(), plane) }
203-
}
201+
}
204202

205203
/// Get mutable access to plane data (only for owned frames)
206204
#[inline]

0 commit comments

Comments
 (0)