channel assignment
[asdcplib.git] / src / AS_DCP.h
index 1647f1e78c4d373930e8daf5428a523aeda65e71..70367ce7eb0e7cd75275a87c2ad3b97a0eea5ec8 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2003-2008, John Hurst
+Copyright (c) 2003-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -90,8 +90,9 @@ This project depends upon the following libraries:
 #include <stdio.h>
 #include <stdarg.h>
 #include <math.h>
-#include <iostream>
+#include <iosfwd>
 #include <string>
+#include <cstring>
 #include <list>
 
 //--------------------------------------------------------------------------------
@@ -146,17 +147,8 @@ typedef unsigned int   ui32_t;
 // All library components are defined in the namespace ASDCP
 //
 namespace ASDCP {
-  // The version number consists of three segments: major, API minor, and
-  // implementation minor. Whenever a change is made to AS_DCP.h, the API minor
-  // version will increment. Changes made to the internal implementation will
-  // result in the incrementing of the implementation minor version.
-
-  // For example, if asdcplib version 1.0.0 were modified to accomodate changes
-  // in file format, and if no changes were made to AS_DCP.h, the new version would be
-  // 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
-  const ui32_t VERSION_MAJOR = 1;
-  const ui32_t VERSION_APIMINOR = 3;
-  const ui32_t VERSION_IMPMINOR = 18;
+  //
+  // The version number declaration and explanation have moved to ../configure.ac
   const char* Version();
 
   // UUIDs are passed around as strings of UUIDlen bytes
@@ -347,6 +339,8 @@ namespace ASDCP {
     }
   };
 
+  // Print WriterInfo to std::ostream
+  std::ostream& operator << (std::ostream& strm, const WriterInfo& winfo);
   // Print WriterInfo to stream, stderr by default.
   void WriterInfoDump(const WriterInfo&, FILE* = 0);
 
@@ -577,6 +571,8 @@ namespace ASDCP {
          ui32_t   ContainerDuration;       // 
       };
 
+      // Print VideoDescriptor to std::ostream
+      std::ostream& operator << (std::ostream& strm, const VideoDescriptor& vdesc);
       // Print VideoDescriptor to stream, stderr by default.
       void VideoDescriptorDump(const VideoDescriptor&, FILE* = 0);
 
@@ -753,9 +749,22 @@ namespace ASDCP {
        };
     } // namespace MPEG2
 
+  //---------------------------------------------------------------------------------
   //
   namespace PCM
     {
+      // The channel format will normally be CF_NONE. Unless you have read and understand
+      // SMPTE 429-2-2009 Annex A you should leave it as-is. If you want to label your channel
+      // format and it is one of the fomats given in 429-2, select the appropriate value
+      // from this enum and use it in the ChannelFormat element of the AudioDescriptor struct.
+      //
+      enum ChannelFormat_t {
+       CF_NONE,
+       CF_CFG_1, // 5.1 with optional HI/VI
+       CF_CFG_2, // 6.1 (5.1 + center surround) with optional HI/VI
+       CF_CFG_3, // 7.1 with optional HI/VI
+      };
+
       struct AudioDescriptor
        {
          Rational SampleRate;         // rate of frame wrapping
@@ -767,8 +776,11 @@ namespace ASDCP {
          ui32_t   AvgBps;             // 
          ui32_t   LinkedTrackID;      // 
          ui32_t   ContainerDuration;  // number of frames
+         ChannelFormat_t ChannelFormat; // audio channel arrangement
       };
 
+      // Print AudioDescriptor to std::ostream
+      std::ostream& operator << (std::ostream& strm, const AudioDescriptor& adesc);
       // Print debugging information to stream (stderr default)
       void   AudioDescriptorDump(const AudioDescriptor&, FILE* = 0);
 
@@ -903,6 +915,7 @@ namespace ASDCP {
        };
     } // namespace PCM
 
+  //---------------------------------------------------------------------------------
   //
   namespace JP2K
     {
@@ -971,6 +984,8 @@ namespace ASDCP {
        QuantizationDefault_t QuantizationDefault;
       };
 
+      // Print debugging information to std::ostream
+      std::ostream& operator << (std::ostream& strm, const PictureDescriptor& pdesc);
       // Print debugging information to stream (stderr default)
       void   PictureDescriptorDump(const PictureDescriptor&, FILE* = 0);
 
@@ -1229,6 +1244,7 @@ namespace ASDCP {
        };
     } // namespace JP2K
 
+  //---------------------------------------------------------------------------------
   //
   namespace TimedText
     {
@@ -1256,6 +1272,8 @@ namespace ASDCP {
       TimedTextDescriptor() : ContainerDuration(0), EncodingName("UTF-8") {} // D-Cinema format is always UTF-8
       };
 
+      // Print debugging information to std::ostream
+      std::ostream& operator << (std::ostream& strm, const TimedTextDescriptor& tinfo);
       // Print debugging information to stream (stderr default)
       void   DescriptorDump(const TimedTextDescriptor&, FILE* = 0);