summaryrefslogtreecommitdiff
path: root/src/h__Reader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/h__Reader.cpp')
-rwxr-xr-xsrc/h__Reader.cpp39
1 files changed, 14 insertions, 25 deletions
diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp
index 7bc8955..8035ac8 100755
--- a/src/h__Reader.cpp
+++ b/src/h__Reader.cpp
@@ -150,35 +150,24 @@ ASDCP::h__Reader::InitMXFIndex()
}
//
-class KLReader : public ASDCP::KLVPacket
+Result_t
+ASDCP::KLReader::ReadKLFromFile(Kumu::FileReader& Reader)
{
- ASDCP_NO_COPY_CONSTRUCT(KLReader);
- byte_t m_KeyBuf[32];
-
-public:
- KLReader() {}
- ~KLReader() {}
-
- inline const byte_t* Key() { return m_KeyBuf; }
- inline const ui64_t Length() { return m_ValueLength; }
- inline const ui64_t KLLength() { return m_KLLength; }
+ ui32_t read_count;
+ ui32_t header_length = SMPTE_UL_LENGTH + MXF_BER_LENGTH;
+ Result_t result = Reader.Read(m_KeyBuf, header_length, &read_count);
- Result_t ReadKLFromFile(Kumu::FileReader& Reader)
- {
- ui32_t read_count;
- ui32_t header_length = SMPTE_UL_LENGTH + MXF_BER_LENGTH;
- Result_t result = Reader.Read(m_KeyBuf, header_length, &read_count);
-
- if ( read_count != header_length )
- return RESULT_READFAIL;
+ if ( ASDCP_SUCCESS(result) )
+ {
+ if ( read_count != header_length )
+ result = RESULT_READFAIL;
- if ( ASDCP_SUCCESS(result) )
- result = InitFromBuffer(m_KeyBuf, header_length);
-
- return result;
- }
-};
+ else
+ result = InitFromBuffer(m_KeyBuf, header_length);
+ }
+ return result;
+}
// standard method of reading a plaintext or encrypted frame
Result_t