arch build fixes (ffmpeg-compat)

some bugfixes
removed changelog from PKGBUILD
bumped version
This commit is contained in:
niels
2014-02-01 17:45:23 +01:00
parent 4259f319f9
commit e649dfb5a8
18 changed files with 188 additions and 75 deletions

View File

@@ -10,10 +10,9 @@ license=('GPL')
groups=() groups=()
conflicts=('veejay') conflicts=('veejay')
depends=('libxml2' 'ffmpeg' 'ffmpeg-compat' 'sdl' 'gtk2' 'gdk-pixbuf2' 'libsm' ) depends=('libxml2' 'ffmpeg' 'ffmpeg-compat' 'sdl' 'gtk2' 'gdk-pixbuf2' 'libsm' )
optdepends=('unicap' 'liblo' 'libdv' 'libquicktime' 'jack') optdepends=('liblo' 'libdv' 'libquicktime' 'jack')
source=() source=()
md5sums=() md5sums=()
changelog=()
backup=() backup=()
replaces=() replaces=()

View File

@@ -32,6 +32,13 @@ While playing, you can record the resulting video directly to disk (video sampli
====== quick install: ====== quick install:
check that PKG_CONFIG_PATH is set:
echo $PKG_CONFIG_PATH
on some distributions, like Arch, you need to install ffmpeg-compat
and set PKG_CONFIG_PATH to first include /usr/lib/ffmpeg-compat/pkg-config
follow by the other directories that contain .pc files.
order of packages: order of packages:
veejay-server, veejay-client, veejay-utils veejay-server, veejay-client, veejay-utils

View File

@@ -1,12 +1,12 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl AC_INIT dnl AC_INIT
AC_INIT([veejay],[1.5.30],[http://www.veejayhq.net]) AC_INIT([veejay],[1.5.31],[http://www.veejayhq.net])
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([veejay/veejay.c]) AC_CONFIG_SRCDIR([veejay/veejay.c])
VEEJAY_MAJOR_VERSION=1 VEEJAY_MAJOR_VERSION=1
VEEJAY_MINOR_VERSION=5 VEEJAY_MINOR_VERSION=5
VEEJAY_MICRO_VERSION=30 VEEJAY_MICRO_VERSION=31
VEEJAY_VERSION=$VEEJAY_MAJOR_VERSION.$VEEJAY_MINOR_VERSION.$VEEJAY_MICRO_VERSION VEEJAY_VERSION=$VEEJAY_MAJOR_VERSION.$VEEJAY_MINOR_VERSION.$VEEJAY_MICRO_VERSION
VEEJAY_CODENAME="Veejay Classic - build $VEEJAY_MINOR_VERSION $VEEJAY_MICRO_VERSION" VEEJAY_CODENAME="Veejay Classic - build $VEEJAY_MINOR_VERSION $VEEJAY_MICRO_VERSION"
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@@ -553,9 +553,9 @@ AC_MSG_RESULT($CFLAGS)
AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED,, AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED,,
[Defined if building against uninstalled FFmpeg source]) [Defined if building against uninstalled FFmpeg source])
PKG_CHECK_MODULES(LIBAVUTIL, [libavutil >= 49.7.0],have_avutil=true,have_avutil=false) PKG_CHECK_MODULES(LIBAVUTIL, [libavutil >= 49.7.0 libavutil < 52.48],have_avutil=true,have_avutil=false)
PKG_CHECK_MODULES(LIBAVCODEC,[libavcodec >= 51.57.2],have_avcodec=true,have_avcodec=false) PKG_CHECK_MODULES(LIBAVCODEC,[libavcodec >= 51.35.2 libavcodec < 55.39],have_avcodec=true,have_avcodec=false)
PKG_CHECK_MODULES(LIBAVFORMAT,[libavformat >= 52.14.0],have_avformat=true,have_avformat=false) PKG_CHECK_MODULES(LIBAVFORMAT,[libavformat >= 52.14.0 libavformat < 55.19],have_avformat=true,have_avformat=false)
PKG_CHECK_MODULES(LIBSWSCALE,[libswscale >= 0.7.1],have_swscale=true,have_swscale=false) PKG_CHECK_MODULES(LIBSWSCALE,[libswscale >= 0.7.1],have_swscale=true,have_swscale=false)
if test x$have_swscale = xfalse; if test x$have_swscale = xfalse;
then then
@@ -571,7 +571,7 @@ then
fi fi
if test x$have_avcodec = xfalse; if test x$have_avcodec = xfalse;
then then
AC_MSG_ERROR([libavcodec not found.]) AC_MSG_ERROR([libavcodec >= 51.57 not found.])
fi fi
FFMPEG_CFLAGS="${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${LIBAVUTIL_CFLAGS} ${LIBSWSCALE_CFLAGS}" FFMPEG_CFLAGS="${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${LIBAVUTIL_CFLAGS} ${LIBSWSCALE_CFLAGS}"
@@ -903,28 +903,42 @@ fi
have_freetype=false have_freetype=false
have_freetype2=false
PKG_CHECK_MODULES( FREETYPE2, [freetype2], [
AC_SUBST(FREETYPE2_CFLAGS)
AC_SUBST(FREETYPE2_LIBS)
AC_DEFINE(HAVE_FREETYPE,,[compiling with freetype])
have_freetype2=true],
[have_freetype2=false] )
if test x$have_freetype2 != xtrue; then
AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config,yes,no) AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config,yes,no)
if test $FREETYPE_CONFIG = yes; then if test $FREETYPE_CONFIG = yes; then
FT_CFLAGS="`freetype-config --cflags`" FREETYPE_CFLAGS="`freetype-config --cflags`"
FT_WORD="`freetype-config --libs`" FREETYPE_WORD="`freetype-config --libs`"
FT_LDFLAGS="" FREETYPE_LIBS=""
FT_LIBS="" for word in $FREETYPE_WORD; do
for word in $FT_WORD ; do
beginning=`echo $word |cut -c -2` beginning=`echo $word |cut -c -2`
if test ".$beginning" = ".-L"; then if test ".$beginning" = ".-L"; then
FT_LDFLAGS="$FT_LDFLAGS $word" FREETYPE_LDFLAGS="$FREETYPE_LDFLAGS $word"
else else
FT_LIBS="$FT_LIBS $word" FREETYPE_LIBS="$FREETYPE_LIBS $word"
fi fi
done done
AC_DEFINE(HAVE_FREETYPE,,[Compiling with FreeType]) AC_DEFINE(HAVE_FREETYPE,,[compiling with freetype])
AC_SUBST(FT_LIBS) AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FT_LDFLAGS) AC_SUBST(FREETYPE_LDFLAGS)
AC_SUBST(FT_CFLAGS) AC_SUBST(FREETYPE_CFLAGS)
have_freetype=true have_freetype=true
AC_MSG_NOTICE([Compiling with FreeType])
else else
AC_MSG_ERROR([Cannot find the freetype-config program]) AC_MSG_ERROR([Cannot find the freetype-config program])
fi fi
else
AC_MSG_NOTICE([Compiling with FreeType2])
fi
dnl ********************************************************************** dnl **********************************************************************
dnl All the conditional stuff for the Makefiles dnl All the conditional stuff for the Makefiles
@@ -953,6 +967,7 @@ AM_CONDITIONAL(SUPPORT_READ_DV2, test x$have_libdv = xtrue)
AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue) AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue)
AM_CONDITIONAL(HAVE_JPEG,test x$have_jpeg = xtrue) AM_CONDITIONAL(HAVE_JPEG,test x$have_jpeg = xtrue)
AM_CONDITIONAL(HAVE_LIBLO,test x$have_liblo = xtrue) AM_CONDITIONAL(HAVE_LIBLO,test x$have_liblo = xtrue)
AM_CONDITIONAL(HAVE_FREETYPE2, test x$have_freetype2 = xtrue)
dnl ********************************************************************* dnl *********************************************************************
dnl Check for what warnings we want gcc to use and adjust the CFLAGS dnl Check for what warnings we want gcc to use and adjust the CFLAGS
dnl as needed. This only works for GCC. dnl as needed. This only works for GCC.
@@ -1100,7 +1115,15 @@ AC_MSG_NOTICE([ - FFmpeg AVCodec : ${have_avcodec} ])
AC_MSG_NOTICE([ - FFmpeg Swscaler : ${have_swscale} ]) AC_MSG_NOTICE([ - FFmpeg Swscaler : ${have_swscale} ])
AC_MSG_NOTICE([ - FFmpeg avutil : ${have_avutil} ]) AC_MSG_NOTICE([ - FFmpeg avutil : ${have_avutil} ])
AC_MSG_NOTICE([ - SDL support : ${have_sdl}]) AC_MSG_NOTICE([ - SDL support : ${have_sdl}])
if test "$have_freetype" = "true"; then
AC_MSG_NOTICE([ - Freetype support : ${have_freetype}]) AC_MSG_NOTICE([ - Freetype support : ${have_freetype}])
fi
if test "$have_freetype2" = "true"; then
AC_MSG_NOTICE([ - FreeType 2 support : ${have_freetype2}])
fi
AC_MSG_NOTICE([ - XML c library for Gnome : ${have_xml2}]) AC_MSG_NOTICE([ - XML c library for Gnome : ${have_xml2}])
AC_MSG_NOTICE([ - JPEG support : ${have_jpeg} ]) AC_MSG_NOTICE([ - JPEG support : ${have_jpeg} ])
AC_MSG_NOTICE([ - GDK Pixbuf support : ${have_pixbuf}]) AC_MSG_NOTICE([ - GDK Pixbuf support : ${have_pixbuf}])

