]> git.sesse.net Git - vlc/blobdiff - modules/codec/kate.c
avcodec: set EncodeAudio/Video at the end
[vlc] / modules / codec / kate.c
index 7f697bdf8759d288bae5a1b60e8ccffd00cd6baf..0953c4f2be9bdc5d5e5fa3f9c88c0adf84484f88 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * kate.c : a decoder for the kate bitstream format
  *****************************************************************************
- * Copyright (C) 2000-2008 the VideoLAN team
+ * Copyright (C) 2000-2008 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -277,47 +277,46 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_INPUT_SCODEC )
     add_shortcut( "kate" )
 
-    add_bool( "kate-formatted", true, NULL, FORMAT_TEXT, FORMAT_LONGTEXT,
+    add_bool( "kate-formatted", true, FORMAT_TEXT, FORMAT_LONGTEXT,
               true )
 
 #ifdef HAVE_TIGER
-    add_bool( "kate-use-tiger", true, NULL, TIGER_TEXT, TIGER_LONGTEXT,
+    add_bool( "kate-use-tiger", true, TIGER_TEXT, TIGER_LONGTEXT,
               true )
     add_float_with_range( "kate-tiger-quality",
-                          TIGER_QUALITY_DEFAULT, 0.0f, 1.0f, TigerConfigurationCallback,
+                          TIGER_QUALITY_DEFAULT, 0.0f, 1.0f,
                           TIGER_QUALITY_TEXT, TIGER_QUALITY_LONGTEXT,
                           true )
 
     set_section( N_("Tiger rendering defaults"), NULL );
-    add_string( "kate-tiger-default-font-desc",
-                TIGER_DEFAULT_FONT_DESC_DEFAULT, TigerConfigurationCallback,
+    add_string( "kate-tiger-default-font-desc", TIGER_DEFAULT_FONT_DESC_DEFAULT,
                 TIGER_DEFAULT_FONT_DESC_TEXT, TIGER_DEFAULT_FONT_DESC_LONGTEXT, true);
     add_integer_with_range( "kate-tiger-default-font-effect",
                             TIGER_DEFAULT_FONT_EFFECT_DEFAULT,
-                            0, sizeof(pi_font_effects)/sizeof(pi_font_effects[0])-1, TigerConfigurationCallback,
+                            0, sizeof(pi_font_effects)/sizeof(pi_font_effects[0])-1,
                             TIGER_DEFAULT_FONT_EFFECT_TEXT, TIGER_DEFAULT_FONT_EFFECT_LONGTEXT,
                             true )
-    change_integer_list( pi_font_effects, ppsz_font_effect_names, NULL );
+    change_integer_list( pi_font_effects, ppsz_font_effect_names );
     add_float_with_range( "kate-tiger-default-font-effect-strength",
-              TIGER_DEFAULT_FONT_EFFECT_STRENGTH_DEFAULT, 0.0f, 1.0f, TigerConfigurationCallback,
+              TIGER_DEFAULT_FONT_EFFECT_STRENGTH_DEFAULT, 0.0f, 1.0f,
               TIGER_DEFAULT_FONT_EFFECT_STRENGTH_TEXT, TIGER_DEFAULT_FONT_EFFECT_STRENGTH_LONGTEXT,
               true )
     add_integer_with_range( "kate-tiger-default-font-color",
-                            TIGER_DEFAULT_FONT_COLOR_DEFAULT, 0, 0x00ffffff, TigerConfigurationCallback,
+                            TIGER_DEFAULT_FONT_COLOR_DEFAULT, 0, 0x00ffffff,
                             TIGER_DEFAULT_FONT_COLOR_TEXT, TIGER_DEFAULT_FONT_COLOR_LONGTEXT,
                             true);
-    change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
+    change_integer_list( pi_color_values, ppsz_color_descriptions );
     add_integer_with_range( "kate-tiger-default-font-alpha",
-                            TIGER_DEFAULT_FONT_ALPHA_DEFAULT, 0, 255, TigerConfigurationCallback,
+                            TIGER_DEFAULT_FONT_ALPHA_DEFAULT, 0, 255,
                             TIGER_DEFAULT_FONT_ALPHA_TEXT, TIGER_DEFAULT_FONT_ALPHA_LONGTEXT,
                             true);
     add_integer_with_range( "kate-tiger-default-background-color",
-                            TIGER_DEFAULT_BACKGROUND_COLOR_DEFAULT, 0, 0x00ffffff, TigerConfigurationCallback,
+                            TIGER_DEFAULT_BACKGROUND_COLOR_DEFAULT, 0, 0x00ffffff,
                             TIGER_DEFAULT_BACKGROUND_COLOR_TEXT, TIGER_DEFAULT_BACKGROUND_COLOR_LONGTEXT,
                             true);
-    change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
+    change_integer_list( pi_color_values, ppsz_color_descriptions );
     add_integer_with_range( "kate-tiger-default-background-alpha",
-                            TIGER_DEFAULT_BACKGROUND_ALPHA_DEFAULT, 0, 255, TigerConfigurationCallback,
+                            TIGER_DEFAULT_BACKGROUND_ALPHA_DEFAULT, 0, 255,
                             TIGER_DEFAULT_BACKGROUND_ALPHA_TEXT, TIGER_DEFAULT_BACKGROUND_ALPHA_LONGTEXT,
                             true);
 #endif
@@ -405,14 +404,15 @@ static int OpenDecoder( vlc_object_t *p_this )
             p_sys->p_tr = NULL;
             p_sys->b_use_tiger = false;
         }
-
-        CHECK_TIGER_RET( tiger_renderer_set_surface_clear_color( p_sys->p_tr, 1, 0, 0, 0, 0 ) );
-
-        UpdateTigerFontEffect( p_dec );
-        UpdateTigerFontColor( p_dec );
-        UpdateTigerBackgroundColor( p_dec );
-        UpdateTigerQuality( p_dec );
-        UpdateTigerFontDesc( p_dec );
+        else {
+            CHECK_TIGER_RET( tiger_renderer_set_surface_clear_color( p_sys->p_tr, 1, 0, 0, 0, 0 ) );
+
+            UpdateTigerFontEffect( p_dec );
+            UpdateTigerFontColor( p_dec );
+            UpdateTigerBackgroundColor( p_dec );
+            UpdateTigerQuality( p_dec );
+            UpdateTigerFontDesc( p_dec );
+        }
     }
 
 #else
@@ -653,7 +653,6 @@ static void GetVideoSize( decoder_t *p_dec, int *w, int *h )
 {
     /* searching for vout to get its size is frowned upon, so we don't and
        use a default size if the original canvas size is not specified. */
-#if 1
     decoder_sys_t *p_sys = p_dec->p_sys;
     if( p_sys->ki.original_canvas_width > 0 && p_sys->ki.original_canvas_height > 0 )
     {
@@ -667,30 +666,6 @@ static void GetVideoSize( decoder_t *p_dec, int *w, int *h )
         /* nothing, leave defaults */
         msg_Dbg( p_dec, "original canvas size unknown");
     }
-#else
-    /* keep this just in case it might be allowed one day ;) */
-    vout_thread_t *p_vout;
-    p_vout = vlc_object_find( (vlc_object_t*)p_dec, VLC_OBJECT_VOUT, FIND_CHILD );
-    if( p_vout )
-    {
-        decoder_sys_t *p_sys = p_dec->p_sys;
-        if( p_sys->ki.original_canvas_width > 0 && p_sys->ki.original_canvas_height > 0 )
-        {
-            *w = p_sys->ki.original_canvas_width;
-            *h = p_sys->ki.original_canvas_height;
-        }
-        else
-        {
-            *w = p_vout->fmt_in.i_width;
-            *h = p_vout->fmt_in.i_height;
-        }
-        msg_Dbg( p_dec, "video: in %d %d, out %d %d, original canvas %zu %zu",
-                 p_vout->fmt_in.i_width, p_vout->fmt_in.i_height,
-                 p_vout->fmt_out.i_width, p_vout->fmt_out.i_height,
-                 p_sys->ki.original_canvas_width, p_sys->ki.original_canvas_height );
-        vlc_object_release( p_vout );
-    }
-#endif
 }
 
 static void CreateKateBitmap( picture_t *pic, const kate_bitmap *bitmap )
@@ -822,6 +797,8 @@ static int TigerValidateSubpicture( subpicture_t *p_subpic,
                                     bool b_fmt_dst, const video_format_t *p_fmt_dst,
                                     mtime_t ts )
 {
+    VLC_UNUSED(p_fmt_src); VLC_UNUSED(p_fmt_dst);
+
     decoder_sys_t *p_sys = p_subpic->updater.p_sys->p_dec_sys;
 
     if( b_fmt_src || b_fmt_dst )