summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/AS_DCP_JP2K.cpp27
-rwxr-xr-xsrc/AS_DCP_MPEG2.cpp46
-rwxr-xr-xsrc/AS_DCP_PCM.cpp13
-rw-r--r--src/AS_DCP_TimedText.cpp16
-rwxr-xr-xsrc/JP2K_Sequence_Parser.cpp6
-rwxr-xr-xsrc/KLV.h1
-rwxr-xr-xsrc/KM_util.cpp10
-rw-r--r--src/MDD.cpp2
-rwxr-xr-xsrc/MXFTypes.cpp26
-rw-r--r--src/Makefile.am2
-rwxr-xr-xsrc/PCM_Parser.cpp2
11 files changed, 144 insertions, 7 deletions
diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp
index 811ece6..b8a156e 100755
--- a/src/AS_DCP_JP2K.cpp
+++ b/src/AS_DCP_JP2K.cpp
@@ -498,6 +498,19 @@ ASDCP::JP2K::MXFReader::DumpIndex(FILE* stream) const
m_Reader->m_FooterPart.Dump(stream);
}
+//
+ASDCP::Result_t
+ASDCP::JP2K::MXFReader::Close() const
+{
+ if ( m_Reader && m_Reader->m_File.IsOpen() )
+ {
+ m_Reader->Close();
+ return RESULT_OK;
+ }
+
+ return RESULT_INIT;
+}
+
//------------------------------------------------------------------------------------------
@@ -675,6 +688,20 @@ ASDCP::JP2K::MXFSReader::DumpIndex(FILE* stream) const
m_Reader->m_FooterPart.Dump(stream);
}
+//
+ASDCP::Result_t
+ASDCP::JP2K::MXFSReader::Close() const
+{
+ if ( m_Reader && m_Reader->m_File.IsOpen() )
+ {
+ m_Reader->Close();
+ return RESULT_OK;
+ }
+
+ return RESULT_INIT;
+}
+
+
//------------------------------------------------------------------------------------------
diff --git a/src/AS_DCP_MPEG2.cpp b/src/AS_DCP_MPEG2.cpp
index 5bd998c..252c1fa 100755
--- a/src/AS_DCP_MPEG2.cpp
+++ b/src/AS_DCP_MPEG2.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2004-2010, John Hurst
+Copyright (c) 2004-2011, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,7 @@ public:
Result_t ReadFrame(ui32_t, FrameBuffer&, AESDecContext*, HMACContext*);
Result_t ReadFrameGOPStart(ui32_t, FrameBuffer&, AESDecContext*, HMACContext*);
Result_t FindFrameGOPStart(ui32_t, ui32_t&);
+ Result_t FrameType(ui32_t FrameNum, FrameType_t& type);
};
@@ -245,6 +246,26 @@ ASDCP::MPEG2::MXFReader::h__Reader::FindFrameGOPStart(ui32_t FrameNum, ui32_t& K
return RESULT_OK;
}
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::h__Reader::FrameType(ui32_t FrameNum, FrameType_t& type)
+{
+ if ( ! m_File.IsOpen() )
+ return RESULT_INIT;
+
+ // look up frame index node
+ IndexTableSegment::IndexEntry TmpEntry;
+
+ if ( ASDCP_FAILURE(m_FooterPart.Lookup(FrameNum, TmpEntry)) )
+ {
+ DefaultLogSink().Error("Frame value out of range: %u\n", FrameNum);
+ return RESULT_RANGE;
+ }
+
+ type = ( (TmpEntry.Flags & 0x0f) == 3 ) ? FRAME_B : ( (TmpEntry.Flags & 0x0f) == 2 ) ? FRAME_P : FRAME_I;
+ return RESULT_OK;
+}
+
//
//
@@ -403,6 +424,29 @@ ASDCP::MPEG2::MXFReader::DumpIndex(FILE* stream) const
m_Reader->m_FooterPart.Dump(stream);
}
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::Close() const
+{
+ if ( m_Reader && m_Reader->m_File.IsOpen() )
+ {
+ m_Reader->Close();
+ return RESULT_OK;
+ }
+
+ return RESULT_INIT;
+}
+
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::FrameType(ui32_t FrameNum, FrameType_t& type) const
+{
+ if ( ! m_Reader )
+ return RESULT_INIT;
+
+ return m_Reader->FrameType(FrameNum, type);
+}
+
//------------------------------------------------------------------------------------------
diff --git a/src/AS_DCP_PCM.cpp b/src/AS_DCP_PCM.cpp
index 635c176..f93815b 100755
--- a/src/AS_DCP_PCM.cpp
+++ b/src/AS_DCP_PCM.cpp
@@ -373,6 +373,19 @@ ASDCP::PCM::MXFReader::DumpIndex(FILE* stream) const
m_Reader->m_FooterPart.Dump(stream);
}
+//
+ASDCP::Result_t
+ASDCP::PCM::MXFReader::Close() const
+{
+ if ( m_Reader && m_Reader->m_File.IsOpen() )
+ {
+ m_Reader->Close();
+ return RESULT_OK;
+ }
+
+ return RESULT_INIT;
+}
+
//------------------------------------------------------------------------------------------
diff --git a/src/AS_DCP_TimedText.cpp b/src/AS_DCP_TimedText.cpp
index c13b447..f7d64bd 100644
--- a/src/AS_DCP_TimedText.cpp
+++ b/src/AS_DCP_TimedText.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2008-2009, John Hurst
+Copyright (c) 2008-2011, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -431,6 +431,20 @@ ASDCP::TimedText::MXFReader::DumpIndex(FILE* stream) const
m_Reader->m_FooterPart.Dump(stream);
}
+//
+ASDCP::Result_t
+ASDCP::TimedText::MXFReader::Close() const
+{
+ if ( m_Reader && m_Reader->m_File.IsOpen() )
+ {
+ m_Reader->Close();
+ return RESULT_OK;
+ }
+
+ return RESULT_INIT;
+}
+
+
//------------------------------------------------------------------------------------------
diff --git a/src/JP2K_Sequence_Parser.cpp b/src/JP2K_Sequence_Parser.cpp
index 044ed46..c33321e 100755
--- a/src/JP2K_Sequence_Parser.cpp
+++ b/src/JP2K_Sequence_Parser.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2004-2009, John Hurst
+Copyright (c) 2004-2011, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,9 @@ public:
std::string Str(m_DirName);
Str += "/";
Str += next_file;
- push_back(Str);
+
+ if ( ! Kumu::PathIsDirectory(Str) )
+ push_back(Str);
}
sort();
diff --git a/src/KLV.h b/src/KLV.h
index a79ea91..1b378f0 100755
--- a/src/KLV.h
+++ b/src/KLV.h
@@ -106,6 +106,7 @@ inline const char* ui64sz(ui64_t i, char* buf)
virtual ~UL() {}
const char* EncodeString(char* str_buf, ui32_t buf_len) const;
+ bool operator==(const UL& rhs) const;
};
// UMID
diff --git a/src/KM_util.cpp b/src/KM_util.cpp
index 8e4fa7c..b84f7f5 100755
--- a/src/KM_util.cpp
+++ b/src/KM_util.cpp
@@ -970,6 +970,16 @@ Kumu::Timestamp::Timestamp(const Timestamp& rhs) : IArchive()
Second = rhs.Second;
}
+//
+Kumu::Timestamp::Timestamp(const char* datestr) : IArchive()
+{
+ if ( ! DecodeString(datestr) )
+ {
+ *this = Timestamp();
+ }
+}
+
+//
Kumu::Timestamp::~Timestamp()
{
}
diff --git a/src/MDD.cpp b/src/MDD.cpp
index aa53e35..e8e5b7d 100644
--- a/src/MDD.cpp
+++ b/src/MDD.cpp
@@ -803,7 +803,7 @@ static const ASDCP::MDDEntry s_MDD_Table[] = {
{ { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0a, // 255
0x0d, 0x01, 0x03, 0x01, 0x02, 0x13, 0x01, 0x01 },
{0}, false, "TimedTextWrapping" },
- { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01, 0x09, // 256
+ { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01, 0x01, // 256
0x0d, 0x01, 0x03, 0x01, 0x17, 0x01, 0x0b, 0x01 },
{0}, false, "TimedTextEssence" },
{ { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, // 257
diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp
index b9b2bd9..a76957f 100755
--- a/src/MXFTypes.cpp
+++ b/src/MXFTypes.cpp
@@ -38,6 +38,32 @@ using Kumu::DefaultLogSink;
//------------------------------------------------------------------------------------------
//
+bool
+ASDCP::UL::operator==(const UL& rhs) const
+{
+ if ( m_Value[0] == rhs.m_Value[0] &&
+ m_Value[1] == rhs.m_Value[1] &&
+ m_Value[2] == rhs.m_Value[2] &&
+ m_Value[3] == rhs.m_Value[3] &&
+ m_Value[4] == rhs.m_Value[4] &&
+ m_Value[5] == rhs.m_Value[5] &&
+ m_Value[6] == rhs.m_Value[6] &&
+ // m_Value[7] == rhs.m_Value[7] && version is ignored when performing lookups
+ m_Value[8] == rhs.m_Value[8] &&
+ m_Value[9] == rhs.m_Value[9] &&
+ m_Value[10] == rhs.m_Value[10] &&
+ m_Value[11] == rhs.m_Value[11] &&
+ m_Value[12] == rhs.m_Value[12] &&
+ m_Value[13] == rhs.m_Value[13] &&
+ m_Value[14] == rhs.m_Value[14] &&
+ m_Value[15] == rhs.m_Value[15]
+ )
+ return true;
+
+ return false;
+}
+
+
const char*
ASDCP::UL::EncodeString(char* str_buf, ui32_t buf_len) const
{
diff --git a/src/Makefile.am b/src/Makefile.am
index de85899..c8f18e7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,7 +40,7 @@ endif
# list of all the header files that should be installed
include_HEADERS = KM_error.h KM_fileio.h KM_log.h KM_memio.h KM_mutex.h \
- KM_platform.h KM_prng.h KM_util.h KM_xml.h AS_DCP.h
+ KM_platform.h KM_prng.h KM_util.h KM_tai.h KM_xml.h AS_DCP.h
if DEV_HEADERS
include_HEADERS += S12MTimecode.h MDD.h Metadata.h KLV.h MXFTypes.h MXF.h Wav.h \
PCMParserList.h
diff --git a/src/PCM_Parser.cpp b/src/PCM_Parser.cpp
index 2f96d23..3fa6d7d 100755
--- a/src/PCM_Parser.cpp
+++ b/src/PCM_Parser.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2004-2009, John Hurst
+Copyright (c) 2004-2011, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without