From da2f0d96f3c5ffa73bfecd9df613b23200e862f7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 31 Jul 2012 01:01:19 +0100 Subject: Bitwise MXF comparison. --- src/dcp.cc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/dcp.cc') diff --git a/src/dcp.cc b/src/dcp.cc index dc895e11..ed63170f 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -305,12 +305,11 @@ DCP::DCP (string directory) } list -DCP::equals (DCP const & other, EqualityType type) const +DCP::equals (DCP const & other, EqualityFlags flags) const { list notes; - switch (type) { - case LIBDCP_METADATA: + if (flags & LIBDCP_METADATA) { if (_name != other._name) { notes.push_back ("names differ"); } @@ -323,10 +322,24 @@ DCP::equals (DCP const & other, EqualityType type) const if (_length != other._length) { notes.push_back ("lengths differ"); } + } + + if (flags & LIBDCP_METADATA || flags & MXF_BITWISE) { if (_assets.size() != other._assets.size()) { notes.push_back ("asset counts differ"); } - break; + } + + if (flags & MXF_BITWISE) { + list >::const_iterator a = _assets.begin (); + list >::const_iterator b = other._assets.begin (); + + while (a != _assets.end ()) { + list n = (*a)->equals (*b->get(), MXF_BITWISE); + notes.merge (n); + ++a; + ++b; + } } return notes; -- cgit v1.2.3