fscking OpenBSD?
[asdcplib.git] / src / asdcp-test.cpp
index 8b72ebc80adb50df455734147de65c4f46ba5d3d..624c18bfad108cccc0cd9efc1b7cc0e96dcef9a4 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2003-2010, John Hurst
+Copyright (c) 2003-2011, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -103,7 +103,7 @@ banner(FILE* stream = stdout)
 {
   fprintf(stream, "\n\
 %s (asdcplib %s)\n\n\
-Copyright (c) 2003-2010 John Hurst\n\n\
+Copyright (c) 2003-2011 John Hurst\n\n\
 asdcplib may be copied only under the terms of the license found at\n\
 the top of every file in the asdcplib distribution kit.\n\n\
 Specify the -h (help) option for further information about %s\n\n",
@@ -172,11 +172,11 @@ Read/Write Options:\n\
   -d <duration>     - Number of frames to process, default all\n\
   -f <start-frame>  - Starting frame number, default 0\n\
   -l <label>        - Use given channel format label when writing MXF sound\n\
-                      files. SMPTE 429-2 labels: '5.1', '6.1', '7.1'. Default\n\
-                      is no label (valid for Interop only).\n\
+                      files. SMPTE 429-2 labels: '5.1', '6.1', '7.1', '7.1DS', 'WTF'.\n\
+                      Default is no label (valid for Interop only).\n\
   -L                - Write SMPTE UL values instead of MXF Interop\n\
   -p <rate>         - fps of picture when wrapping PCM or JP2K:\n\
-                      Use one of [23|24|48], 24 is default\n\
+                      Use one of [23|24|25|30|48|50|60], 24 is default\n\
   -R                - Repeat the first frame over the entire file (picture\n\
                       essence only, requires -c, -d)\n\
   -S                - Split Wave essence to stereo WAV files during extract.\n\
@@ -234,8 +234,14 @@ decode_channel_fmt(const std::string& label_name)
   else if ( label_name == "7.1" )
     return PCM::CF_CFG_3;
 
+  else if ( label_name == "WTF" )
+    return PCM::CF_CFG_4;
+
+  else if ( label_name == "7.1DS" )
+    return PCM::CF_CFG_5;
+
   fprintf(stderr, "Error decoding channel format string: %s\n", label_name.c_str());
-  fprintf(stderr, "Expecting '5.1', '6.1', or '7.1'\n");
+  fprintf(stderr, "Expecting '5.1', '6.1', '7.1', '7.1DS' or 'WTF'\n");
   return PCM::CF_NONE;
 }
 
@@ -286,11 +292,15 @@ public:
   Rational PictureRate()
   {
     if ( picture_rate == 23 ) return EditRate_23_98;
+    if ( picture_rate == 24 ) return EditRate_24;
     if ( picture_rate == 25 ) return EditRate_25;
     if ( picture_rate == 30 ) return EditRate_30;
     if ( picture_rate == 48 ) return EditRate_48;
     if ( picture_rate == 50 ) return EditRate_50;
     if ( picture_rate == 60 ) return EditRate_60;
+    if ( picture_rate == 96 ) return EditRate_96;
+    if ( picture_rate == 100 ) return EditRate_100;
+    if ( picture_rate == 120 ) return EditRate_120;
     return EditRate_24;
   }
 
@@ -298,11 +308,15 @@ public:
   const char* szPictureRate()
   {
     if ( picture_rate == 23 ) return "23.976";
+    if ( picture_rate == 24 ) return "24";
     if ( picture_rate == 25 ) return "25";
     if ( picture_rate == 30 ) return "30";
     if ( picture_rate == 48 ) return "48";
     if ( picture_rate == 50 ) return "50";
     if ( picture_rate == 60 ) return "60";
+    if ( picture_rate == 96 ) return "96";
+    if ( picture_rate == 100 ) return "100";
+    if ( picture_rate == 120 ) return "120";
     return "24";
   }
 
@@ -1356,6 +1370,7 @@ read_PCM_file(CommandOptions& Options)
       if ( ADesc.EditRate != EditRate_23_98
           && ADesc.EditRate != EditRate_24
           && ADesc.EditRate != EditRate_25
+          && ADesc.EditRate != EditRate_30
           && ADesc.EditRate != EditRate_48
           && ADesc.EditRate != EditRate_50
           && ADesc.EditRate != EditRate_60 )