summaryrefslogtreecommitdiff
path: root/src/AS_02_IAB.h
diff options
context:
space:
mode:
authormilla <marc.illa@dolby.com>2021-05-26 14:13:38 +0200
committermilla <marc.illa@dolby.com>2021-06-03 14:12:33 +0200
commitc45055937fb80cf78384e942dea0a57b5bf4b14c (patch)
treebdc6e5ad02c185da6ef55452b67406c1c64fe1fe /src/AS_02_IAB.h
parentf9d7fbc33aa571c547d916b145712469efd9f4b8 (diff)
Added API functions in AS_02_IAB.h: AddDmsGenericPartUtf8Text for write and ReadGenericStreamPartitionPayload for read. These functions are a wrapper so that the writer and reader call their implementation of AddDmsGenericPartUtf8Text and ReadGenericStreamPartitionPayload respectively. In the case of the AddDmsGenericPartUtf8Text 2 new parameters have been added: trackDescription and dataDescription.
Diffstat (limited to 'src/AS_02_IAB.h')
-rw-r--r--src/AS_02_IAB.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/AS_02_IAB.h b/src/AS_02_IAB.h
index 57fb77e..42c9ce3 100644
--- a/src/AS_02_IAB.h
+++ b/src/AS_02_IAB.h
@@ -125,6 +125,15 @@ namespace AS_02 {
Result_t WriteFrame(const ui8_t* frame, ui32_t sz);
/**
+ * Writes an XML text document to the MXF file as per RP 2057. If the
+ * optional AESEncContext argument is present, the document is encrypted
+ * prior to writing. Fails if the file is not open, is finalized, or an
+ * operating system error occurs.
+ */
+ Result_t AddDmsGenericPartUtf8Text(const ASDCP::FrameBuffer& frame_buffer, ASDCP::AESEncContext* enc = 0, ASDCP::HMACContext* hmac = 0,
+ const std::string& trackDescription = "Descriptive Track", const std::string& dataDescription = "");
+
+ /**
* Writes the Track File footer and closes the file.
*
* Must be preceded by a succesful OpenWrite() call followed by zero or more WriteFrame() calls
@@ -211,7 +220,7 @@ namespace AS_02 {
/**
* 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,
@@ -219,6 +228,14 @@ namespace AS_02 {
*/
Result_t ReadFrame(ui32_t frame_number, Frame& frame);
+
+ /** Reads a Generic Stream Partition payload. Returns RESULT_INIT if the file is
+ * not open, or RESULT_FORMAT if the SID is not present in the RIP, or if the
+ * actual partition at ByteOffset does not have a matching BodySID value.
+ * Encryption is not currently supported.
+ */
+ Result_t ReadGenericStreamPartitionPayload(ui32_t SID, ASDCP::FrameBuffer& FrameBuf);
+
/**
* Returns the number of IA Frame in the Track File.
*