Commit 11aac010 authored by Antoine Cellerier's avatar Antoine Cellerier

Some more seperation of the different ffmpeg based modules. They're now...

Some more seperation of the different ffmpeg based modules. They're now completely disjoint except for the common chroma.h and fourcc.h headers.
parent f289c1f1
......@@ -4,6 +4,8 @@ SOURCES_avcodec = \
video.c \
audio.c \
deinterlace.c \
fourcc.h \
chroma.h \
$(NULL)
if ENABLE_SOUT
......@@ -18,6 +20,8 @@ SOURCES_avformat = \
avformat.c \
avformat.h \
demux.c \
fourcc.h \
chroma.h \
$(NULL)
if ENABLE_SOUT
......@@ -32,6 +36,7 @@ SOURCES_swscale = \
swscale.c \
swscale.h \
scale.c \
chroma.h \
$(NULL)
SOURCES_imgresample = \
......@@ -39,6 +44,7 @@ SOURCES_imgresample = \
imgresample.h \
chroma.c \
video_filter.c \
chroma.h \
$(NULL)
SOURCES_postproc = \
......
......@@ -43,7 +43,7 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "avcodec.h"
static unsigned int pi_channels_maps[7] =
{
......
This diff is collapsed.
/*****************************************************************************
* ffmpeg.h: decoder using the ffmpeg library
* avcodec.h: decoder and encoder using libavcodec
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* Copyright (C) 2001-2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
......@@ -23,34 +23,8 @@
#include <vlc_codecs.h> /* BITMAPINFOHEADER */
struct picture_t;
struct AVFrame;
struct AVCodecContext;
struct AVCodec;
void InitLibavcodec( vlc_object_t * );
void LibavcodecCallback( void *p_opaque, int i_level,
const char *psz_format, va_list va );
int GetFfmpegCodec ( vlc_fourcc_t, int *, int *, const char ** );
int GetVlcFourcc ( int, int *, vlc_fourcc_t *, const char ** );
int GetFfmpegChroma( vlc_fourcc_t );
vlc_fourcc_t GetVlcChroma( int );
/* Video decoder module */
int InitVideoDec ( decoder_t *, struct AVCodecContext *, struct AVCodec *,
int, const char * );
void EndVideoDec ( decoder_t * );
picture_t * DecodeVideo ( decoder_t *, block_t ** );
/* Audio decoder module */
int InitAudioDec ( decoder_t *, struct AVCodecContext *, struct AVCodec *,
int, const char * );
void EndAudioDec ( decoder_t * );
aout_buffer_t * DecodeAudio ( decoder_t *, block_t ** );
/* Chroma conversion module */
int OpenChroma( vlc_object_t * );
void CloseChroma( vlc_object_t * );
aout_buffer_t * DecodeAudio( decoder_t *, block_t ** );
/* Video encoder module */
int OpenEncoder ( vlc_object_t * );
......@@ -60,28 +34,9 @@ void CloseEncoder( vlc_object_t * );
int OpenAudioEncoder ( vlc_object_t * );
void CloseAudioEncoder( vlc_object_t * );
/* Demux module */
int OpenDemux ( vlc_object_t * );
void CloseDemux( vlc_object_t * );
/* Mux module */
int OpenMux ( vlc_object_t * );
void CloseMux( vlc_object_t * );
/* Video filter module */
int OpenFilter( vlc_object_t * );
int OpenCropPadd( vlc_object_t * );
void CloseFilter( vlc_object_t * );
/* Deinterlace video filter module */
int OpenDeinterlace( vlc_object_t * );
void CloseDeinterlace( vlc_object_t * );
int OpenScaler( vlc_object_t * );
void CloseScaler( vlc_object_t * );
/* Postprocessing module */
void *OpenPostproc( decoder_t *, bool * );
int InitPostproc( void *, int, int, int );
int PostprocPict( void *, picture_t *, struct AVFrame * );
void ClosePostproc( decoder_t *, void * );
/*****************************************************************************
* Module descriptor help strings
......@@ -313,12 +268,6 @@ N_("<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...
"main, low, ssr (not supported) and ltp (default: main)" )
#endif
#define SCALEMODE_TEXT N_("Scaling mode")
#define SCALEMODE_LONGTEXT N_("Scaling mode to use.")
#define MUX_TEXT N_("Ffmpeg mux")
#define MUX_LONGTEXT N_("Force use of ffmpeg muxer.")
#define FFMPEG_COMMON_MEMBERS \
int i_cat; \
int i_codec_id; \
......
This diff is collapsed.
/*****************************************************************************
* avformat.h: muxer and demuxer using libavformat
*****************************************************************************
* Copyright (C) 2001-2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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
* (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.
*
* 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.
*****************************************************************************/
void LibavcodecCallback( void *p_opaque, int i_level,
const char *psz_format, va_list va );
/* Demux module */
int OpenDemux ( vlc_object_t * );
void CloseDemux( vlc_object_t * );
/* Mux module */
int OpenMux ( vlc_object_t * );
void CloseMux( vlc_object_t * );
#define MUX_TEXT N_("Ffmpeg mux")
#define MUX_LONGTEXT N_("Force use of ffmpeg muxer.")
......@@ -42,7 +42,7 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "chroma.h"
static void ChromaConversion( filter_t *, picture_t *, picture_t * );
static picture_t *ChromaConversion_Filter( filter_t *, picture_t * );
......
/*****************************************************************************
* chroma.h: libavutil <-> libvlc conversion routines
*****************************************************************************
* Copyright (C) 1999-2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
*
* 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
* (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.
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Chroma fourcc -> ffmpeg_id mapping
*****************************************************************************/
static struct
{
vlc_fourcc_t i_chroma;
int i_chroma_id;
} chroma_table[] =
{
/* Planar YUV formats */
{ VLC_FOURCC('Y','U','V','A'), PIX_FMT_YUV444P }, /* Hack */
{ VLC_FOURCC('I','4','4','4'), PIX_FMT_YUV444P },
{ VLC_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P },
{ VLC_FOURCC('I','4','2','2'), PIX_FMT_YUV422P },
{ VLC_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P },
{ VLC_FOURCC('I','4','2','0'), PIX_FMT_YUV420P },
{ VLC_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P },
{ VLC_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P },
{ VLC_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P },
{ VLC_FOURCC('I','4','1','1'), PIX_FMT_YUV411P },
{ VLC_FOURCC('I','4','1','0'), PIX_FMT_YUV410P },
{ VLC_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P },
/* Packed YUV formats */
{ VLC_FOURCC('Y','U','Y','2'), PIX_FMT_YUV422 },
{ VLC_FOURCC('Y','U','Y','V'), PIX_FMT_YUV422 },
{ VLC_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422 },
/* Packed RGB formats */
#if defined(WORDS_BIGENDIAN)
{ VLC_FOURCC('R','G','B','8'), PIX_FMT_BGR8 },
{ VLC_FOURCC('R','V','1','5'), PIX_FMT_BGR555 },
{ VLC_FOURCC('R','V','1','6'), PIX_FMT_BGR565 },
{ VLC_FOURCC('R','V','2','4'), PIX_FMT_BGR24 },
#else
#if defined(PIX_FMT_RGB8)
{ VLC_FOURCC('R','G','B','8'), PIX_FMT_RGB8 },
#endif
{ VLC_FOURCC('R','V','1','5'), PIX_FMT_RGB555 },
{ VLC_FOURCC('R','V','1','6'), PIX_FMT_RGB565 },
{ VLC_FOURCC('R','V','2','4'), PIX_FMT_RGB24 },
#endif
{ VLC_FOURCC('R','V','3','2'), PIX_FMT_RGBA32 },
#if defined(PIX_FMT_RGBA)
{ VLC_FOURCC('R','G','B','A'), PIX_FMT_RGBA },
#endif
{ VLC_FOURCC('G','R','E','Y'), PIX_FMT_GRAY8 },
{ 0, 0 }
};
static int GetFfmpegChroma( vlc_fourcc_t i_chroma )
{
int i;
for( i = 0; chroma_table[i].i_chroma != 0; i++ )
{
if( chroma_table[i].i_chroma == i_chroma )
return chroma_table[i].i_chroma_id;
}
return -1;
}
static vlc_fourcc_t GetVlcChroma( int i_ffmpeg_chroma )
{
int i;
for( i = 0; chroma_table[i].i_chroma != 0; i++ )
{
if( chroma_table[i].i_chroma_id == i_ffmpeg_chroma )
return chroma_table[i].i_chroma;
}
return 0;
}
......@@ -43,7 +43,8 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "avcodec.h"
#include "chroma.h"
static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic );
......
......@@ -42,7 +42,8 @@
# include <ffmpeg/avformat.h>
#endif
#include "ffmpeg.h"
#include "fourcc.h"
#include "chroma.h"
//#define AVFORMAT_DEBUG 1
......
......@@ -49,7 +49,9 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "avcodec.h"
#include "chroma.h"
#include "fourcc.h"
#define HURRY_UP_GUARD1 (450000)
#define HURRY_UP_GUARD2 (300000)
......
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* imgresample.h: scaling and chroma conversion using the old libavcodec API
*****************************************************************************
* Copyright (C) 2001-2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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
* (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.
*
* 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.
*****************************************************************************/
/* Chroma conversion module */
int OpenChroma( vlc_object_t * );
void CloseChroma( vlc_object_t * );
/* Video filter module */
int OpenFilter( vlc_object_t * );
int OpenCropPadd( vlc_object_t * ); /* XXX: This could be removed */
void CloseFilter( vlc_object_t * );
......@@ -40,7 +40,8 @@
# include <ffmpeg/avformat.h>
#endif
#include "ffmpeg.h"
#include "avformat.h"
#include "fourcc.h"
//#define AVFORMAT_DEBUG 1
......
......@@ -39,8 +39,6 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#ifdef HAVE_POSTPROC_POSTPROCESS_H
# include <postproc/postprocess.h>
#else
......
......@@ -29,26 +29,16 @@
#endif
#include <vlc_common.h>
#include <vlc_codec.h>
#include <vlc_vout.h>
#include <vlc_filter.h>
/* ffmpeg headers */
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include <libavcodec/avcodec.h>
#elif defined(HAVE_FFMPEG_AVCODEC_H)
# include <ffmpeg/avcodec.h>
#else
# include <avcodec.h>
#endif
#ifdef HAVE_LIBSWSCALE_SWSCALE_H
# include <libswscale/swscale.h>
#elif defined(HAVE_FFMPEG_SWSCALE_H)
# include <ffmpeg/swscale.h>
#endif
#include "ffmpeg.h"
#include "chroma.h"
/* Version checking */
#if LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)
......
This diff is collapsed.
/*****************************************************************************
* swscale.h: scaling and chroma conversion using libswscale
*****************************************************************************
* Copyright (C) 2001-2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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
* (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.
*
* 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.
*****************************************************************************/
int OpenScaler( vlc_object_t * );
void CloseScaler( vlc_object_t * );
#define SCALEMODE_TEXT N_("Scaling mode")
#define SCALEMODE_LONGTEXT N_("Scaling mode to use.")
#define MUX_TEXT N_("Ffmpeg mux")
#define MUX_LONGTEXT N_("Force use of ffmpeg muxer.")
......@@ -43,7 +43,7 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "avcodec.h"
/*****************************************************************************
* decoder_sys_t : decoder descriptor
......
......@@ -43,7 +43,7 @@
# include <avcodec.h>
#endif
#include "ffmpeg.h"
#include "chroma.h"
static int CheckInit( filter_t *p_filter );
static picture_t *Process( filter_t *p_filter, picture_t *p_pic );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment