]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/remoteosd.c
Used VLC_CODEC_* and vlc_fourcc_GetCodec when suitable.
[vlc] / modules / video_filter / remoteosd.c
index 04ef5d2fe3ff93322e9aa7cb8914e6eb7fbd8125..5bc22dc36fa19b8e516a883e789a1d7e07b4ade4 100644 (file)
 static int  CreateFilter ( vlc_object_t * );
 static void DestroyFilter( vlc_object_t * );
 
-vlc_module_begin();
-    set_description( N_("Remote-OSD over VNC") );
-    set_capability( "sub filter", 100 );
-    set_shortname( N_("Remote-OSD") );
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_SUBPIC );
-    add_shortcut( "rmtosd" );
-    set_callbacks( CreateFilter, DestroyFilter );
+vlc_module_begin ()
+    set_description( N_("Remote-OSD over VNC") )
+    set_capability( "sub filter", 100 )
+    set_shortname( N_("Remote-OSD") )
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_SUBPIC )
+    add_shortcut( "rmtosd" )
+    set_callbacks( CreateFilter, DestroyFilter )
 
     add_string( RMTOSD_CFG "host", "myvdr", NULL, RMTOSD_HOST_TEXT,
-        RMTOSD_HOST_LONGTEXT, false );
+        RMTOSD_HOST_LONGTEXT, false )
     add_integer_with_range( RMTOSD_CFG "port", 20001, 1, 0xFFFF, NULL,
-        RMTOSD_PORT_TEXT, RMTOSD_PORT_LONGTEXT, false );
+        RMTOSD_PORT_TEXT, RMTOSD_PORT_LONGTEXT, false )
     add_password( RMTOSD_CFG "password", "", NULL, RMTOSD_PASSWORD_TEXT,
-        RMTOSD_PASSWORD_LONGTEXT, false );
+        RMTOSD_PASSWORD_LONGTEXT, false )
     add_integer_with_range( RMTOSD_CFG "update", RMTOSD_UPDATE_DEFAULT,
         RMTOSD_UPDATE_MIN, RMTOSD_UPDATE_MAX, NULL, RMTOSD_UPDATE_TEXT,
-        RMTOSD_UPDATE_LONGTEXT, true );
+        RMTOSD_UPDATE_LONGTEXT, true )
     add_bool( RMTOSD_CFG "vnc-polling", 0, NULL,
-              RMTOSD_POLL_TEXT , RMTOSD_POLL_LONGTEXT, false );
+              RMTOSD_POLL_TEXT , RMTOSD_POLL_LONGTEXT, false )
     add_bool( RMTOSD_CFG "mouse-events", 0, NULL,
-              RMTOSD_MOUSE_TEXT , RMTOSD_MOUSE_LONGTEXT, false );
+              RMTOSD_MOUSE_TEXT , RMTOSD_MOUSE_LONGTEXT, false )
     add_bool( RMTOSD_CFG "key-events", 0, NULL,
-              RMTOSD_KEYS_TEXT , RMTOSD_KEYS_LONGTEXT, false );
+              RMTOSD_KEYS_TEXT , RMTOSD_KEYS_LONGTEXT, false )
     add_integer_with_range( RMTOSD_CFG "alpha", 255, 0, 255, NULL,
-        RMTOSD_ALPHA_TEXT, RMTOSD_ALPHA_LONGTEXT, true );
+        RMTOSD_ALPHA_TEXT, RMTOSD_ALPHA_LONGTEXT, true )
 
-vlc_module_end();
+vlc_module_end ()
 
 
 /*****************************************************************************
@@ -323,7 +323,7 @@ static int CreateFilter ( vlc_object_t *p_this )
                          KeyEvent, p_this );
     }
 
-    es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+    es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU );
     p_filter->fmt_out.i_priority = 0;
 
     vlc_gcrypt_init();
@@ -333,8 +333,7 @@ static int CreateFilter ( vlc_object_t *p_this )
                                                 sizeof( vlc_object_t ) );
     vlc_object_attach( p_sys->p_worker_thread, p_this );
     if( vlc_thread_create( p_sys->p_worker_thread, "vnc worker thread",
-                           vnc_worker_thread,
-                           VLC_THREAD_PRIORITY_LOW, false ) )
+                           vnc_worker_thread, VLC_THREAD_PRIORITY_LOW ) )
     {
         vlc_object_detach( p_sys->p_worker_thread );
         vlc_object_release( p_sys->p_worker_thread );
@@ -698,7 +697,7 @@ static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
 
     /* Create an empty picture for VNC the data */
     vlc_mutex_lock( &p_sys->lock );
-    p_sys->p_pic = picture_New( VLC_FOURCC('Y','U','V','A'),
+    p_sys->p_pic = picture_New( VLC_CODEC_YUVA,
                                 p_sys->i_vnc_width, p_sys->i_vnc_height, VOUT_ASPECT_FACTOR );
     if( !p_sys->p_pic )
     {
@@ -715,8 +714,7 @@ static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
     vlc_object_attach( p_update_request_thread, p_filter );
     if( vlc_thread_create( p_update_request_thread,
                            "vnc update request thread",
-                           update_request_thread,
-                           VLC_THREAD_PRIORITY_LOW, false ) )
+                           update_request_thread, VLC_THREAD_PRIORITY_LOW ) )
     {
         vlc_object_detach( p_update_request_thread );
         vlc_object_release( p_update_request_thread );
@@ -1156,13 +1154,13 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
 
     /* Create new SPU region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+    fmt.i_chroma = VLC_CODEC_YUVA;
     fmt.i_aspect = VOUT_ASPECT_FACTOR;
     fmt.i_sar_num = fmt.i_sar_den = 1;
     fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
     fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
     fmt.i_x_offset = fmt.i_y_offset = 0;
-    p_region = p_spu->pf_create_region( VLC_OBJECT(p_filter), &fmt );
+    p_region = subpicture_region_New( &fmt );
     if( !p_region )
     {
         msg_Err( p_filter, "cannot allocate SPU region" );
@@ -1171,7 +1169,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         return NULL;
     }
 
-    vout_CopyPicture( p_filter, &p_region->picture, p_pic );
+    /* FIXME the copy is probably not needed anymore */
+    picture_Copy( p_region->p_picture, p_pic );
 
     p_sys->b_need_update = false;