summaryrefslogtreecommitdiff
path: root/src/AS_02_IAB.h
diff options
context:
space:
mode:
authornolaiz <nolaiz@dolby.com>2021-09-08 13:55:26 +0200
committerStefan Kersten <stefan.kersten@dolby.com>2021-09-09 11:56:23 +0200
commit7af443a806f8c8a2a3cef7ec0b0602b1872987c6 (patch)
tree49dc714119f6c7ccecefd5a8e7ba97b7db6be750 /src/AS_02_IAB.h
parent35ceab95d3ad46db13d2e0f979f1ef9102be86f0 (diff)
Re-implement previous {Read,Write}Frame API
Diffstat (limited to 'src/AS_02_IAB.h')
-rw-r--r--src/AS_02_IAB.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/AS_02_IAB.h b/src/AS_02_IAB.h
index 710a322..d33c749 100644
--- a/src/AS_02_IAB.h
+++ b/src/AS_02_IAB.h
@@ -116,7 +116,21 @@ namespace AS_02 {
* Writes a single frame.
*
* Must be preceded by a succesful OpenWrite() call followed by zero or more WriteFrame() calls
+ *
+ *
+ * @param frame Pointer to a complete IA Frame
+ * @param sz Size in bytes of the IA Frame
+ * @return RESULT_OK indicates that the frame is written and additional frames can be written,
+ * otherwise the reader is reset and the file is left is an undermined state.
+ */
+ Result_t WriteFrame(const ui8_t* frame, ui32_t sz);
+
+ /**
+ * Writes a single frame.
*
+ * Must be preceded by a succesful OpenWrite() call followed by zero or more WriteFrame() calls
+ *
+ *
* @param frame a complete IA Frame
* @return RESULT_OK indicates that the frame is written and additional frames can be written,
* otherwise the reader is reset and the file is left is an undermined state.
@@ -153,8 +167,8 @@ namespace AS_02 {
ASDCP::mem_ptr<h__Reader> m_Reader;
- i64_t m_CurrentFrameIndex;
- std::vector<ui8_t> m_CurrentFrameBuffer;
+ ASDCP::FrameBuffer m_FrameBuffer;
+
ReaderState_t m_State;
const Kumu::IFileReaderFactory& m_FileReaderFactory;
@@ -236,6 +250,16 @@ namespace AS_02 {
* @return RESULT_OK indicates that more frames are ready to be read,
* otherwise the file is closed and the reader reset
*/
+ Result_t ReadFrame(ui32_t frame_number, Frame& frame);
+
+ /**
+ * Reads an IA Frame.
+ *
+ * @param frame_number Index of the frame to be read. Must be in the range [0, GetFrameCount()).
+ * @param frame Frame data. Must not be modified. Remains valid until the next call to ReadFrame().
+ * @return RESULT_OK indicates that more frames are ready to be read,
+ * otherwise the file is closed and the reader reset
+ */
Result_t ReadFrame(ui32_t frame_number, ASDCP::FrameBuffer& frame);
/** Reads a Generic Stream Partition payload. Returns RESULT_INIT if the file is