summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2019-02-12 09:13:35 -0800
committerjhurst <jhurst@cinecert.com>2019-02-12 09:13:35 -0800
commit260692554632887d4e978775001081add386b909 (patch)
treed306055c36bcb6839c5e0ea6bd62ef83440c2abd /src
parent94933bbbea5bdb424f1b2d1aa21e5e69805358cd (diff)
o Fixed ISXD bugs:
o Incorrect UTF_8_Text_DataEssenceCoding UL o Incorrect ISXDDataEssenceDescriptor_NamespaceURI UL o Incorrect use of FrameWrappedISXDData UL o Incorrect use of FrameWrappedISXDContainer UL o Added KM_WIN32_UTF8 macro to protect old users from new ideas
Diffstat (limited to 'src')
-rw-r--r--src/AS_02_ISXD.cpp4
-rw-r--r--src/KM_fileio.cpp14
-rwxr-xr-xsrc/KM_fileio.h2
-rw-r--r--src/MDD.cpp6
-rwxr-xr-xsrc/as-02-wrap.cpp4
5 files changed, 22 insertions, 8 deletions
diff --git a/src/AS_02_ISXD.cpp b/src/AS_02_ISXD.cpp
index 1483bfb..f4e29c0 100644
--- a/src/AS_02_ISXD.cpp
+++ b/src/AS_02_ISXD.cpp
@@ -289,7 +289,7 @@ AS_02::ISXD::MXFWriter::h__Writer::OpenWrite(const std::string& filename, const
const ui32_t& PartitionSpace_sec, const ui32_t& HeaderSize)
{
m_DataEssenceDescriptor = new ISXDDataEssenceDescriptor(m_Dict);
- m_DataEssenceDescriptor->DataEssenceCoding = m_Dict->ul(MDD_FrameWrappedISXDContainer);
+ m_DataEssenceDescriptor->DataEssenceCoding = m_Dict->ul(MDD_UTF_8_Text_DataEssenceCoding);
m_DataEssenceDescriptor->SampleRate = edit_rate;
m_DataEssenceDescriptor->NamespaceURI = isxd_document_namespace;
@@ -336,7 +336,7 @@ AS_02::ISXD::MXFWriter::h__Writer::SetSourceStream(const std::string& label, con
if ( KM_SUCCESS(result) )
{
- result = WriteAS02Header(label, UL(m_Dict->ul(MDD_FrameWrappedISXDData)),
+ result = WriteAS02Header(label, UL(m_Dict->ul(MDD_FrameWrappedISXDContainer)),
PICT_DEF_LABEL, UL(m_EssenceUL), UL(m_Dict->ul(MDD_DataDataDef)),
edit_rate, derive_timecode_rate_from_edit_rate(edit_rate));
diff --git a/src/KM_fileio.cpp b/src/KM_fileio.cpp
index 0dfa473..07c649f 100644
--- a/src/KM_fileio.cpp
+++ b/src/KM_fileio.cpp
@@ -762,6 +762,7 @@ Kumu::FileWriter::Writev(const byte_t* buf, ui32_t buf_len)
#ifdef KM_WIN32
+#ifdef KM_WIN32_UTF8
//
Kumu::Result_t
@@ -808,6 +809,7 @@ Kumu::utf8_to_wbstr(const std::string& in, Kumu::ByteString& out)
return RESULT_OK;
}
+#endif // KM_WIN32_UTF8
//------------------------------------------------------------------------------------------
//
@@ -816,6 +818,7 @@ Kumu::Result_t
Kumu::FileReader::OpenRead(const std::string& filename) const
{
const_cast<FileReader*>(this)->m_Filename = filename;
+#ifdef KM_WIN32_UTF8
ByteString wb_filename;
Result_t result = utf8_to_wbstr(m_Filename, wb_filename);
@@ -823,12 +826,17 @@ Kumu::FileReader::OpenRead(const std::string& filename) const
{
return result;
}
+#endif
// suppress popup window on error
UINT prev = ::SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
+#ifdef KM_WIN32_UTF8
const_cast<FileReader*>(this)->m_Handle =
::CreateFileW((wchar_t*)wb_filename.RoData(),
+#else
+ const_cast<FileReader*>(this)->m_Handle = ::CreateFileA(filename.c_str(),
+#endif
(GENERIC_READ), // open for reading
FILE_SHARE_READ, // share for reading
NULL, // no security
@@ -949,6 +957,7 @@ Kumu::Result_t
Kumu::FileWriter::OpenWrite(const std::string& filename)
{
m_Filename = filename;
+#ifdef KM_WIN32_UTF8
ByteString wb_filename;
Result_t result = utf8_to_wbstr(m_Filename, wb_filename);
@@ -956,11 +965,16 @@ Kumu::FileWriter::OpenWrite(const std::string& filename)
{
return result;
}
+#endif
// suppress popup window on error
UINT prev = ::SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
+#ifdef KM_WIN32_UTF8
m_Handle = ::CreateFileW((wchar_t*)wb_filename.RoData(),
+#else
+ m_Handle = ::CreateFileA(filename.c_str(),
+#endif
(GENERIC_WRITE|GENERIC_READ), // open for reading
FILE_SHARE_READ, // share for reading
NULL, // no security
diff --git a/src/KM_fileio.h b/src/KM_fileio.h
index bf258e6..60e1e6a 100755
--- a/src/KM_fileio.h
+++ b/src/KM_fileio.h
@@ -300,7 +300,7 @@ namespace Kumu
Result_t WriteBufferIntoFile(const Kumu::ByteString& Buffer, const std::string& Filename);
-#ifdef KM_WIN32
+#ifdef KM_WIN32_UTF8
//------------------------------------------------------------------------------------------
// wide char support for win32 file I/O
//------------------------------------------------------------------------------------------
diff --git a/src/MDD.cpp b/src/MDD.cpp
index bdd9eb9..7a284e4 100644
--- a/src/MDD.cpp
+++ b/src/MDD.cpp
@@ -1538,13 +1538,13 @@ static const ASDCP::MDDEntry s_MDD_Table[] = {
0x0e, 0x09, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00 },
{0}, false, "ISXDDataEssenceDescriptor" },
{ { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x05, // 495
- 0x0e, 0x09, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 },
+ 0x0e, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 },
{0}, false, "ISXDDataEssenceDescriptor_NamespaceURI" },
{ { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x05, // 496
- 0x0e, 0x09, 0x06, 0x06, 0x00, 0x00, 0x00, 0xff },
+ 0x0e, 0x09, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 },
{0}, false, "UTF_8_Text_DataEssenceCoding" },
{ { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, // 497-chk
- 0x0D, 0x01, 0x04, 0x01, 0x04, 0x01, 0x01, 0x00 },
+ 0x0d, 0x01, 0x04, 0x01, 0x04, 0x01, 0x01, 0x00 },
{0}, false, "TextBasedDMFramework" },
{ { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x0D, // 498-chk
0x06, 0x01, 0x01, 0x04, 0x05, 0x41, 0x01, 0x00 },
diff --git a/src/as-02-wrap.cpp b/src/as-02-wrap.cpp
index 204feb0..de13d95 100755
--- a/src/as-02-wrap.cpp
+++ b/src/as-02-wrap.cpp
@@ -176,8 +176,8 @@ Options:\n\
-t <min> - Set RGB component minimum code value (default: 0)\n\
-T <max> - Set RGB component maximum code value (default: 1023)\n\
-u - Print UL catalog to stdout\n\
- -u <URI> - ISXD (RDD47) document URI (use 'auto' to read the\n\
- namespace name from the first edit unit\n\
+ -U <URI> - ISXD (RDD47) document URI (use 'auto' to read the\n\
+ namespace name from the first edit unit)\n\
-v - Verbose, prints informative messages to stderr\n\
-W - Read input file only, do not write source file\n\
-x <int> - Horizontal subsampling degree (default: 2)\n\