]> git.decadent.org.uk Git - videolink.git/commitdiff
Corrected naming of video standards.
authorBen Hutchings <ben@decadent.org.uk>
Wed, 7 Jun 2006 20:57:43 +0000 (20:57 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 23:40:00 +0000 (23:40 +0000)
video.cpp
video.hpp
webdvd.cpp

index f6bcf6ad5d0c41596e1ad8f50f704da1711f1ad7..c7e2678fbf13445264460e297e8ae144dfe0bfe6 100644 (file)
--- a/video.cpp
+++ b/video.cpp
@@ -2,7 +2,7 @@
 
 namespace video
 {
-    const struct frame_params pal_params =
+    const struct frame_params frame_params_625 =
     {
        "pal",
        720, 576,
@@ -10,7 +10,7 @@ namespace video
        59, 54
     };
 
-    const struct frame_params ntsc_params =
+    const struct frame_params frame_params_525 =
     {
        "ntsc",
        720, 480,
index 274eda622d508af3241c83d3d45c90511671e102..1c546e5de164c9b34455a43119d2ccfdc50d6bac 100644 (file)
--- a/video.hpp
+++ b/video.hpp
@@ -5,13 +5,13 @@ namespace video
 {
     struct frame_params
     {
-       const char * name;
+       const char * ffmpeg_name;
        unsigned int width, height;
        unsigned int rate_numer, rate_denom;
        unsigned int pixel_ratio_width, pixel_ratio_height;
     };
 
-    extern const frame_params pal_params, ntsc_params;
+    extern const frame_params frame_params_625, frame_params_525;
 }
 
 #endif // !INC_VIDEO_HPP
index 10289999bf8dbe71761dd027fa6de0768903ed70..5b9afe042a412d2dbee489f426e79ffc999f5483 100644 (file)
@@ -753,7 +753,7 @@ namespace
                    << "ffmpeg"
                    << " -f image2 -vcodec png -i "
                    << background_temp_->get_name()
-                   << " -target " << frame_params_.name <<  "-dvd"
+                   << " -target " << frame_params_.ffmpeg_name <<  "-dvd"
                    << " -vcodec mpeg2video -an -y /dev/stdout"
                    << " | spumux -v0 -mdvd " << state->spumux_temp.get_name()
                    << " > " << contents_.menus[menu_num].vob_temp->get_name();
@@ -808,22 +808,19 @@ namespace
     const video::frame_params & lookup_frame_params(const char * str)
     {
        assert(str);
-       static const struct { const char * str; bool is_ntsc; }
-       known_strings[] = {
-           { "NTSC",  true },
-           { "ntsc",  true },
-           { "PAL",   false },
-           { "pal",   false },
-           // For DVD purposes, SECAM can be treated identically to PAL.
-           { "SECAM", false },
-           { "secam", false }
+       static const char * const known_strings[] = {
+           "525",    "625",
+           "525/60", "625/50",
+           "NTSC",   "PAL",
+           "ntsc",   "pal"
        };
        for (std::size_t i = 0;
             i != sizeof(known_strings)/sizeof(known_strings[0]);
             ++i)
-           if (std::strcmp(str, known_strings[i].str) == 0)
-               return known_strings[i].is_ntsc ?
-                   video::ntsc_params : video::pal_params;
+           if (std::strcmp(str, known_strings[i]) == 0)
+               return (i & 1)
+                   ? video::frame_params_625
+                   : video::frame_params_525;
        throw std::runtime_error(
            std::string("Invalid video standard: ").append(str));
     }
@@ -832,7 +829,8 @@ namespace
     {
        stream <<
            "Usage: " << command_name << " [gtk-options] [--preview]\n"
-           "           [--video-std {ntsc|pal|secam}]\n"
+           "           [--video-std {525|525/60|NTSC|ntsc"
+           " | 625|625/50|PAL|pal}]\n"
            "           [--encoder {mjpegtools|mjpegtools-old}]\n"
            "           menu-url [output-dir]\n";
     }
@@ -882,7 +880,7 @@ int main(int argc, char ** argv)
 {
     try
     {
-       video::frame_params frame_params = video::pal_params;
+       video::frame_params frame_params = video::frame_params_625;
        bool preview_mode = false;
        std::string menu_url;
        std::string output_dir;