[vlc-commits] goom: keep track of video format

Rémi Denis-Courmont git at videolan.org
Sun Oct 28 15:48:13 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 28 16:33:39 2018 +0200| [fc09f62998368eb30908f6f8f7796b6636a3263f] | committer: Rémi Denis-Courmont

goom: keep track of video format

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc09f62998368eb30908f6f8f7796b6636a3263f
---

 modules/visualization/goom.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index 55396afc8c..be3ca2dc13 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -79,9 +79,8 @@ vlc_module_end ()
 typedef struct
 {
     vlc_thread_t  thread;
+    video_format_t fmt;
 
-    int           i_width;
-    int           i_height;
     vout_thread_t *p_vout;
     int           i_speed;
 
@@ -111,22 +110,20 @@ static int Open( vlc_object_t *p_this )
 {
     filter_t       *p_filter = (filter_t *)p_this;
     goom_thread_t  *p_thread;
-    video_format_t fmt;
 
     /* Create goom thread */
     p_thread = calloc( 1, sizeof(*p_thread) );
 
-    const int width  = p_thread->i_width  = var_InheritInteger( p_filter, "goom-width" );
-    const int height = p_thread->i_height = var_InheritInteger( p_filter, "goom-height" );
-
-    memset( &fmt, 0, sizeof(video_format_t) );
+    const int width  = var_InheritInteger( p_filter, "goom-width" );
+    const int height = var_InheritInteger( p_filter, "goom-height" );
 
-    fmt.i_width = fmt.i_visible_width = width;
-    fmt.i_height = fmt.i_visible_height = height;
-    fmt.i_chroma = VLC_CODEC_RGB32;
-    fmt.i_sar_num = fmt.i_sar_den = 1;
+    p_thread->fmt.i_width = p_thread->fmt.i_visible_width = width;
+    p_thread->fmt.i_height = p_thread->fmt.i_visible_height = height;
+    p_thread->fmt.i_chroma = VLC_CODEC_RGB32;
+    p_thread->fmt.i_sar_num = p_thread->fmt.i_sar_den = 1;
 
-    p_thread->p_vout = aout_filter_RequestVout( p_filter, NULL, &fmt );
+    p_thread->p_vout = aout_filter_RequestVout( p_filter, NULL,
+                                                &p_thread->fmt );
     if( p_thread->p_vout == NULL )
     {
         msg_Err( p_filter, "no suitable vout module" );
@@ -280,7 +277,7 @@ static void *Thread( void *p_thread_data )
     PluginInfo *p_plugin_info;
     int canc = vlc_savecancel ();
 
-    p_plugin_info = goom_init( p_thread->i_width, p_thread->i_height );
+    p_plugin_info = goom_init( p_thread->fmt.i_width, p_thread->fmt.i_height );
 
     for( ;; )
     {
@@ -319,7 +316,8 @@ static void *Thread( void *p_thread_data )
         if( unlikely(p_pic == NULL) )
             continue;
 
-        memcpy( p_pic->p[0].p_pixels, plane, p_thread->i_width * p_thread->i_height * 4 );
+        memcpy( p_pic->p[0].p_pixels, plane,
+                p_thread->fmt.i_width * p_thread->fmt.i_height * 4 );
 
         p_pic->date = date_Get( &i_pts ) + GOOM_DELAY;
         vout_PutPicture( p_thread->p_vout, p_pic );



More information about the vlc-commits mailing list