/******************************************************** AVI player Copyright 2000 Eugene Kuznetsov (divx@euro.ru) *********************************************************/ #include "playercontrol.h" #include "version.h" #include "avm_args.h" #include "avm_output.h" #include "avm_except.h" #include "configfile.h" #include #include #include #include #include #include #include #ifdef __FreeBSD__ #include #endif #ifdef __NetBSD__ #include #endif #include #include // atoi #include PlayerControl *m; extern void killer(int); extern const char* g_pcProgramName; int main(int argc, char* argv[]) { #if defined(__FreeBSD__) || defined(__NetBSD__) fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV)); #endif if (GetAvifileVersion() != AVIFILE_VERSION) { fprintf(stderr, "This binary was compiled for Avifile ver. %x " ", but the library is ver. %x.\nAborting...\n", GetAvifileVersion(), AVIFILE_VERSION); return 0; } char* acodec = 0; char* vcodec = 0; char* subname = 0; AviPlayerInitParams apip; apip.x = apip.y = 0x7fffffff; const avm::Args::Option sizesubopts[] = { avm::ARGSOPTION("i", "width", "w", "window width", &apip.width, 8, 8192), avm::ARGSOPTION("i", "height", "h", "window height", &apip.height, 2, 8192), avm::ARGSOPTION("i", "x", "x", "window position x", &apip.x, -8192, 8192), avm::ARGSOPTION("i", "y", "y", "window position y", &apip.y, -8192, 8192), avm::ARGSOPTION("#",,,) }; const avm::Args::Option opts[] = { avm::ARGSOPTION("b", "auto", "a", "use autoquality for postprocessing", &apip.quiet), avm::ARGSOPTION("o", "size", "s", "set windows size", &sizesubopts), avm::ARGSOPTION("d", "seek", "", "seek to given position", &apip.seek), avm::ARGSOPTION("c", "video-codec", "vc", "preferred video codec (use help for select)", &vcodec), avm::ARGSOPTION("c", "audio-codec", "ac", "preferred audio codec (use help for select)", &acodec), //avm::ARGSOPTION("i", "shift", "", "shift frame buffer by <%d> bytes [%d, %d]", &shift, -8192, 8192), //avm::ARGSOPTION("b", "nogui", "", "start playing without gui", &apip.nogui), avm::ARGSOPTION("b", "fullscreen", "f", "start playing in fullscreen", &apip.fullscreen), avm::ARGSOPTION("b", "maximize", "m", "start playing in maximized", &apip.maximize), avm::ARGSOPTION("b", "quiet", "q", "be quiet", &apip.quiet), avm::ARGSOPTION("s", "subtitle", "sub", "subtitle filename", &subname), //{ "b", "verbose", "t", "be verbose", &verbose), //{ "b", "version", "v", "show version"), avm::ARGSOPTION("c", "codec", "c", "use with help for more info"), avm::ARGSOPTION("h",,,), avm::ARGSOPTION("O",,,, avm::IAviPlayer::getOptions()), avm::ARGSOPTION("#",,,) }; int rc=0; // remote control support over stdin/stdout avm::Args(opts, &argc, argv, " [options] [