11use 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
0 commit comments