X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Ftool%2Fmain.cpp;h=1bd614eba807095c0f48b7f82deb58e6b02fd17e;hb=a503bbd61b1c4791081babd4659f13471a10490a;hp=2beff602116627e887775d636408299c48e351a8;hpb=63d3e2f564c1b725bfead19fe0ce28fb0cf502f5;p=synfig.git diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp index 2beff60..1bd614e 100644 --- a/synfig-core/src/tool/main.cpp +++ b/synfig-core/src/tool/main.cpp @@ -7,6 +7,7 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2009-2010 Diego Barrios ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -45,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +70,42 @@ int verbosity=0; bool be_quiet=false; bool print_benchmarks=false; +//! Allowed video codecs +/*! \warning This variable is linked to allowed_video_codecs_description, + * if you change this you must change the other acordingly. + * \warning These codecs are linked to the filename extensions for + * mod_ffmpeg. If you change this you must change the others acordingly. + */ +const char* allowed_video_codecs[] = +{ + "flv", "h263p", "huffyuv", "libtheora", "libx264", + "mjpeg", "mpeg1video", "mpeg2video", "mpeg4", "msmpeg4", + "msmpeg4v1", "msmpeg4v2", "wmv1", "wmv2", NULL +}; + +//! Allowed video codecs description. +/*! \warning This variable is linked to allowed_video_codecs, + * if you change this you must change the other acordingly. + */ +const char* allowed_video_codecs_description[] = +{ + "Flash Video (FLV) / Sorenson Spark / Sorenson H.263.", + "H.263+ / H.263-1998 / H.263 version 2.", + "Huffyuv / HuffYUV.", + "libtheora Theora.", + "libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10.", + "MJPEG (Motion JPEG).", + "raw MPEG-1 video.", + "raw MPEG-2 video.", + "MPEG-4 part 2. (XviD/DivX)", + "MPEG-4 part 2 Microsoft variant version 3.", + "MPEG-4 part 2 Microsoft variant version 1.", + "MPEG-4 part 2 Microsoft variant version 2.", + "Windows Media Video 7.", + "Windows Media Video 8.", + NULL +}; + /* === T Y P E D E F S ===================================================== */ typedef list arg_list_t; @@ -147,6 +185,7 @@ void display_help(bool full) display_help_option("--layer-info", "", _("Print out layer's description, parameter info, etc.")); display_help_option("--layers", NULL, _("Print out the list of available layers")); display_help_option("--targets", NULL, _("Print out the list of available targets")); + display_help_option("--target-video-codecs", NULL, _("Print out the list of available target video codecs")); display_help_option("--importers", NULL, _("Print out the list of available importers")); display_help_option("--valuenodes", NULL, _("Print out the list of available ValueNodes")); display_help_option("--modules", NULL, _("Print out the list of loaded modules")); @@ -165,6 +204,15 @@ void display_help(bool full) cerr << endl; } +void display_target_video_codecs_help () +{ + for (int i = 0; allowed_video_codecs[i] != NULL && + allowed_video_codecs_description[i] != NULL; i++) + cout << " " << allowed_video_codecs[i] << ": \t" + << allowed_video_codecs_description[i] + << endl; +} + int process_global_flags(arg_list_t &arg_list) { arg_list_t::iterator iter, next; @@ -275,6 +323,13 @@ int process_global_flags(arg_list_t &arg_list) return SYNFIGTOOL_HELP; } + if(*iter == "--target-video-codecs") + { + display_target_video_codecs_help(); + + return SYNFIGTOOL_HELP; + } + if(*iter == "--valuenodes") { Progress p(PACKAGE); @@ -348,7 +403,7 @@ bool flag_requires_value(String flag) flag=="-Q" || flag=="-s" || flag=="-t" || flag=="-T" || flag=="-w" || flag=="--append" || flag=="--begin-time" || flag=="--canvas-info"|| flag=="--dpi" || flag=="--dpi-x" || flag=="--dpi-y" || flag=="--end-time" || flag=="--fps" || flag=="--layer-info" || flag=="--start-time" || - flag=="--time" ); + flag=="--time" || flag=="-vc" || flag=="-vb"); } int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster) @@ -387,13 +442,15 @@ int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster) * \param arg_list Argument list from wich the parameter is extracted. * \param iter Iterator pointing to the argument list parameter to be * extracted. + * \param next Iterator pointing to the next argument. */ string extract_parameter (arg_list_t& arg_list, - arg_list_t::iterator& iter) + arg_list_t::iterator& iter, + arg_list_t::iterator& next) { string parameter; arg_list.erase(iter); - iter++; + iter = next++; parameter = *iter; arg_list.erase(iter); return parameter; @@ -401,78 +458,78 @@ string extract_parameter (arg_list_t& arg_list, int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc) { - arg_list_t::iterator iter; + arg_list_t::iterator iter, next; int w=0,h=0; float span=0; - for(iter=arg_list.begin(); iter!=arg_list.end(); iter++) + for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++) { if(*iter=="-w") { - w = atoi(extract_parameter(arg_list, iter).c_str()); + w = atoi(extract_parameter(arg_list, iter, next).c_str()); } else if(*iter=="-h") { - h = atoi(extract_parameter(arg_list, iter).c_str()); + h = atoi(extract_parameter(arg_list, iter, next).c_str()); } else if(*iter=="-a") { int a; - a = atoi(extract_parameter(arg_list, iter).c_str()); + a = atoi(extract_parameter(arg_list, iter, next).c_str()); desc.set_antialias(a); VERBOSE_OUT(1)<