summaryrefslogtreecommitdiff
path: root/src/MXF.cpp
diff options
context:
space:
mode:
authorJohn Hurst <jhurst@cinecert.com>2023-07-31 07:59:31 -0700
committerJohn Hurst <jhurst@cinecert.com>2023-07-31 07:59:31 -0700
commit017b179b97e034981f803591070b886f3a9e70bb (patch)
tree59b2d2ebb4e4af1275fe784c6c08d9427839ba9f /src/MXF.cpp
parent765ff525559eb6f7dd0d9e7a899be313775e7b2e (diff)
feat: added DeleteMDObjectByID() to MXF header and footer classes
Diffstat (limited to 'src/MXF.cpp')
-rwxr-xr-xsrc/MXF.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp
index c961727..ebb3013 100755
--- a/src/MXF.cpp
+++ b/src/MXF.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2005-2021, John Hurst
+Copyright (c) 2005-2022, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -223,6 +223,22 @@ ASDCP::MXF::Partition::PacketList::GetMDObjectByID(const UUID& ObjectID, Interch
//
ASDCP::Result_t
+ASDCP::MXF::Partition::PacketList::DeleteMDObjectByID(const UUID& ObjectID)
+{
+ std::map<UUID, InterchangeObject*>::iterator mi = m_Map.find(ObjectID);
+
+ if ( mi == m_Map.end() )
+ {
+ return RESULT_FAIL;
+ }
+
+ delete (*mi).second;
+ m_Map.erase(mi);
+ return RESULT_OK;
+}
+
+//
+ASDCP::Result_t
ASDCP::MXF::Partition::PacketList::GetMDObjectByType(const byte_t* ObjectID, InterchangeObject** Object)
{
ASDCP_TEST_NULL(ObjectID);
@@ -885,6 +901,7 @@ ASDCP::MXF::OP1aHeader::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
+//
ASDCP::Result_t
ASDCP::MXF::OP1aHeader::GetMDObjectByID(const UUID& ObjectID, InterchangeObject** Object)
{
@@ -893,6 +910,13 @@ ASDCP::MXF::OP1aHeader::GetMDObjectByID(const UUID& ObjectID, InterchangeObject*
//
ASDCP::Result_t
+ASDCP::MXF::OP1aHeader::DeleteMDObjectByID(const UUID& ObjectID)
+{
+ return m_PacketList->DeleteMDObjectByID(ObjectID);
+}
+
+//
+ASDCP::Result_t
ASDCP::MXF::OP1aHeader::GetMDObjectByType(const byte_t* ObjectID, InterchangeObject** Object)
{
InterchangeObject* TmpObject;
@@ -1225,6 +1249,7 @@ ASDCP::MXF::OPAtomIndexFooter::Dump(FILE* stream)
(*i)->Dump(stream);
}
+//
ASDCP::Result_t
ASDCP::MXF::OPAtomIndexFooter::GetMDObjectByID(const UUID& ObjectID, InterchangeObject** Object)
{
@@ -1233,6 +1258,13 @@ ASDCP::MXF::OPAtomIndexFooter::GetMDObjectByID(const UUID& ObjectID, Interchange
//
ASDCP::Result_t
+ASDCP::MXF::OPAtomIndexFooter::DeleteMDObjectByID(const UUID& ObjectID)
+{
+ return m_PacketList->DeleteMDObjectByID(ObjectID);
+}
+
+//
+ASDCP::Result_t
ASDCP::MXF::OPAtomIndexFooter::GetMDObjectByType(const byte_t* ObjectID, InterchangeObject** Object)
{
InterchangeObject* TmpObject;