summaryrefslogtreecommitdiff
path: root/src/AS_DCP.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-21 20:29:47 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-21 20:29:47 +0100
commit8b59eda953e7fa37506e6cb6add7dcb7d5ae8dce (patch)
tree3a34949184334ec95661a63b87d8f3c09182c6e4 /src/AS_DCP.h
parent937185745167bbd12ebdb46ec3cf5127d26394ff (diff)
Allow overwrite (i.e. continue) when writing JPEG2000 MXFs.
Diffstat (limited to 'src/AS_DCP.h')
-rwxr-xr-xsrc/AS_DCP.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/AS_DCP.h b/src/AS_DCP.h
index 8a87bf2..dac5cd1 100755
--- a/src/AS_DCP.h
+++ b/src/AS_DCP.h
@@ -1262,11 +1262,11 @@ namespace ASDCP {
virtual MXF::OPAtomIndexFooter& OPAtomIndexFooter();
virtual MXF::RIP& RIP();
- // Open the file for writing. The file must not exist. Returns error if
+ // Open the file for writing. The file must not exist unless overwrite is true. Returns error if
// the operation cannot be completed or if nonsensical data is discovered
// in the essence descriptor.
Result_t OpenWrite(const std::string& filename, const WriterInfo&,
- const PictureDescriptor&, ui32_t HeaderSize = 16384);
+ const PictureDescriptor&, ui32_t HeaderSize = 16384, bool overwrite = false);
// Writes a frame of essence to the MXF file. If the optional AESEncContext
// argument is present, the essence is encrypted prior to writing.
@@ -1274,8 +1274,13 @@ namespace ASDCP {
// error occurs.
Result_t WriteFrame(const FrameBuffer&, AESEncContext* = 0, HMACContext* = 0);
+ Result_t FakeWriteFrame(int size);
+
// Closes the MXF file, writing the index and revised header.
Result_t Finalize();
+
+ // Return the current file offset in the MXF file that we are writing.
+ ui64_t Tell() const;
};
//
@@ -1367,11 +1372,11 @@ namespace ASDCP {
virtual MXF::OPAtomIndexFooter& OPAtomIndexFooter();
virtual MXF::RIP& RIP();
- // Open the file for writing. The file must not exist. Returns error if
+ // Open the file for writing. The file must not exist unless overwrite is true. Returns error if
// the operation cannot be completed or if nonsensical data is discovered
// in the essence descriptor.
Result_t OpenWrite(const std::string& filename, const WriterInfo&,
- const PictureDescriptor&, ui32_t HeaderSize = 16384);
+ const PictureDescriptor&, ui32_t HeaderSize = 16384, bool overwrite = false);
// Writes a pair of frames of essence to the MXF file. If the optional AESEncContext
// argument is present, the essence is encrypted prior to writing.
@@ -1388,9 +1393,14 @@ namespace ASDCP {
Result_t WriteFrame(const FrameBuffer&, StereoscopicPhase_t phase,
AESEncContext* = 0, HMACContext* = 0);
+ Result_t FakeWriteFrame(int size, StereoscopicPhase_t phase);
+
// Closes the MXF file, writing the index and revised header. Returns
// RESULT_SPHASE if WriteFrame was called an odd number of times.
Result_t Finalize();
+
+ // Return the current file offset in the MXF file that we are writing
+ ui64_t Tell() const;
};
//