Take pkl_type out of MXF.
authorCarl Hetherington <cth@carlh.net>
Thu, 4 Jun 2015 17:10:12 +0000 (18:10 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 Jun 2015 13:34:44 +0000 (14:34 +0100)
src/mxf.cc
src/mxf.h
src/picture_mxf.cc
src/picture_mxf.h
src/sound_mxf.cc
src/sound_mxf.h

index 756f099a2e8d8b31d0144c4f2535d7a5d601446a..93ff89a5fac03acc68c6628d870e24a88d4783b7 100644 (file)
@@ -153,16 +153,3 @@ MXF::read_writer_info (ASDCP::WriterInfo const & info)
        Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer));
        _id = buffer;
 }
-
-string
-MXF::pkl_type (Standard standard) const
-{
-       switch (standard) {
-       case INTEROP:
-               return String::compose ("application/x-smpte-mxf;asdcpKind=%1", asdcp_kind ());
-       case SMPTE:
-               return "application/mxf";
-       default:
-               DCP_ASSERT (false);
-       }
-}
index 65b399b653a424cf9028ff0b2f576ee26b86886a..068b603633d1905e77fdac54339f84f0a4f67097 100644 (file)
--- a/src/mxf.h
+++ b/src/mxf.h
@@ -107,8 +107,6 @@ public:
 protected:
        friend class MXFWriter;
 
-       virtual std::string asdcp_kind () const = 0;
-       std::string pkl_type (Standard standard) const;
        void read_writer_info (ASDCP::WriterInfo const &);
        
        ASDCP::AESEncContext* _encryption_context;
index f3a1cd0b610f9284b64c8440688013bd6197ef18..a0de9c6489bd8096430e0fe9709a2d7c71a3aa00 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 #include "exceptions.h"
 #include "xyz_image.h"
 #include "picture_mxf_writer.h"
+#include "dcp_assert.h"
 #include "compose.hpp"
 #include "AS_DCP.h"
 #include "KM_fileio.h"
@@ -186,3 +187,16 @@ PictureMXF::frame_buffer_equals (
 
        return true;
 }
+
+string
+PictureMXF::pkl_type (Standard standard) const
+{
+       switch (standard) {
+       case INTEROP:
+               return "application/x-smpte-mxf;asdcpKind=Picture";
+       case SMPTE:
+               return "application/mxf";
+       default:
+               DCP_ASSERT (false);
+       }
+}
index f2c3192ebb74fc0dbdd0690a1bc54da3a3a9653e..fa7936ac2040543af3098d137b6cb44e6466c375 100644 (file)
@@ -117,9 +117,7 @@ protected:
        Fraction _screen_aspect_ratio;
 
 private:
-       std::string asdcp_kind () const {
-               return "Picture";
-       }
+       std::string pkl_type (Standard standard) const;
 };
        
 
index 6e952bd0d34514d9ccfd975972eadc3281ab4a9c..5008da4687072a207bac96e80087daccc1104b98 100644 (file)
@@ -29,6 +29,7 @@
 #include "compose.hpp"
 #include "KM_fileio.h"
 #include "AS_DCP.h"
+#include "dcp_assert.h"
 #include <libxml++/nodes/element.h>
 #include <boost/filesystem.hpp>
 #include <iostream>
@@ -172,3 +173,16 @@ SoundMXF::start_write (boost::filesystem::path file, Standard standard)
        /* XXX: can't we use a shared_ptr here? */
        return shared_ptr<SoundMXFWriter> (new SoundMXFWriter (this, file, standard));
 }
+
+string
+SoundMXF::pkl_type (Standard standard) const
+{
+       switch (standard) {
+       case INTEROP:
+               return "application/x-smpte-mxf;asdcpKind=Sound";
+       case SMPTE:
+               return "application/mxf";
+       default:
+               DCP_ASSERT (false);
+       }
+}
index a8746311c33636f1e549a473860602c0acb1fb25..42ca2c673967208e95eb25e2003213f6a0ba4ae2 100644 (file)
@@ -74,9 +74,7 @@ public:
 private:
        friend class SoundMXFWriter;
        
-       std::string asdcp_kind () const {
-               return "Sound";
-       }
+       std::string pkl_type (Standard standard) const;
 
        Fraction _edit_rate;
        /** The total length of this content in video frames.  The amount of