Merge pull request #25 from remia/fix/non-pod-variadic-warning
[asdcplib.git] / src / phdr-unwrap.cpp
index c6669e9d12407c80bce6f3d4a38ca701053ad419..bd5a5a3b191611ca8d1733f185ca1f2ad25a70f8 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2011-2014, John Hurst
+Copyright (c) 2011-2018, John Hurst
 
 All rights reserved.
 
@@ -60,7 +60,7 @@ banner(FILE* stream = stdout)
 {
   fprintf(stream, "\n\
 %s (asdcplib %s)\n\n\
-Copyright (c) 2011-2015, John Hurst\n\n\
+Copyright (c) 2011-2018, 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",
@@ -84,7 +84,9 @@ Options:\n\
   -b <buffer-size>  - Specify size in bytes of picture frame buffer\n\
                       Defaults to 4,194,304 (4MB)\n\
   -d <duration>     - Number of frames to process, default all\n\
+  -e <extension>    - Extension to use for aux data files. default \"bin\"\n\
   -f <start-frame>  - Starting frame number, default 0\n\
+  -g <filename>     - Extract global metadata to the named file.\n\
   -h | -help        - Show help\n\
   -k <key-string>   - Use key for ciphertext operations\n\
   -m                - verify HMAC values when reading\n\
@@ -123,7 +125,8 @@ public:
   byte_t key_value[KeyLen];  // value of given encryption key (when key_flag is true)
   byte_t key_id_value[UUIDlen];// value of given key ID (when key_id_flag is true)
   const char* input_filename;
-  std::string prefix_buffer;
+  const char* extension;
+  std::string global_metadata_filename, prefix_buffer;
 
   //
   CommandOptions(int argc, const char** argv) :
@@ -132,7 +135,7 @@ public:
     version_flag(false), help_flag(false), number_width(6),
     start_frame(0), duration(0xffffffff), duration_flag(false),
     fb_size(FRAME_BUFFER_SIZE), file_prefix(0),
-    input_filename(0)
+    input_filename(0), extension("bin")
   {
     memset(key_value, 0, KeyLen);
     memset(key_id_value, 0, UUIDlen);
@@ -172,6 +175,11 @@ public:
                start_frame = Kumu::xabs(strtol(argv[i], 0, 10));
                break;
 
+             case 'g':
+               TEST_EXTRA_ARG(i, 'g');
+               global_metadata_filename = argv[i];
+               break;
+
              case 'h': help_flag = true; break;
              case 'm': read_hmac = true; break;