[vlc-devel] [PATCH 1/2] [RFC] filter: carry over the source offset when the visible area is unchanged

Steve Lhomme robux4 at videolabs.io
Thu May 12 13:18:49 CEST 2016


--
Not sure who's responsibility it is to handle the offset. I think it's safe to
say a filter should live it untouched if it doesn't take care of it and just
copy pixels in the same area. Otherwise it can override this behaviour.
---
 include/vlc_filter.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index afe0205..ba75dc5 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -157,6 +157,13 @@ static inline picture_t *filter_NewPicture( filter_t *p_filter )
     picture_t *pic = p_filter->owner.video.buffer_new( p_filter );
     if( pic == NULL )
         msg_Warn( p_filter, "can't get output picture" );
+
+    if ( p_filter->fmt_out.video.i_visible_width  == p_filter->fmt_in.video.i_visible_width &&
+         p_filter->fmt_out.video.i_visible_height == p_filter->fmt_in.video.i_visible_height )
+    {
+        p_filter->fmt_out.video.i_x_offset = p_filter->fmt_in.video.i_x_offset;
+        p_filter->fmt_out.video.i_y_offset = p_filter->fmt_in.video.i_y_offset;
+    }
     return pic;
 }
 
-- 
2.8.1



More information about the vlc-devel mailing list