]> git.sesse.net Git - vlc/blobdiff - modules/codec/ffmpeg/ffmpeg.c
Remove E_()
[vlc] / modules / codec / ffmpeg / ffmpeg.c
index d5e6f2dbe363af277fbccf9559f6d2c7852b3170..02f91d1a8832780f79edf115449b37b8096a7876 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include <vlc/vlc.h>
+#include <vlc_plugin.h>
 #include <vlc_codec.h>
 
 /* ffmpeg header */
@@ -73,8 +74,10 @@ static int  nloopf_list[] = { 0, 1, 2, 3, 4 };
 static const char *nloopf_list_text[] =
   { N_("None"), N_("Non-ref"), N_("Bidir"), N_("Non-key"), N_("All") };
 
+#ifdef ENABLE_SOUT
 static const char *enc_hq_list[] = { "rd", "bits", "simple" };
 static const char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") };
+#endif
 
 #if defined(HAVE_LIBSWSCALE_SWSCALE_H)  || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
 static int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
@@ -139,12 +142,13 @@ vlc_module_begin();
     add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,
                  true );
 
+#ifdef ENABLE_SOUT
     /* encoder submodule */
     add_submodule();
     set_section( N_("Encoding") , NULL );
     set_description( _("FFmpeg audio/video encoder") );
     set_capability( "encoder", 100 );
-    set_callbacks( E_(OpenEncoder), E_(CloseEncoder) );
+    set_callbacks( OpenEncoder, CloseEncoder );
 
     add_string( ENC_CFG_PREFIX "hq", "simple", NULL, ENC_HQ_TEXT,
                 ENC_HQ_LONGTEXT, false );
@@ -203,6 +207,7 @@ vlc_module_begin();
     add_string( ENC_CFG_PREFIX "aac-profile", "main", NULL,
                 ENC_PROFILE_TEXT, ENC_PROFILE_LONGTEXT, true );
 #endif
+#endif /* ENABLE_SOUT */
 
 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
 
@@ -210,15 +215,17 @@ vlc_module_begin();
     add_submodule();
     set_description( _("FFmpeg demuxer" ) );
     set_capability( "demux", 2 );
-    set_callbacks( E_(OpenDemux), E_(CloseDemux) );
+    set_callbacks( OpenDemux, CloseDemux );
 
+#ifdef ENABLE_SOUT
     /* mux submodule */
     add_submodule();
     set_description( _("FFmpeg muxer" ) );
     set_capability( "sout mux", 2 );
     add_string( "ffmpeg-mux", NULL, NULL, MUX_TEXT,
                 MUX_LONGTEXT, true );
-    set_callbacks( E_(OpenMux), E_(CloseMux) );
+    set_callbacks( OpenMux, CloseMux );
+#endif
 #endif
 
 #if defined(HAVE_LIBSWSCALE_SWSCALE_H)  || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
@@ -228,7 +235,7 @@ vlc_module_begin();
     set_capability( "video filter2", 1000 );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VFILTER );
-    set_callbacks( E_(OpenScaler), E_(CloseScaler) );
+    set_callbacks( OpenScaler, CloseScaler );
     add_integer( "swscale-mode", 0, NULL, SCALEMODE_TEXT, SCALEMODE_LONGTEXT, true );
         change_integer_list( pi_mode_values, ppsz_mode_descriptions, 0 );
 
@@ -236,26 +243,26 @@ vlc_module_begin();
     /* video filter submodule */
     add_submodule();
     set_capability( "video filter2", 50 );
-    set_callbacks( E_(OpenFilter), E_(CloseFilter) );
+    set_callbacks( OpenFilter, CloseFilter );
     set_description( _("FFmpeg video filter") );
 
     /* crop/padd submodule */
     add_submodule();
     set_capability( "crop padd", 10 );
-    set_callbacks( E_(OpenCropPadd), E_(CloseFilter) );
+    set_callbacks( OpenCropPadd, CloseFilter );
     set_description( _("FFmpeg crop padd filter") );
 #endif
 
     /* chroma conversion submodule */
     add_submodule();
     set_capability( "chroma", 50 );
-    set_callbacks( E_(OpenChroma), E_(CloseChroma) );
+    set_callbacks( OpenChroma, CloseChroma );
     set_description( _("FFmpeg chroma conversion") );
 
     /* video filter submodule */
     add_submodule();
     set_capability( "video filter2", 0 );
-    set_callbacks( E_(OpenDeinterlace), E_(CloseDeinterlace) );
+    set_callbacks( OpenDeinterlace, CloseDeinterlace );
     set_description( _("FFmpeg deinterlace video filter") );
     add_shortcut( "ffmpeg-deinterlace" );
 
@@ -274,7 +281,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     AVCodec        *p_codec = NULL;
 
     /* *** determine codec type *** */
