summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2021-11-10 12:51:41 -0800
committerjhurst <jhurst@cinecert.com>2021-11-10 12:51:41 -0800
commitfeba38c3802863fe783a750e0f866af9ad834f7f (patch)
treea01d3175a4555200c94d4b712f9b98dd8507b34a /src
parentcb71c195e60f12b5827e5087d12d4af94845e7af (diff)
Added a new UL matching operator MatchIgnorePlaceholder()
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Dict.cpp6
-rwxr-xr-xsrc/KLV.h3
-rwxr-xr-xsrc/MXFTypes.cpp28
3 files changed, 34 insertions, 3 deletions
diff --git a/src/Dict.cpp b/src/Dict.cpp
index 752b81a..d890f83 100755
--- a/src/Dict.cpp
+++ b/src/Dict.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2006-2018, John Hurst
+Copyright (c) 2006-2021, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -322,6 +322,10 @@ ASDCP::Dictionary::FindULAnyVersion(const byte_t* ul_buf) const
{
found_entry = &m_MDD_Table[lower->second];
}
+ else if ( found_entry == 0 && lower->first.MatchIgnorePlaceholder(target) )
+ {
+ found_entry = &m_MDD_Table[lower->second];
+ }
else if ( found_entry != 0 && ! lower->first.MatchIgnoreStream(target) )
{
break;
diff --git a/src/KLV.h b/src/KLV.h
index 727efb0..6eca9d0 100755
--- a/src/KLV.h
+++ b/src/KLV.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2005-2018, John Hurst
+Copyright (c) 2005-2021, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -109,6 +109,7 @@ inline const char* ui64sz(ui64_t i, char* buf)
bool operator==(const UL& rhs) const;
bool MatchIgnoreStream(const UL& rhs) const;
bool MatchExact(const UL& rhs) const;
+ bool MatchIgnorePlaceholder(const UL& rhs) const;
};
// UMID
diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp
index 58fb184..19e70ca 100755
--- a/src/MXFTypes.cpp
+++ b/src/MXFTypes.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2005-2019, John Hurst
+Copyright (c) 2005-2021, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -93,6 +93,32 @@ ASDCP::UL::MatchIgnoreStream(const UL& rhs) const
//
bool
+ASDCP::UL::MatchIgnorePlaceholder(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] == 0x7f || m_Value[4] == rhs.m_Value[4] ) &&
+ ( m_Value[5] == 0x7f || m_Value[5] == rhs.m_Value[5] ) &&
+ ( m_Value[6] == 0x7f || m_Value[6] == rhs.m_Value[6] ) &&
+ // m_Value[7] == rhs.m_Value[7] && // version is ignored when performing lookups
+ ( m_Value[8] == 0x7f || m_Value[8] == rhs.m_Value[8] ) &&
+ ( m_Value[9] == 0x7f || m_Value[9] == rhs.m_Value[9] ) &&
+ ( m_Value[10] == 0x7f || m_Value[10] == rhs.m_Value[10] ) &&
+ ( m_Value[11] == 0x7f || m_Value[11] == rhs.m_Value[11] ) &&
+ ( m_Value[12] == 0x7f || m_Value[12] == rhs.m_Value[12] ) &&
+ ( m_Value[13] == 0x7f || m_Value[13] == rhs.m_Value[13] ) &&
+ ( m_Value[14] == 0x7f || m_Value[14] == rhs.m_Value[14] ) &&
+ ( m_Value[15] == 0x7f || m_Value[15] == rhs.m_Value[15] )
+ )
+ return true;
+
+ return false;
+}
+
+//
+bool
ASDCP::UL::MatchExact(const UL& rhs) const
{
if ( m_Value[0] == rhs.m_Value[0] &&