diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-05 15:32:35 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-05 15:45:01 +0000 |
| commit | e3b5521ac40125c3dfd9f254856cf58ea1584f79 (patch) | |
| tree | f7d7abdfccdcb2e52a06be72da72b593881ae9c4 /asdcplib/src/AS_DCP.h | |
| parent | 3ec4338ce90ea0549409312f24f8b28c07a5d2da (diff) | |
My warning fixes and extensions to asdcplib.
Diffstat (limited to 'asdcplib/src/AS_DCP.h')
| -rwxr-xr-x | asdcplib/src/AS_DCP.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/asdcplib/src/AS_DCP.h b/asdcplib/src/AS_DCP.h index 9e9702fc..a9f8e557 100755 --- a/asdcplib/src/AS_DCP.h +++ b/asdcplib/src/AS_DCP.h @@ -204,7 +204,7 @@ namespace ASDCP { enum EssenceType_t { ESS_UNKNOWN, // the file is not a supported AS-DCP of AS-02 essence container - // + // ESS_MPEG2_VES, // the file contains an MPEG-2 video elementary stream // d-cinema essence types @@ -1142,6 +1142,8 @@ namespace ASDCP { // encrypted headers. Result_t OpenReadFrame(const std::string& filename, FrameBuffer&) const; + Result_t OpenReadFrame(const unsigned char * data, unsigned int size, FrameBuffer&) const; + // Fill a PictureDescriptor struct with the values from the file's codestream. // Returns RESULT_INIT if the file is not open. Result_t FillPictureDescriptor(PictureDescriptor&) const; @@ -1215,20 +1217,26 @@ 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, bool overwrite); // Writes a frame of essence to the MXF file. If the optional AESEncContext // argument is present, the essence is encrypted prior to writing. + // A MD5 hash of the data that we write is written to hash if it is not 0 // Fails if the file is not open, is finalized, or an operating system // error occurs. - Result_t WriteFrame(const FrameBuffer&, AESEncContext* = 0, HMACContext* = 0); + Result_t WriteFrame(const FrameBuffer&, AESEncContext* = 0, HMACContext* = 0, std::string* hash = 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; }; // @@ -1320,11 +1328,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, bool overwrite); // 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. @@ -1339,11 +1347,16 @@ namespace ASDCP { // RESULT_SPHASE will be returned if phase is reversed. The first frame // written must be left eye. Result_t WriteFrame(const FrameBuffer&, StereoscopicPhase_t phase, - AESEncContext* = 0, HMACContext* = 0); + AESEncContext* = 0, HMACContext* = 0, std::string* hash = 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; }; // |
