summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2011-07-27 21:01:49 +0000
committerjhurst <>2011-07-27 21:01:49 +0000
commit23f5d8c9bae5c51cfa084a006a6f589cf97ae001 (patch)
tree6d91ee70ecddf4b7d7f615799c94b47d5a4c98bc
parent0a815c035a2cc3742507aebd059d5c042a111527 (diff)
high frame rate stereo
-rwxr-xr-xsrc/AS_DCP.h3
-rwxr-xr-xsrc/AS_DCP_JP2K.cpp47
-rwxr-xr-xsrc/KM_util.h5
-rw-r--r--src/KM_xml.cpp12
-rw-r--r--src/KM_xml.h7
-rwxr-xr-xsrc/asdcp-test.cpp6
6 files changed, 69 insertions, 11 deletions
diff --git a/src/AS_DCP.h b/src/AS_DCP.h
index 136671c..29f07c0 100755
--- a/src/AS_DCP.h
+++ b/src/AS_DCP.h
@@ -274,6 +274,9 @@ namespace ASDCP {
const Rational EditRate_30 = Rational(30,1);
const Rational EditRate_50 = Rational(50,1);
const Rational EditRate_60 = Rational(60,1);
+ const Rational EditRate_96 = Rational(96,1);
+ const Rational EditRate_100 = Rational(100,1);
+ const Rational EditRate_120 = Rational(120,1);
// Non-reference counting container for internal member objects.
// Please do not use this class for any other purpose.
diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp
index b8a156e..72b975d 100755
--- a/src/AS_DCP_JP2K.cpp
+++ b/src/AS_DCP_JP2K.cpp
@@ -315,7 +315,12 @@ lh__Reader::OpenRead(const char* filename, EssenceType_t type)
DefaultLogSink().Warn("EditRate and SampleRate do not match (%.03f, %.03f).\n",
m_EditRate.Quotient(), m_SampleRate.Quotient());
- if ( m_EditRate == EditRate_24 && m_SampleRate == EditRate_48 )
+ if ( m_EditRate == EditRate_24 && m_SampleRate == EditRate_48 ||
+ m_EditRate == EditRate_25 && m_SampleRate == EditRate_50 ||
+ m_EditRate == EditRate_30 && m_SampleRate == EditRate_60 ||
+ m_EditRate == EditRate_48 && m_SampleRate == EditRate_96 ||
+ m_EditRate == EditRate_50 && m_SampleRate == EditRate_100 ||
+ m_EditRate == EditRate_60 && m_SampleRate == EditRate_120 )
{
DefaultLogSink().Debug("File may contain JPEG Interop stereoscopic images.\n");
return RESULT_SFORMAT;
@@ -350,6 +355,30 @@ lh__Reader::OpenRead(const char* filename, EssenceType_t type)
return RESULT_FORMAT;
}
}
+ else if ( m_EditRate == EditRate_48 )
+ {
+ if ( m_SampleRate != EditRate_96 )
+ {
+ DefaultLogSink().Error("EditRate and SampleRate not correct for 48/96 stereoscopic essence.\n");
+ return RESULT_FORMAT;
+ }
+ }
+ else if ( m_EditRate == EditRate_50 )
+ {
+ if ( m_SampleRate != EditRate_100 )
+ {
+ DefaultLogSink().Error("EditRate and SampleRate not correct for 50/100 stereoscopic essence.\n");
+ return RESULT_FORMAT;
+ }
+ }
+ else if ( m_EditRate == EditRate_60 )
+ {
+ if ( m_SampleRate != EditRate_120 )
+ {
+ DefaultLogSink().Error("EditRate and SampleRate not correct for 60/120 stereoscopic essence.\n");
+ return RESULT_FORMAT;
+ }
+ }
else
{
DefaultLogSink().Error("EditRate not correct for stereoscopic essence: %d/%d.\n",
@@ -1064,9 +1093,12 @@ ASDCP::JP2K::MXFSWriter::OpenWrite(const char* filename, const WriterInfo& Info,
if ( PDesc.EditRate != ASDCP::EditRate_24
&& PDesc.EditRate != ASDCP::EditRate_25
- && PDesc.EditRate != ASDCP::EditRate_30 )
+ && PDesc.EditRate != ASDCP::EditRate_30
+ && PDesc.EditRate != ASDCP::EditRate_48
+ && PDesc.EditRate != ASDCP::EditRate_50
+ && PDesc.EditRate != ASDCP::EditRate_60 )
{
- DefaultLogSink().Error("Stereoscopic wrapping requires 24, 25 or 30 fps input streams.\n");
+ DefaultLogSink().Error("Stereoscopic wrapping requires 24, 25, 30, 48, 50 or 60 fps input streams.\n");
return RESULT_FORMAT;
}
@@ -1090,6 +1122,15 @@ ASDCP::JP2K::MXFSWriter::OpenWrite(const char* filename, const WriterInfo& Info,
else if ( PDesc.EditRate == ASDCP::EditRate_30 )
TmpPDesc.EditRate = ASDCP::EditRate_60;
+ else if ( PDesc.EditRate == ASDCP::EditRate_48 )
+ TmpPDesc.EditRate = ASDCP::EditRate_96;
+
+ else if ( PDesc.EditRate == ASDCP::EditRate_50 )
+ TmpPDesc.EditRate = ASDCP::EditRate_100;
+
+ else if ( PDesc.EditRate == ASDCP::EditRate_60 )
+ TmpPDesc.EditRate = ASDCP::EditRate_120;
+
result = m_Writer->SetSourceStream(TmpPDesc, JP2K_S_PACKAGE_LABEL, PDesc.EditRate);
}
diff --git a/src/KM_util.h b/src/KM_util.h
index 0b37e38..871a554 100755
--- a/src/KM_util.h
+++ b/src/KM_util.h
@@ -519,6 +519,11 @@ namespace Kumu
}
};
+ inline void hexdump(const ByteString& buf, FILE* stream = 0) {
+ hexdump(buf.RoData(), buf.Length());
+ }
+
+
} // namespace Kumu
diff --git a/src/KM_xml.cpp b/src/KM_xml.cpp
index 44442d2..ad31ce8 100644
--- a/src/KM_xml.cpp
+++ b/src/KM_xml.cpp
@@ -499,7 +499,7 @@ xph_namespace_start(void* p, const XML_Char* ns_prefix, const XML_Char* ns_name)
//
bool
-Kumu::XMLElement::ParseString(const std::string& document)
+Kumu::XMLElement::ParseString(const char* document, ui32_t doc_len)
{
XML_Parser Parser = XML_ParserCreateNS("UTF-8", '|');
@@ -515,7 +515,7 @@ Kumu::XMLElement::ParseString(const std::string& document)
XML_SetCharacterDataHandler(Parser, xph_char);
XML_SetStartNamespaceDeclHandler(Parser, xph_namespace_start);
- if ( ! XML_Parse(Parser, document.c_str(), document.size(), 1) )
+ if ( ! XML_Parse(Parser, document, doc_len, 1) )
{
XML_ParserFree(Parser);
DefaultLogSink().Error("XML Parse error on line %d: %s\n",
@@ -878,9 +878,9 @@ public:
//
bool
-Kumu::XMLElement::ParseString(const std::string& document)
+Kumu::XMLElement::ParseString(const char* document, ui32_t doc_len)
{
- if ( document.empty() )
+ if ( doc_len == 0 )
return false;
init_xml_dom();
@@ -897,8 +897,8 @@ Kumu::XMLElement::ParseString(const std::string& document)
try
{
- MemBufInputSource xmlSource(reinterpret_cast<const XMLByte*>(document.c_str()),
- static_cast<const unsigned int>(document.size()),
+ MemBufInputSource xmlSource(reinterpret_cast<const XMLByte*>(document),
+ static_cast<const unsigned int>(doc_len),
"pidc_rules_file");
parser->parse(xmlSource);
diff --git a/src/KM_xml.h b/src/KM_xml.h
index 8e02596..6652f2d 100644
--- a/src/KM_xml.h
+++ b/src/KM_xml.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2005-2009, John Hurst
+Copyright (c) 2005-2011, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -96,13 +96,16 @@ namespace Kumu
inline const XMLNamespace* Namespace() const { return m_Namespace; }
inline void SetNamespace(const XMLNamespace* ns) { assert(ns); m_Namespace = ns; }
- bool ParseString(const std::string& document);
+ bool ParseString(const char* document, ui32_t doc_len);
+ bool ParseString(const ByteString& document) { return ParseString((const char*)document.RoData(), document.Length()); }
+ bool ParseString(const std::string& document) { return ParseString(document.c_str(), document.size()); }
// building
void SetName(const char* name);
void SetBody(const std::string& value);
void AppendBody(const std::string& value);
void SetAttr(const char* name, const char* value);
+ void SetAttr(const char* name, const std::string& value) { SetAttr(name, value.c_str()); }
XMLElement* AddChild(XMLElement* element);
XMLElement* AddChild(const char* name);
XMLElement* AddChildWithContent(const char* name, const char* value);
diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp
index babbf4f..624c18b 100755
--- a/src/asdcp-test.cpp
+++ b/src/asdcp-test.cpp
@@ -298,6 +298,9 @@ public:
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;
}
@@ -311,6 +314,9 @@ public:
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";
}