diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-02-28 00:08:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-02-28 00:08:56 +0100 |
| commit | eb80c762e9046e6b48fc754d6b510e80cd6a2d92 (patch) | |
| tree | 1f640a98727f722c76b0fe1ffcb2f360b6240fd1 /src | |
| parent | d16b830d2dcfc5c194851d1344448850da7f8ef7 (diff) | |
Add new write() method.
Diffstat (limited to 'src')
| -rw-r--r-- | src/picture_asset_writer.cc | 7 | ||||
| -rw-r--r-- | src/picture_asset_writer.h | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/picture_asset_writer.cc b/src/picture_asset_writer.cc index f9f6630c..c30be1bc 100644 --- a/src/picture_asset_writer.cc +++ b/src/picture_asset_writer.cc @@ -58,3 +58,10 @@ PictureAssetWriter::PictureAssetWriter (PictureAsset* asset, boost::filesystem:: { asset->set_file (file); } + + +FrameInfo +PictureAssetWriter::write (Data const& data) +{ + return write (data.data(), data.size()); +} diff --git a/src/picture_asset_writer.h b/src/picture_asset_writer.h index 2fcd2de1..698d02af 100644 --- a/src/picture_asset_writer.h +++ b/src/picture_asset_writer.h @@ -41,11 +41,11 @@ #define LIBDCP_PICTURE_ASSET_WRITER_H +#include "asset_writer.h" #include "metadata.h" #include "types.h" -#include "asset_writer.h" -#include <memory> #include <boost/utility.hpp> +#include <memory> #include <stdint.h> #include <string> @@ -53,6 +53,7 @@ namespace dcp { +class Data; class PictureAsset; @@ -84,13 +85,15 @@ public: virtual FrameInfo write (uint8_t const *, int) = 0; virtual void fake_write (int) = 0; + FrameInfo write (Data const& data); + protected: template <class P, class Q> friend void start (PictureAssetWriter *, std::shared_ptr<P>, Q *, uint8_t const *, int); PictureAssetWriter (PictureAsset *, boost::filesystem::path, bool); - PictureAsset* _picture_asset; + PictureAsset* _picture_asset = nullptr; bool _overwrite = false; }; |