-    if( !E_(GetFfmpegCodec)( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id,
+    if( !GetFfmpegCodec( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id,
                              &psz_namecodec ) )
     {
         return VLC_EGENERIC;
@@ -289,7 +296,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
 
     /* Initialization must be done before avcodec_find_decoder() */
-    E_(InitLibavcodec)(p_this);
+    InitLibavcodec(p_this);
 
     /* *** ask ffmpeg for a decoder *** */
     p_codec = avcodec_find_decoder( i_codec_id );
@@ -334,13 +341,13 @@ static int OpenDecoder( vlc_object_t *p_this )
     switch( i_cat )
     {
     case VIDEO_ES:
-        p_dec->pf_decode_video = E_(DecodeVideo);
-        i_result = E_( InitVideoDec )( p_dec, p_context, p_codec,
+        p_dec->pf_decode_video = DecodeVideo;
+        i_result =  InitVideoDec ( p_dec, p_context, p_codec,
                                        i_codec_id, psz_namecodec );
         break;
     case AUDIO_ES:
-        p_dec->pf_decode_audio = E_(DecodeAudio);
-        i_result = E_( InitAudioDec )( p_dec, p_context, p_codec,
+        p_dec->pf_decode_audio = DecodeAudio;
+        i_result =  InitAudioDec ( p_dec, p_context, p_codec,
                                        i_codec_id, psz_namecodec );
         break;
     default:
@@ -363,10 +370,10 @@ static void CloseDecoder( vlc_object_t *p_this )
     switch( p_sys->i_cat )
     {
     case AUDIO_ES:
-        E_( EndAudioDec )( p_dec );
+         EndAudioDec ( p_dec );
         break;
     case VIDEO_ES:
-        E_( EndVideoDec )( p_dec );
+         EndVideoDec ( p_dec );
         break;
     }
 
@@ -391,7 +398,7 @@ static void CloseDecoder( vlc_object_t *p_this )
 /*****************************************************************************
  *
  *****************************************************************************/
-void E_(LibavcodecCallback)( void *p_opaque, int i_level,
+void LibavcodecCallback( void *p_opaque, int i_level,
                              const char *psz_format, va_list va )
 {
     int i_vlc_level;
@@ -445,7 +452,7 @@ void E_(LibavcodecCallback)( void *p_opaque, int i_level,
     free( psz_new_format );
 }
 
-void E_(InitLibavcodec)( vlc_object_t *p_object )
+void InitLibavcodec( vlc_object_t *p_object )
 {
     static int b_ffmpeginit = 0;
     vlc_mutex_t *lock = var_AcquireMutex( "avcodec" );
@@ -455,7 +462,7 @@ void E_(InitLibavcodec)( vlc_object_t *p_object )
     {
         avcodec_init();
         avcodec_register_all();
-        av_log_set_callback( E_(LibavcodecCallback) );
+        av_log_set_callback( LibavcodecCallback );
         b_ffmpeginit = 1;
 
         msg_Dbg( p_object, "libavcodec initialized (interface %d )",
@@ -521,7 +528,7 @@ static struct
     { 0, 0 }
 };
 
-int E_(GetFfmpegChroma)( vlc_fourcc_t i_chroma )
+int GetFfmpegChroma( vlc_fourcc_t i_chroma )
 {
     int i;
 
@@ -533,7 +540,7 @@ int E_(GetFfmpegChroma)( vlc_fourcc_t i_chroma )
     return -1;
 }
 
-vlc_fourcc_t E_(GetVlcChroma)( int i_ffmpeg_chroma )
+vlc_fourcc_t GetVlcChroma( int i_ffmpeg_chroma )
 {
     int i;
 
@@ -1195,6 +1202,11 @@ static struct
     { VLC_FOURCC('8','B','P','S'), CODEC_ID_8BPS,
       VIDEO_ES, "8BPS" },
 
+#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(52<<8)+0)
+    { VLC_FOURCC('M','L','2','O'), CODEC_ID_MIMIC,
+      VIDEO_ES, "Mimic" },
+#endif
+
     /* Videogames Codecs */
 
     /* Interplay MVE */
@@ -1529,7 +1541,7 @@ static struct
     { 0, 0, 0, 0 }
 };
 
-int E_(GetFfmpegCodec)( vlc_fourcc_t i_fourcc, int *pi_cat,
+int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
                         int *pi_ffmpeg_codec, const char **ppsz_name )
 {
     int i;
@@ -1548,7 +1560,7 @@ int E_(GetFfmpegCodec)( vlc_fourcc_t i_fourcc, int *pi_cat,
     return false;
 }
 
-int E_(GetVlcFourcc)( int i_ffmpeg_codec, int *pi_cat,
+int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat,
                       vlc_fourcc_t *pi_fourcc, const char **ppsz_name )
 {
     int i;