X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Ftool%2Fmain.cpp;h=1bd614eba807095c0f48b7f82deb58e6b02fd17e;hb=bb8ff7dc808b6c28275b5ba8b204e520e5d48d92;hp=789465128b2ffff7a4bd78521610a931b949a612;hpb=ee0cc78c52143c3f4739076a3b3dff6e3106ecd8;p=synfig.git diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp index 7894651..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 @@ -69,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; @@ -148,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")); @@ -166,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; @@ -276,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); @@ -563,13 +617,6 @@ int extract_target_params(arg_list_t& arg_list, { // Target video codec params.video_codec = extract_parameter(arg_list, iter, next); - const char* allowed_video_codecs[] = - { - "flv", "gif", "h261", "h263", "h263p", "huffyuv", - "libtheora", "libx264", "libxvid", "ljpeg", "mjpeg", - "mpeg1video", "mpeg2video", "mpeg4", "msmpeg4", - "msmpeg4v1", "msmpegv2", "wmv1", "wmv2", NULL - }; // video_codec string to lowercase transform (params.video_codec.begin(), @@ -1134,6 +1181,9 @@ int main(int argc, char *argv[]) cerr << strprintf(_("Unknown target video codec: %s."), target_parameters.video_codec.c_str()) << endl; + cerr << _("Available target video codecs are:") + << endl; + display_target_video_codecs_help(); return SYNFIGTOOL_UNKNOWNARGUMENT; }