/*
-Copyright (c) 2005-2013, John Hurst
+Copyright (c) 2005-2014, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
typedef ASDCP::MXF::InterchangeObject* (*MXFObjectFactory_t)(const Dictionary*&);
//
- void SetObjectFactory(UL label, MXFObjectFactory_t factory);
+ void SetObjectFactory(const UL& label, MXFObjectFactory_t factory);
//
InterchangeObject* CreateObject(const Dictionary*& Dict, const UL& label);
//
class IndexTableSegment : public InterchangeObject
{
+ IndexTableSegment();
ASDCP_NO_COPY_CONSTRUCT(IndexTableSegment);
public:
ui8_t Slice;
ui32_t ElementData;
- DeltaEntry() : PosTableIndex(-1), Slice(0), ElementData(0) {}
+ DeltaEntry() : PosTableIndex(0), Slice(0), ElementData(0) {}
DeltaEntry(i8_t pos, ui8_t slice, ui32_t data) : PosTableIndex(pos), Slice(slice), ElementData(data) {}
inline bool HasValue() const { return true; }
ui32_t ArchiveLength() const { return sizeof(ui32_t) + 2; }
SourcePackage* GetSourcePackage();
};
+ // Searches the header object and returns the edit rate based on the contents of the
+ // File Package items. Logs an error message and returns false if anthing goes wrong.
+ bool GetEditRateFromFP(ASDCP::MXF::OP1aHeader& header, ASDCP::Rational& edit_rate);
+
//
class OPAtomIndexFooter : public Partition
{
ui32_t m_BytesPerEditUnit;
Rational m_EditRate;
ui32_t m_BodySID;
+ IndexTableSegment::DeltaEntry m_DefaultDeltaEntry;
ASDCP_NO_COPY_CONSTRUCT(OPAtomIndexFooter);
OPAtomIndexFooter();
virtual Result_t Lookup(ui32_t frame_num, IndexTableSegment::IndexEntry&) const;
virtual void PushIndexEntry(const IndexTableSegment::IndexEntry&);
+ virtual void SetDeltaParams(const IndexTableSegment::DeltaEntry&);
virtual void SetIndexParamsCBR(IPrimerLookup* lookup, ui32_t size, const Rational& Rate);
virtual void SetIndexParamsVBR(IPrimerLookup* lookup, const Rational& Rate, Kumu::fpos_t offset);
};
}
};
- typedef std::map<const std::string, const UL, ci_comp> mca_label_map_t;
- bool decode_mca_string(const std::string& s, const mca_label_map_t& labels, const Dictionary& dict, const std::string& language, InterchangeObject_list_t&, ui32_t&);
+ struct label_traits
+ {
+ const std::string tag_name;
+ const bool requires_prefix;
+ const UL ul;
+
+ label_traits(const std::string& tag_name, const bool requires_prefix, const UL ul) :
+ tag_name(tag_name), requires_prefix(requires_prefix), ul(ul) { }
+ };
+
+ typedef std::map<const std::string, const label_traits, ci_comp> mca_label_map_t;
+
+ bool decode_mca_string(const std::string& s, const mca_label_map_t& labels,
+ const Dictionary*& dict, const std::string& language, InterchangeObject_list_t&, ui32_t&);
//
class ASDCP_MCAConfigParser : public InterchangeObject_list_t
public:
ASDCP_MCAConfigParser(const Dictionary*&);
- bool DecodeString(const std::string& s, const std::string& language = "en");
+ bool DecodeString(const std::string& s, const std::string& language = "en-US");
// Valid only after a successful call to DecodeString
ui32_t ChannelCount() const;