Changeset 3a49e9f3cae6e766766fbf81ed9239a6e475be7e

Show
Ignore:
Timestamp:
06/03/08 15:19:37 (3 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1212499177 +0200
git-parent:

[11aac010aca2776806eeee5f95fbdf6b87e751be]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1212499177 +0200
Message:

Split should now be complete (postproc still needs to be fixed).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/ffmpeg/Modules.am

    r11aac010 r3a49e9f  
    55    audio.c \ 
    66    deinterlace.c \ 
     7    avutil.h \ 
    78    fourcc.h \ 
    89    chroma.h \ 
     
    2122    avformat.h \ 
    2223    demux.c \ 
     24    avutil.h \ 
    2325    fourcc.h \ 
    2426    chroma.h \ 
  • modules/codec/ffmpeg/avcodec.c

    r11aac010 r3a49e9f  
    5050#include "avcodec.h" 
    5151#include "fourcc.h" 
     52#include "avutil.h" 
    5253 
    5354/***************************************************************************** 
     
    334335} 
    335336 
    336 /***************************************************************************** 
    337  * 
    338  *****************************************************************************/ 
    339 void LibavcodecCallback( void *p_opaque, int i_level, 
    340                              const char *psz_format, va_list va ) 
    341 { 
    342     int i_vlc_level; 
    343     AVCodecContext *p_avctx = (AVCodecContext *)p_opaque; 
    344     AVClass *p_avc; 
    345     vlc_object_t *p_this; 
    346     char *psz_new_format; 
    347     const char *psz_item_name; 
    348  
    349     p_avc = p_avctx ? p_avctx->av_class : 0; 
    350  
    351 #define cln p_avc->class_name 
    352     /* Make sure we can get p_this back */ 
    353     if( !p_avctx || !p_avc || !cln || 
    354         cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' || 
    355         cln[4]!='d' || cln[5]!='e' || cln[6]!='c' ) 
    356     { 
    357         if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va ); 
    358         return; 
    359     } 
    360 #undef cln 
    361  
    362     p_this = (vlc_object_t *)p_avctx->opaque; 
    363  
    364     switch( i_level ) 
    365     { 
    366     case AV_LOG_QUIET: 
    367         i_vlc_level = VLC_MSG_ERR; 
    368         break; 
    369     case AV_LOG_ERROR: 
    370         i_vlc_level = VLC_MSG_WARN; 
    371         break; 
    372     case AV_LOG_INFO: 
    373         i_vlc_level = VLC_MSG_DBG; 
    374         break; 
    375     case AV_LOG_DEBUG: 
    376         /* Print debug messages if they were requested */ 
    377         if( p_avctx->debug ) vfprintf( stderr, psz_format, va ); 
    378         return; 
    379     default: 
    380         return; 
    381     } 
    382  
    383     psz_item_name = p_avc->item_name(p_opaque); 
    384     psz_new_format = malloc( strlen(psz_format) + strlen(psz_item_name) 
    385                               + 18 + 5 ); 
    386     snprintf( psz_new_format, strlen(psz_format) + strlen(psz_item_name) 
    387               + 18 + 5, "%s (%s@%p)", psz_format, p_avc->item_name(p_opaque), p_opaque ); 
    388     msg_GenericVa( p_this, i_vlc_level, 
    389                     MODULE_STRING, psz_new_format, va ); 
    390     free( psz_new_format ); 
    391 } 
    392  
    393337void InitLibavcodec( vlc_object_t *p_object ) 
    394338{ 
     
    401345        avcodec_init(); 
    402346        avcodec_register_all(); 
    403         av_log_set_callback( LibavcodecCallback ); 
     347        av_log_set_callback( LibavutilCallback ); 
    404348        b_ffmpeginit = 1; 
    405349 
  • modules/codec/ffmpeg/avcodec.h

    r11aac010 r3a49e9f  
    2121 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 
    2222 *****************************************************************************/ 
    23  
    24 #include <vlc_codecs.h>                               /* BITMAPINFOHEADER */ 
    2523 
    2624picture_t * DecodeVideo    ( decoder_t *, block_t ** ); 
  • modules/codec/ffmpeg/avformat.c

    r11aac010 r3a49e9f  
    3535 
    3636/* ffmpeg header */ 
    37 #define HAVE_MMX 1 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
    39 #   include <libavcodec/avcodec.h> 
    40 #elif defined(HAVE_FFMPEG_AVCODEC_H) 
    41 #   include <ffmpeg/avcodec.h> 
    42 #else 
    43 #   include <avcodec.h> 
    44 #endif 
    45  
    46 #if LIBAVCODEC_BUILD < 5000 
    47 #   error You must have a libavcodec >= 5000 (get CVS) 
     37#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H 
     38#   include <libavformat/avformat.h> 
     39#elif defined(HAVE_FFMPEG_AVFORMAT_H) 
     40#   include <ffmpeg/avformat.h> 
    4841#endif 
    4942 
     
    7164#endif 
    7265vlc_module_end(); 
    73  
    74 /***************************************************************************** 
    75  * 
    76  *****************************************************************************/ 
    77 void LibavcodecCallback( void *p_opaque, int i_level, 
    78                              const char *psz_format, va_list va ) 
    79 { 
    80     int i_vlc_level; 
    81     AVCodecContext *p_avctx = (AVCodecContext *)p_opaque; 
    82     AVClass *p_avc; 
    83     vlc_object_t *p_this; 
    84     char *psz_new_format; 
    85     const char *psz_item_name; 
    86  
    87     p_avc = p_avctx ? p_avctx->av_class : 0; 
    88  
    89 #define cln p_avc->class_name 
    90     /* Make sure we can get p_this back */ 
    91     if( !p_avctx || !p_avc || !cln || 
    92         cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' || 
    93         cln[4]!='d' || cln[5]!='e' || cln[6]!='c' ) 
    94     { 
    95         if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va ); 
    96         return; 
    97     } 
    98 #undef cln 
    99  
    100     p_this = (vlc_object_t *)p_avctx->opaque; 
    101  
    102     switch( i_level ) 
    103     { 
    104     case AV_LOG_QUIET: 
    105         i_vlc_level = VLC_MSG_ERR; 
    106         break; 
    107     case AV_LOG_ERROR: 
    108         i_vlc_level = VLC_MSG_WARN; 
    109         break; 
    110     case AV_LOG_INFO: 
    111         i_vlc_level = VLC_MSG_DBG; 
    112         break; 
    113     case AV_LOG_DEBUG: 
    114         /* Print debug messages if they were requested */ 
    115         if( p_avctx->debug ) vfprintf( stderr, psz_format, va ); 
    116         return; 
    117     default: 
    118         return; 
    119     } 
    120  
    121     psz_item_name = p_avc->item_name(p_opaque); 
    122     psz_new_format = malloc( strlen(psz_format) + strlen(psz_item_name) 
    123                               + 18 + 5 ); 
    124     snprintf( psz_new_format, strlen(psz_format) + strlen(psz_item_name) 
    125               + 18 + 5, "%s (%s@%p)", psz_format, p_avc->item_name(p_opaque), p_opaque ); 
    126     msg_GenericVa( p_this, i_vlc_level, 
    127                     MODULE_STRING, psz_new_format, va ); 
    128     free( psz_new_format ); 
    129 } 
    130  
    131 void InitLibavcodec( vlc_object_t *p_object ) 
    132 { 
    133     static int b_ffmpeginit = 0; 
    134     vlc_mutex_t *lock = var_AcquireMutex( "avcodec" ); 
    135  
    136     /* *** init ffmpeg library (libavcodec) *** */ 
    137     if( !b_ffmpeginit ) 
    138     { 
    139         avcodec_init(); 
    140         avcodec_register_all(); 
    141         av_log_set_callback( LibavcodecCallback ); 
    142         b_ffmpeginit = 1; 
    143  
    144         msg_Dbg( p_object, "libavcodec initialized (interface %d )", 
    145                  LIBAVCODEC_VERSION_INT ); 
    146     } 
    147     else 
    148     { 
    149         msg_Dbg( p_object, "libavcodec already initialized" ); 
    150     } 
    151  
    152     vlc_mutex_unlock( lock ); 
    153 } 
  • modules/codec/ffmpeg/imgresample.c

    r11aac010 r3a49e9f  
    11/***************************************************************************** 
    2  * ffmpeg.c: video decoder using ffmpeg library 
     2 * imageresample.c: scaling and chroma conversion using the old libavcodec API 
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 the VideoLAN team 
     
    3434#include <vlc_codec.h> 
    3535 
    36 /* ffmpeg header */ 
    37 #define HAVE_MMX 1 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
    39 #   include <libavcodec/avcodec.h> 
    40 #elif defined(HAVE_FFMPEG_AVCODEC_H) 
    41 #   include <ffmpeg/avcodec.h> 
    42 #else 
    43 #   include <avcodec.h> 
    44 #endif 
    45  
    46 #if LIBAVCODEC_BUILD < 5000 
    47 #   error You must have a libavcodec >= 5000 (get CVS) 
    48 #endif 
    49  
    5036#include "imgresample.h" 
    51  
    52 /**************************************************************************** 
    53  * Local prototypes 
    54  ****************************************************************************/ 
    55 static const int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; 
    56 static const char *const ppsz_mode_descriptions[] = 
    57 { N_("Fast bilinear"), N_("Bilinear"), N_("Bicubic (good quality)"), 
    58   N_("Experimental"), N_("Nearest neighbour (bad quality)"), 
    59   N_("Area"), N_("Luma bicubic / chroma bilinear"), N_("Gauss"), 
    60   N_("SincR"), N_("Lanczos"), N_("Bicubic spline") }; 
    6137 
    6238/***************************************************************************** 
  • modules/codec/ffmpeg/mux.c

    r11aac010 r3a49e9f  
    4343#include "avformat.h" 
    4444#include "fourcc.h" 
     45#include "avutil.h" 
    4546 
    4647//#define AVFORMAT_DEBUG 1 
    47  
    48 /* Version checking */ 
    49 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_FFMPEG_AVFORMAT_H) 
    5048 
    5149static const char *const ppsz_mux_options[] = { 
     
    9694    /* Should we call it only once ? */ 
    9795    av_register_all(); 
    98     av_log_set_callback( LibavcodecCallback ); 
     96    av_log_set_callback( LibavutilCallback ); 
    9997 
    10098    config_ChainParse( p_mux, "ffmpeg-", ppsz_mux_options, p_mux->p_cfg ); 
     
    225223    codec = stream->codec; 
    226224 
    227     /* This is used by LibavcodecCallback (ffmpeg.c) to print messages */ 
     225    /* This is used by LibavutilCallback (avutil.h) to print messages */ 
    228226    codec->opaque = (void*)p_mux; 
    229227 
     
    506504    return 0; 
    507505} 
    508  
    509 #endif /* HAVE_FFMPEG_AVFORMAT_H */ 
  • modules/codec/ffmpeg/swscale.c

    r11aac010 r3a49e9f  
    3939 ****************************************************************************/ 
    4040static const int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; 
    41 static const char *const ppsz_mode_descriptions[] = 
     41const char *const ppsz_mode_descriptions[] = 
    4242{ N_("Fast bilinear"), N_("Bilinear"), N_("Bicubic (good quality)"), 
    4343  N_("Experimental"), N_("Nearest neighbour (bad quality)"), 
  • modules/codec/ffmpeg/video.c

    r11aac010 r3a49e9f  
    3434#include <vlc_vout.h> 
    3535#include <vlc_input.h>                  /* hmmm, just for INPUT_RATE_DEFAULT */ 
     36#include <vlc_codecs.h>                               /* BITMAPINFOHEADER */ 
    3637 
    3738/* ffmpeg header */