diff options
author | prigaux <[email protected]> | 2007-02-11 20:00:15 +0000 |
---|---|---|
committer | prigaux <[email protected]> | 2007-02-11 20:00:15 +0000 |
commit | a74fd5a1ec37e53fe7008f022639af6ede0e82c9 (patch) | |
tree | 0a6a32640a840b72653149aa11efa264674df976 /test | |
parent | f45dfeb2afb1b0bf46054959e8ea9494f3b7d14f (diff) |
Merge the 0.8.0_mpeg4ip branch into the trunk
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@285 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r-- | test/BUILDSHARED | 36 | ||||
-rw-r--r-- | test/Makefile | 29 | ||||
-rw-r--r-- | test/fakexcode.cpp | 3 | ||||
-rw-r--r-- | test/test.c | 27 |
4 files changed, 85 insertions, 10 deletions
diff --git a/test/BUILDSHARED b/test/BUILDSHARED new file mode 100644 index 000000000..a2f015555 --- /dev/null +++ b/test/BUILDSHARED @@ -0,0 +1,36 @@ +To test the MediaFork dylib on MacOs X issue the following commands: +=================================================================== + +cp ../libmediafork/libmediafork.dylib . +gcc -I../libmediafork -L. -lmediafork test.c -o test -arch i386 -arch ppc +install_name_tool -change /usr/local/lib/libmediafork.dylib @executable_path/libmediafork.dylib test + +Validate that the test Binary is really using the shared library + +otool -L test + +------------------------------------------------------------------------ + +To test the Mediafork .so on Linux issue the following commands: +================================================================ + +cp ../libmediafork/libmediafork.so . +gcc -I../libmediafork -L. -lmediafork test.c -o test -lz -lpthread + +Validate that the test Binary is really using the shared library + +ldd test + +------------------------------------------------------------------------ + +To test the MediaFork .dll on cygwin issue the following commands: +================================================================== + +cp ../libmediafork/libmediafork.dll . +gcc -I../libmediafork -L. -lmediafork test.c -o test -lz -lpthread + +The resulting binary test should depend on the cygwin dll and the mediafork dll. + +I works like that but wasn't tested yet outside of cygwin. + +------------------------------------------------------------------------ diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 000000000..3e7a65971 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,29 @@ +SYSTEM = $(shell uname -s) + +ifeq ($(SYSTEM),CYGWIN_NT-5.1) + LIBS = a52 avformat avcodec avutil dvdread faac mp3lame mpeg2 vorbis vorbisenc ogg samplerate x264 xvidcore mp4v2 +else + LIBS = a52 avformat avcodec avutil dvdread dvdcss faac mp3lame mpeg2 vorbis vorbisenc ogg samplerate x264 xvidcore mp4v2 +endif + +all: ../MediaForkCLI + +CFLAGS += -I../libmediafork +CXXFLAGS += -I../libmediafork +LIBS2 = ../libmediafork/libmediafork.a $(LIBS:%=../contrib/lib/lib%.a) +LDFLAGS += $(LIBS2) + +../MediaForkCLI: test.c $(LIBS2) + @CMD="$(CC) $(CFLAGS) -o test.o -c test.c"; $$CMD || \ + ( echo "Compile line for $@ was:"; echo $$CMD; false ) + @echo "Link MediaForkCLI" + @CMD="g++ $(CXXFLAGS) -o ../MediaForkCLI test.o $(LDFLAGS) -lz -lpthread"; $$CMD || \ + ( echo "Compile line for $@ was:"; echo $$CMD; false ) + + +clean: + @echo "Clean MediaForkCLI" + @$(RM) ../MediaForkCLI + @$(RM) ../MediaForkCLI.exe + @$(RM) *.o + diff --git a/test/fakexcode.cpp b/test/fakexcode.cpp new file mode 100644 index 000000000..d3782be7a --- /dev/null +++ b/test/fakexcode.cpp @@ -0,0 +1,3 @@ +/* + * Force Xcode to use g++ + */ diff --git a/test/test.c b/test/test.c index dc66aa6f4..1d9781c49 100644 --- a/test/test.c +++ b/test/test.c @@ -10,7 +10,7 @@ #include <time.h> #include <unistd.h> -#include "hb.h" +#include "mediafork.h" /* Options */ static int debug = HB_DEBUG_NONE; @@ -39,6 +39,7 @@ static int size = 0; static int abitrate = 0; static int mux = 0; static int acodec = 0; +static int pixelratio = 0; static int chapter_start = 0; static int chapter_end = 0; static int crf = 0; @@ -71,7 +72,7 @@ int main( int argc, char ** argv ) h = hb_init( debug, update ); /* Show version */ - fprintf( stderr, "HandBrake %s (%d) - http://handbrake.m0k.org/\n", + fprintf( stderr, "MediaFork %s (%d) - http://mediafork.dynalias.com/\n", hb_get_version( h ), hb_get_build( h ) ); /* Check for update */ @@ -80,12 +81,12 @@ int main( int argc, char ** argv ) if( ( build = hb_check_update( h, &version ) ) > -1 ) { fprintf( stderr, "You are using an old version of " - "HandBrake.\nLatest is %s (build %d).\n", version, + "MediaFork.\nLatest is %s (build %d).\n", version, build ); } else { - fprintf( stderr, "Your version of HandBrake is up to " + fprintf( stderr, "Your version of MediaFork is up to " "date.\n" ); } hb_close( &h ); @@ -173,7 +174,7 @@ int main( int argc, char ** argv ) if( format ) free( format ); if( audios ) free( audios ); - fprintf( stderr, "HandBrake has exited.\n" ); + fprintf( stderr, "MediaFork has exited.\n" ); return 0; } @@ -182,7 +183,7 @@ static void ShowCommands() { fprintf( stderr, "Commands:\n" ); fprintf( stderr, " [h]elp Show this message\n" ); - fprintf( stderr, " [q]uit Exit HBTest\n" ); + fprintf( stderr, " [q]uit Exit MediaForkCLI\n" ); fprintf( stderr, " [p]ause Pause encoding\n" ); fprintf( stderr, " [r]esume Resume encoding\n" ); } @@ -310,6 +311,7 @@ static int HandleEvents( hb_handle_t * h ) job->deinterlace = deinterlace; job->grayscale = grayscale; + job->pixel_ratio = pixelratio; if( width && height ) { @@ -326,7 +328,7 @@ static int HandleEvents( hb_handle_t * h ) job->height = height; hb_fix_aspect( job, HB_KEEP_HEIGHT ); } - else + else if( !pixelratio ) { hb_fix_aspect( job, HB_KEEP_WIDTH ); } @@ -402,7 +404,7 @@ static int HandleEvents( hb_handle_t * h ) fprintf( stderr, "Calculated bitrate: %d kbps\n", job->vbitrate ); } - + if( sub ) { job->subtitle = sub - 1; @@ -506,7 +508,7 @@ static void ShowHelp() int i; fprintf( stderr, - "Syntax: HBTest [options] -i <device> -o <file>\n" + "Syntax: MediaForkCLI [options] -i <device> -o <file>\n" "\n" " -h, --help Print help\n" " -u, --update Check for updates and exit\n" @@ -534,6 +536,7 @@ static void ShowHelp() " -2, --two-pass Use two-pass mode\n" " -d, --deinterlace Deinterlace video\n" " -g, --grayscale Grayscale encoding\n" + " -p, --pixelratio Store pixel aspect ratio in video stream\n" "\n" " -r, --rate Set video framerate (" ); for( i = 0; i < hb_video_rates_count; i++ ) @@ -589,6 +592,7 @@ static int ParseOptions( int argc, char ** argv ) { "two-pass", no_argument, NULL, '2' }, { "deinterlace", no_argument, NULL, 'd' }, { "grayscale", no_argument, NULL, 'g' }, + { "pixelratio", no_argument, NULL, 'p' }, { "width", required_argument, NULL, 'w' }, { "height", required_argument, NULL, 'l' }, { "crop", required_argument, NULL, 'n' }, @@ -608,7 +612,7 @@ static int ParseOptions( int argc, char ** argv ) int c; c = getopt_long( argc, argv, - "hvuC:f:i:o:t:c:a:s:e:E:2dgw:l:n:b:q:S:B:r:R:Q", + "hvuC:f:i:o:t:c:a:s:e:E:2dgpw:l:n:b:q:S:B:r:R:Q", long_options, &option_index ); if( c < 0 ) { @@ -680,6 +684,9 @@ static int ParseOptions( int argc, char ** argv ) case 'g': grayscale = 1; break; + case 'p': + pixelratio = 1; + break; case 'e': if( !strcasecmp( optarg, "ffmpeg" ) ) { |