Add SMPTESubtitleContent::valid_mxf.
authorCarl Hetherington <cth@carlh.net>
Wed, 21 Jan 2015 19:36:31 +0000 (19:36 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 21 Jan 2015 19:36:31 +0000 (19:36 +0000)
src/smpte_subtitle_content.cc
src/smpte_subtitle_content.h

index 910219cb583bcda14669fd5a1c180027467b19d0..4435fe23929c0f5ed4c2236b464e42a3e284d583 100644 (file)
@@ -84,3 +84,11 @@ SMPTESubtitleContent::load_font_nodes () const
        copy (_load_font_nodes.begin(), _load_font_nodes.end(), back_inserter (lf));
        return lf;
 }
+
+bool
+SMPTESubtitleContent::valid_mxf (boost::filesystem::path file)
+{
+       ASDCP::TimedText::MXFReader reader;
+       Kumu::Result_t r = reader.OpenRead (file.string().c_str ());
+       return !ASDCP_FAILURE (r);
+}
index 8faea817b9da8069b480afc0cd65b4cb41ed8647..a47cbb3c20b8eb8d4942185ea8ce1fbf75df9f8b 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
@@ -18,6 +18,7 @@
 */
 
 #include "subtitle_content.h"
+#include <boost/filesystem.hpp>
 
 namespace dcp {
 
@@ -32,6 +33,8 @@ public:
        SMPTESubtitleContent (boost::filesystem::path file, bool mxf = true);
 
        std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const;
+
+       static bool valid_mxf (boost::filesystem::path);
        
 private:
        std::list<boost::shared_ptr<SMPTELoadFont> > _load_font_nodes;