View File

@@ -189,7 +189,12 @@ static vj_encoder *vj_avcodec_new_encoder( int id, editlist *el, char *filename)
if(id != CODEC_ID_DVVIDEO ) if(id != CODEC_ID_DVVIDEO )
{ {
#endif #endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
e->context = avcodec_alloc_context(); e->context = avcodec_alloc_context();
#else
e->context = avcodec_alloc_context3(e->codec);
#endif
e->context->bit_rate = 2750 * 1024; e->context->bit_rate = 2750 * 1024;
e->context->width = el->video_width; e->context->width = el->video_width;
e->context->height = el->video_height; e->context->height = el->video_height;
@@ -217,7 +222,11 @@ static vj_encoder *vj_avcodec_new_encoder( int id, editlist *el, char *filename)
char *descr = vj_avcodec_get_codec_name( id ); char *descr = vj_avcodec_get_codec_name( id );
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
if ( avcodec_open( e->context, e->codec ) < 0 ) if ( avcodec_open( e->context, e->codec ) < 0 )
#else
if ( avcodec_open2( e->context, e->codec, NULL ) < 0 )
#endif
{ {
veejay_msg(VEEJAY_MSG_ERROR, "Cannot open codec '%s'" , descr ); veejay_msg(VEEJAY_MSG_ERROR, "Cannot open codec '%s'" , descr );
if(e->context) free(e->context); if(e->context) free(e->context);
@@ -465,8 +474,12 @@ int vj_avcodec_init( int pixel_format, int verbose)
#else #else
av_log_set_level( AV_LOG_VERBOSE ); av_log_set_level( AV_LOG_VERBOSE );
#endif #endif
av_register_all();
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avcodec_register_all();
#else
av_register_all();
#endif
return 1; return 1;
} }
@@ -658,6 +671,6 @@ int vj_avcodec_encode_audio( void *encoder, int format, uint8_t *src, uint8_t *
if(format == ENCODER_YUV420 || ENCODER_YUV422 == format) if(format == ENCODER_YUV420 || ENCODER_YUV422 == format)
return 0; return 0;
vj_encoder *av = encoder; vj_encoder *av = encoder;
int ret = avcodec_encode_audio( av->context, src, len, nsamples ); int ret = avcodec_encode_audio( av->context, dst, len, (const short*) src );
return ret; return ret;
} }

View File

@@ -240,8 +240,12 @@ static const char *el_pixfmt_str(int i)
void free_av_packet( AVPacket *pkt ) void free_av_packet( AVPacket *pkt )
{ {
if( pkt ) { if( pkt ) {
if( pkt->destruct ) #if (LIBAVFORMAT_VERSION_MAJOR <= 53)
pkt->destruct(pkt); // av_destruct_packet(pkt);
#else
// if( pkt->destruct )
// pkt->destruct(pkt);
#endif
pkt->data = NULL; pkt->data = NULL;
pkt->size = 0; pkt->size = 0;
} }
@@ -484,7 +488,7 @@ vj_decoder *_el_new_decoder( int id , int width, int height, float fps, int pixe
} else if( id != CODEC_ID_YUV422 && id != CODEC_ID_YUV420 && id != CODEC_ID_YUV420F && id != CODEC_ID_YUV422F) } else if( id != CODEC_ID_YUV422 && id != CODEC_ID_YUV420 && id != CODEC_ID_YUV420F && id != CODEC_ID_YUV422F)
{ {
d->codec = avcodec_find_decoder( id ); d->codec = avcodec_find_decoder( id );
#if (LIBAVFORMAT_VERSION_MAJOR >= 53) #if (LIBAVFORMAT_VERSION_MAJOR <= 53)
d->context = avcodec_alloc_context3(NULL); /* stripe was here! */ d->context = avcodec_alloc_context3(NULL); /* stripe was here! */
#else #else
d->context = avcodec_alloc_context(); d->context = avcodec_alloc_context();
@@ -502,7 +506,11 @@ vj_decoder *_el_new_decoder( int id , int width, int height, float fps, int pixe
d->context->thread_type = FF_THREAD_FRAME; d->context->thread_type = FF_THREAD_FRAME;
d->context->thread_count = tc; d->context->thread_count = tc;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
if ( avcodec_open( d->context, d->codec ) < 0 ) if ( avcodec_open( d->context, d->codec ) < 0 )
#else
if ( avcodec_open2( d->context, d->codec, NULL ) < 0 )
#endif
{ {
veejay_msg(VEEJAY_MSG_ERROR, "Error initializing decoder %d",id); veejay_msg(VEEJAY_MSG_ERROR, "Error initializing decoder %d",id);
_el_free_decoder( d ); _el_free_decoder( d );
@@ -1092,7 +1100,7 @@ int vj_el_set_bogus_length( editlist *el, long nframe, int len )
return 1; return 1;
} }
#if (LIBAVFORMAT_VERSION_MAJOR >= 53) #if (LIBAVFORMAT_VERSION_MAJOR <= 53)
static int avcodec_decode_video( AVCodecContext *avctx, AVFrame *picture, int *got_picture, uint8_t *data, int pktsize ) { static int avcodec_decode_video( AVCodecContext *avctx, AVFrame *picture, int *got_picture, uint8_t *data, int pktsize ) {
AVPacket pkt; AVPacket pkt;
veejay_memset( &pkt, 0, sizeof(AVPacket)); veejay_memset( &pkt, 0, sizeof(AVPacket));
@@ -1307,6 +1315,7 @@ int vj_el_get_video_frame(editlist *el, long nframe, uint8_t *dst[3])
pict2.linesize[1] = el->video_width >> 1; pict2.linesize[1] = el->video_width >> 1;
pict2.linesize[2] = el->video_width >> 1; pict2.linesize[2] = el->video_width >> 1;
pict2.linesize[0] = el->video_width; pict2.linesize[0] = el->video_width;
avpicture_deinterlace( avpicture_deinterlace(
&pict2, &pict2,
(const AVPicture*) d->frame, (const AVPicture*) d->frame,
@@ -1382,7 +1391,7 @@ int detect_pixel_format_with_ffmpeg( const char *filename )
AVInputFormat *av_input_format = NULL; AVInputFormat *av_input_format = NULL;
AVFrame *av_frame = NULL; AVFrame *av_frame = NULL;
AVPacket pkt; AVPacket pkt;
#if (LIBAVFORMAT_VERSION_MAJOR >= 53) #if (LIBAVFORMAT_VERSION_MAJOR <= 53)
int err = avformat_open_input( &avformat_ctx, filename, NULL, NULL ); int err = avformat_open_input( &avformat_ctx, filename, NULL, NULL );
#else #else
int err = av_open_input_file( &avformat_ctx,filename,NULL,0,NULL ); int err = av_open_input_file( &avformat_ctx,filename,NULL,0,NULL );
@@ -1392,30 +1401,55 @@ int detect_pixel_format_with_ffmpeg( const char *filename )
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to open %s: %d",filename,err ); veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to open %s: %d",filename,err );
return -1; return -1;
} }
#if (LIBAVFORMAT_VERSION_MAJOR >= 53 )
#if (LIBAVFORMAT_VERSION_MAJOR <= 53 )
err = avformat_find_stream_info( avformat_ctx, NULL ); err = avformat_find_stream_info( avformat_ctx, NULL );
#else #else
err = av_find_stream_info( avformat_ctx ); err = av_find_stream_info( avformat_ctx );
#endif #endif
#ifdef STRICT_CHECKING
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
av_dump_format( avformat_ctx,0,filename,0 );
#endif
#endif
if( err > 0 ) {
char buf[1024];
av_strerror( err, buf, sizeof(buf)-1);
veejay_msg(VEEJAY_MSG_DEBUG, "%s" , buf );
}
if(err < 0 ) if(err < 0 )
{ {
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Stream information found in %s",filename); veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Stream information found in %s",filename);
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
return -1; return -1;
} }
av_read_play(avformat_ctx);
int i,j; unsigned int i,j;
int n = avformat_ctx->nb_streams; unsigned int n = avformat_ctx->nb_streams;
int vi = -1; int vi = -1;
int pix_fmt = -1; int pix_fmt = -1;
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: File has %d %s", n, ( n == 1 ? "stream" : "streams") ); veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: File has %d %s", n, ( n == 1 ? "stream" : "streams") );
if( n > 65535 ) {
veejay_msg(VEEJAY_MSG_WARNING, "FFmpeg: Probably doesn't work, got garbage from open_input." );
veejay_msg(VEEJAY_MSG_WARNING, "Build veejay with an older ffmpeg (for example, FFmpeg 0.8.15 \"Love\")");
return -1;
}
for( i=0; i < n; i ++ ) for( i=0; i < n; i ++ )
{ {
if( avformat_ctx->streams[i]->codec ) if( avformat_ctx->streams[i]->codec )
{ {
#if (LIBAVFORMAT_VERSION_MAJOR >= 53) #if (LIBAVFORMAT_VERSION_MAJOR <= 53)
#if (LIBAVFORMAT_VERSION_MINOR <= 5 ) #if (LIBAVFORMAT_VERSION_MINOR <= 5 )
if( avformat_ctx->streams[i]->codec->codec_type < CODEC_ID_MP2 ) if( avformat_ctx->streams[i]->codec->codec_type < CODEC_ID_MP2 )
#else #else
@@ -1436,7 +1470,12 @@ further:
if( !sup_codec ) { if( !sup_codec ) {
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unrecognized file %s", veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unrecognized file %s",
avformat_ctx->streams[i]->codec->codec_name ); avformat_ctx->streams[i]->codec->codec_name );
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
return -1; return -1;
} }
codec = avcodec_find_decoder( avformat_ctx->streams[i]->codec->codec_id ); codec = avcodec_find_decoder( avformat_ctx->streams[i]->codec->codec_id );
@@ -1444,7 +1483,11 @@ further:
{ {
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to find decoder for codec %s", veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to find decoder for codec %s",
avformat_ctx->streams[i]->codec->codec_name); avformat_ctx->streams[i]->codec->codec_name);
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
return -1; return -1;
} }
vi = i; vi = i;
@@ -1455,13 +1498,21 @@ further:
if( vi == -1 ) { if( vi == -1 ) {
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: No video streams found"); veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: No video streams found");
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
return -1; return -1;
} }
codec_ctx = avformat_ctx->streams[vi]->codec; codec_ctx = avformat_ctx->streams[vi]->codec;
avformat_stream=avformat_ctx->streams[vi]; avformat_stream=avformat_ctx->streams[vi];
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
if ( avcodec_open( codec_ctx, codec ) < 0 ) { if ( avcodec_open( codec_ctx, codec ) < 0 ) {
#else
if ( avcodec_open2( codec_ctx, codec, NULL ) < 0 ) {
#endif
veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to open %s decoder (codec %x)", veejay_msg(VEEJAY_MSG_DEBUG, "FFmpeg: Unable to open %s decoder (codec %x)",
codec_ctx->codec_name, codec_ctx->codec_id); codec_ctx->codec_name, codec_ctx->codec_id);
return -1; return -1;
@@ -1485,7 +1536,11 @@ further:
av_free(f); av_free(f);
free_av_packet(&pkt); free_av_packet(&pkt);
avcodec_close( codec_ctx ); avcodec_close( codec_ctx );
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
return -1; return -1;
} }
@@ -1497,7 +1552,11 @@ further:
free_av_packet(&pkt); free_av_packet(&pkt);
avcodec_close( codec_ctx ); avcodec_close( codec_ctx );
#if (LIBAVFORMAT_VERSION_MAJOR <= 53)
avformat_close_input(&avformat_ctx);
#else
av_close_input_file( avformat_ctx ); av_close_input_file( avformat_ctx );
#endif
av_free(f); av_free(f);
return pix_fmt; return pix_fmt;

View File

@@ -39,8 +39,8 @@ void mmap_free(mmap_region_t *map)
mmap_region_t * mmap_file(int fd, int offset, int length, int fs) mmap_region_t * mmap_file(int fd, int offset, int length, int fs)
{ {
mmap_region_t *map = (mmap_region_t*) malloc(sizeof( mmap_region_t )); mmap_region_t *map = (mmap_region_t*) vj_malloc(sizeof( mmap_region_t ));
memset( map, 0, sizeof( mmap_region_t )); veejay_memset( map, 0, sizeof( mmap_region_t ));
map->fd = fd; map->fd = fd;
map->page_size = getpagesize(); map->page_size = getpagesize();

View File

@@ -73,6 +73,9 @@ static void *yuv_conv_ = NULL;
#define FF_CAP_V_BITS_VIDEO FF_CAP_16BITVIDEO #define FF_CAP_V_BITS_VIDEO FF_CAP_16BITVIDEO
#endif*/ #endif*/
static void freeframe_copy_parameters( void *srcPort, void *dst, int n_params );
void freeframe_destroy( ) { void freeframe_destroy( ) {
int i; int i;
yuv_free_swscaler( rgb_conv_ ); yuv_free_swscaler( rgb_conv_ );
@@ -632,7 +635,7 @@ void freeframe_plug_param_f( void *plugin, int seq_no, void *dargs )
void freeframe_copy_parameters( void *srcPort, void *dst, int n_params ) static void freeframe_copy_parameters( void *srcPort, void *dst, int n_params )
{ {
int p; int p;
for( p = 0; p < n_params; p ++ ) { for( p = 0; p < n_params; p ++ ) {

View File

@@ -563,8 +563,11 @@ static int v4l2_setup_avcodec_capture( v4l2info *v, int wid, int hei, int codec_
veejay_msg(0, "v4l2: (untested) Codec not found."); veejay_msg(0, "v4l2: (untested) Codec not found.");
return 0; return 0;
} }
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
v->c = avcodec_alloc_context(); v->c = avcodec_alloc_context();
#else
v->c = avcodec_alloc_context3(v->codec);
#endif
v->c->width= wid; v->c->width= wid;
v->c->height= hei; v->c->height= hei;
v->picture = avcodec_alloc_frame(); v->picture = avcodec_alloc_frame();
@@ -577,8 +580,11 @@ static int v4l2_setup_avcodec_capture( v4l2info *v, int wid, int hei, int codec_
if( v->codec->capabilities & CODEC_CAP_TRUNCATED) if( v->codec->capabilities & CODEC_CAP_TRUNCATED)
v->c->flags |= CODEC_FLAG_TRUNCATED; v->c->flags |= CODEC_FLAG_TRUNCATED;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0)
if( avcodec_open( v->c, v->codec ) < 0 ) if( avcodec_open( v->c, v->codec ) < 0 )
#else
if( avcodec_open2( v->c, v->codec, NULL ) < 0 )
#endif
{ {
veejay_msg(0, "v4l2: (untested) Error opening codec"); veejay_msg(0, "v4l2: (untested) Error opening codec");
free(v->picture->data[0]); free(v->picture->data[0]);
@@ -1387,7 +1393,7 @@ void v4l2_close( void *d )
} }
if(v->codec) { if(v->codec) {
avcodec_close(v->codec); avcodec_close(v->c);
v->codec = NULL; v->codec = NULL;
} }

View File

@@ -173,7 +173,7 @@ void ripple_apply(VJFrame *frame, int width, int height, int _w, int _a , int _a
sx = (int) (x+z * ripple_cos[a]); sx = (int) (x+z * ripple_cos[a]);
sy = (int) (y+z * ripple_sin[a]); sy = (int) (y+z * ripple_sin[a]);
if(sy > (height-1)) sy = height-1; if(sy >= (height-1)) sy = height-1;
if(sx > width) sx = width; if(sx > width) sx = width;
if(sx < 0) sx =0; if(sx < 0) sx =0;
if(sy < 0) sy =0; if(sy < 0) sy =0;

View File

@@ -100,7 +100,7 @@ void store_frame(VJFrame *src, int w, int h, int n, int no_reverse)
if (!nreverse) { if (!nreverse) {
vj_frame_copy( src->data, dest, strides ); vj_frame_copy( src->data, dest, strides );
} else { } else {
vj_frame_copy( dest, src, strides ); vj_frame_copy( dest, src->data, strides );
} }
if (nreverse) if (nreverse)

View File

@@ -160,7 +160,7 @@ static void mmx_blur(uint8_t *buffer, int width, int height)
// : "mm0", "mm1", "mm2", "mm3", "mm6"); // : "mm0", "mm1", "mm2", "mm3", "mm6");
} }
len = (width*height)-1; len = (width*height)-4;
for (i = len; i > scrsh; i -= 4) { for (i = len; i > scrsh; i -= 4) {
__asm __volatile __asm __volatile

View File

@@ -1195,7 +1195,7 @@ static void vj_frame_copy_job( void *arg ) {
assert( info->input[i] != NULL ); assert( info->input[i] != NULL );
} }
#endif #endif
if( info->strides[i] == 0 || info->output[i] == NULL || info->output[i] == NULL ) if( info->strides[i] <= 0 || info->output[i] == NULL || info->output[i] == NULL )
continue; continue;
veejay_memcpy( info->output[i], info->input[i], info->strides[i] ); veejay_memcpy( info->output[i], info->input[i], info->strides[i] );
} }

View File

@@ -41,7 +41,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/signal.h> #include <sys/signal.h>
#include <sys/ucontext.h> #include <sys/ucontext.h>
#include <execinfo.h>
#include <unistd.h> #include <unistd.h>
#include <libgen.h> #include <libgen.h>

View File

@@ -929,11 +929,11 @@ void chroma_subsample(subsample_mode_t mode, VJFrame *frame, uint8_t *ycbcr[] )
void chroma_supersample(subsample_mode_t mode,VJFrame *frame, uint8_t *ycbcr[] ) void chroma_supersample(subsample_mode_t mode,VJFrame *frame, uint8_t *ycbcr[] )
{ {
if( vj_task_available() ) { if( vj_task_available() ) {
void *data = vj_task_alloc_internal_buf( frame->uv_len * 2 ); //@ 4:2:2 void *data = vj_task_alloc_internal_buf( frame->uv_len * 4 ); //@ 4:2:2
uint8_t *plane = (uint8_t*) data; uint8_t *plane = (uint8_t*) data;
uint8_t *vplane = plane + frame->uv_len; uint8_t *vplane = plane + frame->uv_len;
uint8_t *planes[3] = { NULL, plane,vplane }; uint8_t *planes[4] = { NULL, plane,vplane,NULL };
int strides[4] = { 0, frame->uv_len, frame->uv_len, 0 }; int strides[4] = { 0, frame->uv_len, frame->uv_len, 0 };
vj_frame_copy( ycbcr, planes,strides); vj_frame_copy( ycbcr, planes,strides);
vj_task_set_sampling ( 1 ); vj_task_set_sampling ( 1 );

View File

@@ -617,7 +617,7 @@ void yuv_convert_any3( void *scaler, VJFrame *src, int src_stride[3], VJFrame *d
{ {
veejay_msg(0,"sws_getContext failed."); veejay_msg(0,"sws_getContext failed.");
if(s)free(s); if(s)free(s);
return NULL; return;
} }
/* /*
struct SwsContext *ctx = sws_getContext( struct SwsContext *ctx = sws_getContext(
@@ -1272,10 +1272,8 @@ void yuv_convert_and_scale_rgb(void *sws , VJFrame *src, VJFrame *dst)
void yuv_convert_and_scale(void *sws , VJFrame *src, VJFrame *dst) void yuv_convert_and_scale(void *sws , VJFrame *src, VJFrame *dst)
{ {
vj_sws *s = (vj_sws*) sws; vj_sws *s = (vj_sws*) sws;
int src_stride[3] = { src->width,0,0 };
int src_stride[3]; int dst_stride[3] = { dst->width,0,0 };
int dst_stride[3];
/* /*
int n = 0; int n = 0;
if( src->format == PIX_FMT_RGBA || src->format == PIX_FMT_BGRA || src->format == PIX_FMT_ARGB || if( src->format == PIX_FMT_RGBA || src->format == PIX_FMT_BGRA || src->format == PIX_FMT_ARGB ||

View File

@@ -19,7 +19,7 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) \
-I$(top_srcdir)/libvevo \ -I$(top_srcdir)/libvevo \
-I$(top_srcdir)/liblzo \ -I$(top_srcdir)/liblzo \
-I$(top_srcdir)/bio2jack \ -I$(top_srcdir)/bio2jack \
$(FFMPEG_CFLAGS) $(LIBQUICKTIME_CFLAGS) $(FT_CFLAGS) \ $(FFMPEG_CFLAGS) $(LIBQUICKTIME_CFLAGS) $(FREETYPE_CFLAGS) $(FREETYPE2_CFLAGS) \
$(AVIPLAY_CFLAGS) $(XML2_CFLAGS) $(GTK_CFLAGS) $(DV_FLAGS) $(X_CFLAGS) $(LIBLO_CFLAGS) \ $(AVIPLAY_CFLAGS) $(XML2_CFLAGS) $(GTK_CFLAGS) $(DV_FLAGS) $(X_CFLAGS) $(LIBLO_CFLAGS) \
$(DIRECTFB_CFLAGS) $(SDL_CFLAGS) $(JPEG_CFLAGS) $(JACK_CFLAGS) $(PTHREAD_CFLAGS) $(DIRECTFB_CFLAGS) $(SDL_CFLAGS) $(JPEG_CFLAGS) $(JACK_CFLAGS) $(PTHREAD_CFLAGS)
@@ -56,7 +56,7 @@ libveejay_la_LIBADD = -L$(top_builddir)/mjpegtools/ -lmjpegutils \
-L$(top_builddir)/libsamplerec -lsamplerec \ -L$(top_builddir)/libsamplerec -lsamplerec \
-L$(top_builddir)/libvevo -lvevo -L$(top_builddir)/libvevo -lvevo
libveejay_la_LDFLAGS += $(SDL_LIBS) $(DIRECTFB_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(FT_LDFLAGS) $(FT_LIBS) \ libveejay_la_LDFLAGS += $(SDL_LIBS) $(DIRECTFB_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(FT_LDFLAGS) $(FREETYPE_LIBS) $(FREETYPE2_LIBS) \
$(XML2_LIBS) $(JPEG_LIBS) $(LIBLO_LIBS) \ $(XML2_LIBS) $(JPEG_LIBS) $(LIBLO_LIBS) \
$(FFMPEG_LIBS) $(XINERAMA_LIBS) \ $(FFMPEG_LIBS) $(XINERAMA_LIBS) \
$(LIBDV_LIBS) $(LIBM_LIBS) $(PIXBUF_LIBS) $(JACK_LIBS) $(LIBQUICKTIME_LIBS) $(RT_LIBS) \ $(LIBDV_LIBS) $(LIBM_LIBS) $(PIXBUF_LIBS) $(JACK_LIBS) $(LIBQUICKTIME_LIBS) $(RT_LIBS) \

View File

@@ -61,6 +61,10 @@
#define PERFORM_AUDIO_SIZE 16384 #define PERFORM_AUDIO_SIZE 16384
#ifndef SAMPLE_FMT_S16
#define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
#endif
typedef struct { typedef struct {
uint8_t *Y; uint8_t *Y;
uint8_t *Cb; uint8_t *Cb;

View File

@@ -236,7 +236,8 @@ int task_start(int max_workers)
max_p = min_p; max_p = min_p;
struct sched_param param; // struct sched_param param;
// veejay_memset( &param, 0, sizeof(struct sched_param));
cpu_set_t cpuset; cpu_set_t cpuset;
pthread_cond_init( &tasks_completed, NULL ); pthread_cond_init( &tasks_completed, NULL );
pthread_cond_init( &current_task, NULL ); pthread_cond_init( &current_task, NULL );
@@ -245,9 +246,9 @@ int task_start(int max_workers)
for( i = 0 ; i < max_workers; i ++ ) { for( i = 0 ; i < max_workers; i ++ ) {
thr_id[i] = i; thr_id[i] = i;
pthread_attr_init( &p_attr[i] ); pthread_attr_init( &p_attr[i] );
pthread_attr_setstacksize( &p_attr[i], 128 * 1024 ); pthread_attr_setstacksize( &p_attr[i], 256 * 1024 );
pthread_attr_setschedpolicy( &p_attr[i], SCHED_FIFO ); // pthread_attr_setschedpolicy( &p_attr[i], SCHED_FIFO );
pthread_attr_setschedparam( &p_attr[i], &param ); // pthread_attr_setschedparam( &p_attr[i], &param );
if( n_cpu > 1 ) { if( n_cpu > 1 ) {
CPU_ZERO(&cpuset); CPU_ZERO(&cpuset);