]> git.sesse.net Git - mlt/commitdiff
config mods; avformat static or shared build; corrections to sdl
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 19 Apr 2004 17:53:53 +0000 (17:53 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 19 Apr 2004 17:53:53 +0000 (17:53 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@293 d19143bc-622f-0410-bfdd-b5b2a6649095

14 files changed:
README
configure
docs/install.txt
docs/services.txt
src/modules/avformat/Makefile
src/modules/avformat/configure
src/modules/avformat/consumer_avformat.c
src/modules/avformat/factory.c
src/modules/avformat/filter_avdeinterlace.c
src/modules/avformat/filter_avresample.c
src/modules/avformat/producer_avformat.c
src/modules/configure
src/modules/gtk2/producer_pixbuf.c
src/modules/sdl/consumer_sdl.c

diff --git a/README b/README
index b22c0a85ca7c6ac0e9595c2bb205724d93d3c994..ea8a4fc0db54ca0a5d4858308976c3d5210a32e1 100644 (file)
--- 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.
index b9edcab45ab7fb4254459323eb8a61912e55a14f..0dc352f29ab8c296468747b4beefbde40e5afc7a 100755 (executable)
--- 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
index 3e7ac088f23d8453cbe0bb04129bdbf8faea3cea..776eea09d1802ec396753824d52c834b6135a032 100644 (file)
@@ -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.
index b69dbb89efe8578a08ead23edf7993f7041ead1a..358182519674b430d02d01bdf1bc58352fe3534e 100644 (file)
@@ -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
index e258004fb4e6f5ddde71c3c186b71b55aade1ce6..ade450ad39ae98ee259ef3dbbb813f12c1cc6d95 100644 (file)
@@ -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)
 
index cbecb5dc24e034dc0cc1da5c3babcc39a8f5a504..85dd1c48a46d19ea6cfcdfeea2a36f71a82407ed 100755 (executable)
@@ -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
index cf31d58cfe372c6f5b70b3351abc77812b4d3e16..77142e21151420e20c2c6ffd5ae8ee3223db9c59 100644 (file)
@@ -33,7 +33,7 @@
 #include <math.h>
 
 // avformat header files
-#include <ffmpeg/avformat.h>
+#include <avformat.h>
 
 typedef struct
 {
index a9de9e03842078156c3593367333bba432cb8b48..089a3e243aa2f6e05bd2df7b42498c5b8a784d09 100644 (file)
@@ -28,7 +28,7 @@
 #include "filter_avresample.h"
 
 // ffmpeg Header files
-#include <ffmpeg/avformat.h>
+#include <avformat.h>
 
 // A static flag used to determine if avformat has been initialised
 static int avformat_initialised = 0;
index f1d1a3f3a6ceb4600c884d4fdbf765d99c01b27c..853be72f52319644979ac75e601eeca0b6c428cd 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdlib.h>
 
 // ffmpeg Header files
-#include <ffmpeg/avformat.h>
+#include <avformat.h>
 
 #ifdef USE_MMX
 #include "mmx.h"
index dce42ee49be8ef8fa6769a311d41536a793f4ec4..4c37ae099cc84bf3a1e5cf810b34d69254ffb0fd 100644 (file)
@@ -27,7 +27,7 @@
 #include <string.h>
 
 // ffmpeg Header files
-#include <ffmpeg/avformat.h>
+#include <avformat.h>
 
 /** Get the audio.
 */
index ed7694d5b0a8c5e5fc06a214ed422f4b026e4eee..9da63d480c0aedc1ed28178d0779fab7d1b805f6 100644 (file)
@@ -25,7 +25,7 @@
 #include <framework/mlt_frame.h>
 
 // ffmpeg Header files
-#include <ffmpeg/avformat.h>
+#include <avformat.h>
 
 // System header files
 #include <stdlib.h>
index b10101ba323f2bb5c9714b4eae950c1567fffc28..6879efc4008aeaa87bbdc3c644eedd31e4c994e6 100755 (executable)
@@ -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" ]
index 5007ad7bdbe0a885c0dfab184cb61ac8bc1a75a9..2345145251a9bdf46e9b8c667ce4e47cfd2016b6 100644 (file)
@@ -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 );
index 0873118a76e6351aff885da3e106b746c025bb56..6b9ad0ce20549a61b7ad58bed1a28388d1b9819a 100644 (file)
@@ -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 );
                        }