From: lilo_booter Date: Mon, 19 Apr 2004 17:53:53 +0000 (+0000) Subject: config mods; avformat static or shared build; corrections to sdl X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=757e8d55530954c3002b71f78d5027a222e810f7;p=mlt config mods; avformat static or shared build; corrections to sdl git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@293 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/README b/README index b22c0a85..ea8a4fc0 100644 --- a/README +++ b/README @@ -20,12 +20,9 @@ Configuration ./configure - Usage is: + More information on usage is found by running: - ./configure --help - report all configure options - ./configure --prefix=[dir] - target install directory (default: /usr/local) - ./configure --disable-[mod] - do not compile specified module(s) - ./configure --[other] - pass through to children + ./configure --help NB: This script must be run to register new services after a CVS checkout or subsequent update. diff --git a/configure b/configure index b9edcab4..0dc352f2 100755 --- a/configure +++ b/configure @@ -3,16 +3,22 @@ function show_help { cat << EOF -Funky non-autotool config script for MLT. +Non-autotool config script for MLT. -Options are: +Help options: --help - this information + +General build options: + --prefix=directory - install prefix for path (default: $prefix) + --enable-gpl - Enable GPL components --disable-debug - Compile without debug support (default: on) --disable-mmx - Compile without MMX support (default: on) - --enable-gpl - Enable GPL components --cpu='cpu' - Compile for a specific CPU/architectre (default: none) + +Module disables options: + EOF for i in src/modules/* @@ -22,6 +28,8 @@ EOF awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }' echo + echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated." + echo } function build_config @@ -91,7 +99,7 @@ export gpl=false export cpu= # Iterate through arguments -for i in $* +for i in "$@" do case $i in --help ) help=1 ;; @@ -113,7 +121,7 @@ do then [ $help = 0 ] && echo "Configuring `basename $i`:" pushd src/$i > /dev/null - ./configure $@ + ./configure "$@" [ $? != 0 ] && exit 1 popd > /dev/null fi diff --git a/docs/install.txt b/docs/install.txt index 3e7ac088..776eea09 100644 --- a/docs/install.txt +++ b/docs/install.txt @@ -22,31 +22,31 @@ Directories + src - All project source is provided here + framework - The mlt media framework + modules - All services are defined here + + avformat - libavformat dependent services + + bluefish - Bluefish dependent services (*) + core - Independent MLT services + dv - libdv dependent services - + ffmpeg - ffmpeg dependent services - + avformat - libavformat dependent services - + vorbis - vorbis dependenent services - + sdl - SDL dependent services - + resample - libresample dependent services - + gtk2 - pango and pixbuf dependent services + fezzik - A giant (meta) service to load and normalise media - + westley - Nice and clever XML services - + vorbis - Ogg Vorbis dependent services - + xine - Xine-derived sources - + bluefish - Bluefish dependent services (*) + + gtk2 - pango and pixbuf dependent services + mainconcept - mainconcept dependent services (*) - + inigo - A media playing test application - + valerie - Client API to access the server - + miracle - The server implementation + + normalize - audio normalisation functions (**) + + resample - libresample dependent services (**) + + sdl - SDL dependent services + + vorbis - vorbis dependenent services + + westley - Nice and clever XML services + + xine - Xine-derived sources (**) + albino - A simple console (protocol level) example + + inigo - A media playing test application + humperdink - A terminal-based example client + + miracle - The server implementation + tests - Reserved for regression and unit tests + + valerie - Client API to access the server Additional subdirectories may be nested below those shown and should be documented in their parent. - (*) Not posted to CVS due to licensing issues. + (*) Not posted to CVS due to licensing issues. + (**) Contains GPL dependencies or code. Dependencies @@ -81,7 +81,7 @@ Dependencies URL: http://www.mainconcept.com ----------- ---------------------------------------------------------- resample libsamplerate 0.15 or later - URL: http://www.mega-nerd.com/SRC/ + URL: http://www.mega-nerd.com/SRC/ (GPL) ----------- ---------------------------------------------------------- sdl SDL 1.2 or later. URL: http://www.libsdl.org @@ -107,15 +107,9 @@ Configuration configure script and arguments are accepted and passed through to all subdirectories. - Top level usage is: + More information on usage is found by running: - ./configure --help - report all configure options - ./configure --prefix=[dir] - target install directory (default: /usr/local) - ./configure --disable-debug - turn off debugging - ./configure --disable-mmx - turn off MMX usage - ./configure --cpu='cpu' - tune build for a specific cpu - ./configure --disable-[mod] - do not compile specified module(s) - ./configure --[other] - pass through to children + ./configure --help NB: This script must be run to register new services after a CVS checkout or subsequent update. diff --git a/docs/services.txt b/docs/services.txt index b69dbb89..35818251 100644 --- a/docs/services.txt +++ b/docs/services.txt @@ -146,49 +146,6 @@ Producers none - ffmpeg (DEPRECATED) - - Description - - Test case pipe based producer for video and audio. - - Constructor Argument - - 'file' - produce a/v from file - v4l - produce a/v from video4linux and dsp device - - Initialisation Properties - - string video_type - "file" or "v4l" - string video_file - file or v4l device - string video_size - WxH of video to produce (default: "") - int video_loop - loop video until audio exhausted (default: 0) - string audio_type - "file" or "dsp" - string audio_file - file or dsp device - int audio_rate - audio frequency (default: 48000) - int audio_channels - audio channels (default: 2) - int audio_track - audio track to use (default: 0) - int audio_loop - loop audio until video exhausted (default: 0) - int in - in point - int out - out point - double fps - output frames per second (default: 25) - double aspect_ratio - aspect ratio of video - - Read Only Properties - - string resource - file or "v4l" - int end_of_clip - holds 1 when input is exhausted - - Dependencies - - ffmpeg executable. - - Known Bugs - - in point setting is broken. - - Implementation does not allow fast random access. - libdv Description diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index e258004f..ade450ad 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,4 +1,5 @@ include ../../../config.mak +include config.mak TARGET = ../libmltavformat.so @@ -8,9 +9,9 @@ OBJS = factory.o \ filter_avdeinterlace.o \ filter_avresample.o -CFLAGS += -I../.. +CFLAGS+=-I../.. -LDFLAGS += -lavformat -lavcodec +LDFLAGS+=-lavformat -lavcodec $(EXTRA_LIBS) SRCS := $(OBJS:.o=.c) diff --git a/src/modules/avformat/configure b/src/modules/avformat/configure index cbecb5dc..85dd1c48 100755 --- a/src/modules/avformat/configure +++ b/src/modules/avformat/configure @@ -1,7 +1,64 @@ #!/bin/bash -if [ "$help" != "1" ] +if [ "$help" = "1" ] then + cat << EOF +FFMPEG/avformat options: + + --avformat-shared=path - Link against a shared installation of ffmpeg (default) + --avformat-static=path - Link against a static ffmpeg dev tree + --avformat-ldextra=libs - Provide additional libs to link with + +EOF + +else + echo > config.mak + + export static_ffmpeg= + export shared_ffmpeg=`whereis ffmpeg | cut -f 2 -d' '` + export extra_libs= + + if [ "$shared_ffmpeg" != "" ] + then + # Chop ffmpeg + shared_ffmpeg=`dirname $shared_ffmpeg` + # Chop bin + shared_ffmpeg=`dirname $shared_ffmpeg` + fi + + for i in "$@" + do + case $i in + --avformat-static=* ) static_ffmpeg="${i#--avformat-static=}" ;; + --avformat-shared=* ) shared_ffmpeg="${i#--avformat-shared=}" ;; + --avformat-ldextra=* ) extra_libs="${i#--avformat-ldextra=}" ;; + esac + done + + if [ "$static_ffmpeg" != "" ] + then + if [ -d "$static_ffmpeg" ] + then + echo "CFLAGS+=-I$static_ffmpeg/libavformat -I$static_ffmpeg/libavcodec" >> config.mak + echo "LDFLAGS+=-L$static_ffmpeg/libavformat -L$static_ffmpeg/libavcodec" >> config.mak + else + echo "avformat: Invalid path specified: $static_ffmpeg" + touch ../disable-avformat + echo 0 + fi + else + if [ -d "$shared_ffmpeg/include/ffmpeg" -a -f "$shared_ffmpeg/lib/libavformat.so" ] + then + echo "CFLAGS+=-I$shared_ffmpeg/include/ffmpeg " >> config.mak + echo "LDFLAGS+=-L$shared_ffmpeg" >> config.mak + else + echo "avformat: No build environment found." + touch ../disable-avformat + exit 0 + fi + fi + + echo "EXTRA_LIBS=$extra_libs" >> config.mak cat << EOF >> ../producers.dat avformat libmltavformat.so diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index cf31d58c..77142e21 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -33,7 +33,7 @@ #include // avformat header files -#include +#include typedef struct { diff --git a/src/modules/avformat/factory.c b/src/modules/avformat/factory.c index a9de9e03..089a3e24 100644 --- a/src/modules/avformat/factory.c +++ b/src/modules/avformat/factory.c @@ -28,7 +28,7 @@ #include "filter_avresample.h" // ffmpeg Header files -#include +#include // A static flag used to determine if avformat has been initialised static int avformat_initialised = 0; diff --git a/src/modules/avformat/filter_avdeinterlace.c b/src/modules/avformat/filter_avdeinterlace.c index f1d1a3f3..853be72f 100644 --- a/src/modules/avformat/filter_avdeinterlace.c +++ b/src/modules/avformat/filter_avdeinterlace.c @@ -26,7 +26,7 @@ #include // ffmpeg Header files -#include +#include #ifdef USE_MMX #include "mmx.h" diff --git a/src/modules/avformat/filter_avresample.c b/src/modules/avformat/filter_avresample.c index dce42ee4..4c37ae09 100644 --- a/src/modules/avformat/filter_avresample.c +++ b/src/modules/avformat/filter_avresample.c @@ -27,7 +27,7 @@ #include // ffmpeg Header files -#include +#include /** Get the audio. */ diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index ed7694d5..9da63d48 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -25,7 +25,7 @@ #include // ffmpeg Header files -#include +#include // System header files #include diff --git a/src/modules/configure b/src/modules/configure index b10101ba..6879efc4 100755 --- a/src/modules/configure +++ b/src/modules/configure @@ -7,7 +7,7 @@ echo SUBDIRS = `find -type d -maxdepth 1 | grep -v CVS | grep -v "^.$" | sed 's/\.\///'` > make.inc # Iterate through arguments -for i in $* +for i in "$@" do case $i in --disable-* ) touch disable-${i#--disable-} ;; @@ -23,7 +23,7 @@ do then [ "$help" = "0" ] && echo "Configuring modules/$i:" pushd $i > /dev/null - ./configure $@ + ./configure "$@" [ $? != 0 ] && exit 1 popd > /dev/null elif [ "$help" = "0" ] diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index 5007ad7b..23451452 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -229,6 +229,13 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form *width = mlt_properties_get_int( properties, "width" ); *height = mlt_properties_get_int( properties, "height" ); + if ( size == 0 ) + { + *width = mlt_properties_get_int( properties, "normalised_width" ); + *height = mlt_properties_get_int( properties, "normalised_height" ); + size = *width * ( *height + 1 ); + } + // Clone if necessary // NB: Cloning is necessary with this producer (due to processing of images ahead of use) // The fault is not in the design of mlt, but in the implementation of pixbuf... @@ -236,7 +243,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form { // Clone our image uint8_t *copy = mlt_pool_alloc( size ); - memcpy( copy, image, size ); + if ( image != NULL ) + memcpy( copy, image, size ); // We're going to pass the copy on image = copy; @@ -342,8 +350,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i { snprintf( fullname, 1023, "%s%s", dir_name, de[i]->d_name ); - if ( lstat( fullname, &info ) == 0 && - ( S_ISREG( info.st_mode ) || ( strstr( fullname, extension ) && info.st_mode | S_IXUSR ) ) ) + if ( strstr( fullname, extension ) && lstat( fullname, &info ) == 0 && + ( S_ISREG( info.st_mode ) || info.st_mode | S_IXUSR ) ) { this->filenames = realloc( this->filenames, sizeof( char * ) * ( this->count + 1 ) ); this->filenames[ this->count ++ ] = strdup( fullname ); diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 0873118a..6b9ad0ce 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -470,9 +470,8 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) if ( this->sdl_screen != NULL ) { SDL_SetClipRect( this->sdl_screen, &rect ); - sdl_lock_display(); - this->sdl_overlay = SDL_CreateYUVOverlay( this->width - (this->width % 4), this->height - (this->height % 2 ), SDL_YUY2_OVERLAY, this->sdl_screen ); + this->sdl_overlay = SDL_CreateYUVOverlay( this->width, this->height, SDL_YUY2_OVERLAY, this->sdl_screen ); sdl_unlock_display(); } } @@ -482,7 +481,8 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) this->buffer = this->sdl_overlay->pixels[ 0 ]; if ( SDL_LockYUVOverlay( this->sdl_overlay ) >= 0 ) { - memcpy( this->buffer, image, width * height * 2 ); + if ( image != NULL ) + memcpy( this->buffer, image, width * height * 2 ); SDL_UnlockYUVOverlay( this->sdl_overlay ); SDL_DisplayYUVOverlay( this->sdl_overlay, &this->sdl_screen->clip_rect ); }