+ 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 }
+ };
+ 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;
+ throw std::runtime_error(
+ std::string("Invalid video standard: ").append(str));
+ }
+