diff options
| author | Thomas Richter <thomas.richter@iis.fraunhofer.de> | 2022-01-28 09:30:55 +0100 |
|---|---|---|
| committer | Thomas Richter <thomas.richter@iis.fraunhofer.de> | 2022-01-28 09:30:55 +0100 |
| commit | 7081231eba80044c0f97d4da5998d65681b94528 (patch) | |
| tree | 550d0ecc45d301663b93cfd34e6c958fa6c5b4c0 /src/TimedText_Parser.cpp | |
| parent | d96e461dd7ba5f81ce40979a79bfad105be352de (diff) | |
| parent | 94e66805feeba15e6dd80ec290f04706a1c9dbdc (diff) | |
Merge branch 'master' of github.com:thorfdbg/asdcplib
Diffstat (limited to 'src/TimedText_Parser.cpp')
| -rw-r--r-- | src/TimedText_Parser.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/TimedText_Parser.cpp b/src/TimedText_Parser.cpp index 020baf3..d3eca72 100644 --- a/src/TimedText_Parser.cpp +++ b/src/TimedText_Parser.cpp @@ -39,7 +39,7 @@ using namespace ASDCP; using Kumu::DefaultLogSink; -const char* c_dcst_namespace_name = "http://www.smpte-ra.org/schemas/428-7/2007/DCST"; +static const char* c_dcst_namespace_name = "http://www.smpte-ra.org/schemas/428-7/2007/DCST"; //------------------------------------------------------------------------------------------ @@ -144,36 +144,37 @@ public: Result_t OpenRead(const std::string& xml_doc, const std::string& filename); Result_t ReadAncillaryResource(const byte_t* uuid, FrameBuffer& FrameBuf, const IResourceResolver& Resolver) const; }; +namespace { + // + bool + get_UUID_from_element(XMLElement* Element, UUID& ID) + { + assert(Element); + const char* p = Element->GetBody().c_str(); -// -bool -get_UUID_from_element(XMLElement* Element, UUID& ID) -{ - assert(Element); - const char* p = Element->GetBody().c_str(); + if ( strncmp(p, "urn:uuid:", 9) == 0 ) + { + p += 9; + } + + return ID.DecodeHex(p); + } - if ( strncmp(p, "urn:uuid:", 9) == 0 ) + // + bool + get_UUID_from_child_element(const char* name, XMLElement* Parent, UUID& outID) { - p += 9; - } - - return ID.DecodeHex(p); -} + assert(name); + assert(Parent); + XMLElement* Child = Parent->GetChildWithName(name); -// -bool -get_UUID_from_child_element(const char* name, XMLElement* Parent, UUID& outID) -{ - assert(name); - assert(Parent); - XMLElement* Child = Parent->GetChildWithName(name); + if ( Child == 0 ) + { + return false; + } - if ( Child == 0 ) - { - return false; + return get_UUID_from_element(Child, outID); } - - return get_UUID_from_element(Child, outID); } // |
