summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-20 14:14:07 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-08 00:35:29 +0100
commitd39880eef211a296fa8ef4712cdef5945d08527c (patch)
tree45dce8f3e1fd599ca76677e31eee2a71c9a4fbc1 /examples
parent75faebaf1d74e2b52360905e94e9f5bf31c34124 (diff)
std::shared_ptr
Diffstat (limited to 'examples')
-rw-r--r--examples/make_dcp.cc16
-rw-r--r--examples/read_dcp.cc24
2 files changed, 20 insertions, 20 deletions
diff --git a/examples/make_dcp.cc b/examples/make_dcp.cc
index 734ae880..1705589d 100644
--- a/examples/make_dcp.cc
+++ b/examples/make_dcp.cc
@@ -54,10 +54,10 @@ main ()
per second.
*/
- boost::shared_ptr<dcp::MonoPictureAsset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
+ std::shared_ptr<dcp::MonoPictureAsset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
/* Start off a write to it */
- boost::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", false);
+ std::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", false);
/* Write 24 frames of the same JPEG2000 file */
dcp::File picture ("examples/help.j2c");
@@ -71,12 +71,12 @@ main ()
/* Now create a sound MXF. As before, create an object and a writer.
When creating the object we specify the sampling rate (48kHz) and the number of channels (2).
*/
- boost::shared_ptr<dcp::SoundAsset> sound_asset (new dcp::SoundAsset(dcp::Fraction(24, 1), 48000, 2, dcp::LanguageTag("en-GB"), dcp::SMPTE));
+ std::shared_ptr<dcp::SoundAsset> sound_asset (new dcp::SoundAsset(dcp::Fraction(24, 1), 48000, 2, dcp::LanguageTag("en-GB"), dcp::SMPTE));
/* Here we must also say which of our channels will have "real" sound data in them */
std::vector<dcp::Channel> active_channels;
active_channels.push_back (dcp::LEFT);
active_channels.push_back (dcp::RIGHT);
- boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", active_channels);
+ std::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", active_channels);
/* Write some sine waves */
float* audio[2];
@@ -94,16 +94,16 @@ main ()
sound_writer->finalize ();
/* Now create a reel */
- boost::shared_ptr<dcp::Reel> reel (new dcp::Reel ());
+ std::shared_ptr<dcp::Reel> reel (new dcp::Reel ());
/* Add picture and sound to it. The zeros are the `entry points', i.e. the first
(video) frame from the assets that the reel should play.
*/
- reel->add (boost::shared_ptr<dcp::ReelPictureAsset> (new dcp::ReelMonoPictureAsset (picture_asset, 0)));
- reel->add (boost::shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (sound_asset, 0)));
+ reel->add (std::shared_ptr<dcp::ReelPictureAsset> (new dcp::ReelMonoPictureAsset (picture_asset, 0)));
+ reel->add (std::shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (sound_asset, 0)));
/* Make a CPL with this reel */
- boost::shared_ptr<dcp::CPL> cpl (new dcp::CPL ("My film", dcp::FEATURE));
+ std::shared_ptr<dcp::CPL> cpl (new dcp::CPL ("My film", dcp::FEATURE));
cpl->add (reel);
/* Write the DCP */
diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc
index 5b44fb51..6a36d009 100644
--- a/examples/read_dcp.cc
+++ b/examples/read_dcp.cc
@@ -58,39 +58,39 @@ main ()
}
std::cout << "DCP has " << dcp.cpls().size() << " CPLs.\n";
- std::list<boost::shared_ptr<dcp::Asset> > assets = dcp.assets ();
+ std::list<std::shared_ptr<dcp::Asset> > assets = dcp.assets ();
std::cout << "DCP has " << assets.size() << " assets.\n";
- for (std::list<boost::shared_ptr<dcp::Asset> >::const_iterator i = assets.begin(); i != assets.end(); ++i) {
- if (boost::dynamic_pointer_cast<dcp::MonoPictureAsset> (*i)) {
+ for (std::list<std::shared_ptr<dcp::Asset> >::const_iterator i = assets.begin(); i != assets.end(); ++i) {
+ if (std::dynamic_pointer_cast<dcp::MonoPictureAsset> (*i)) {
std::cout << "2D picture\n";
- } else if (boost::dynamic_pointer_cast<dcp::StereoPictureAsset> (*i)) {
+ } else if (std::dynamic_pointer_cast<dcp::StereoPictureAsset> (*i)) {
std::cout << "3D picture\n";
- } else if (boost::dynamic_pointer_cast<dcp::SoundAsset> (*i)) {
+ } else if (std::dynamic_pointer_cast<dcp::SoundAsset> (*i)) {
std::cout << "Sound\n";
- } else if (boost::dynamic_pointer_cast<dcp::SubtitleAsset> (*i)) {
+ } else if (std::dynamic_pointer_cast<dcp::SubtitleAsset> (*i)) {
std::cout << "Subtitle\n";
- } else if (boost::dynamic_pointer_cast<dcp::CPL> (*i)) {
+ } else if (std::dynamic_pointer_cast<dcp::CPL> (*i)) {
std::cout << "CPL\n";
}
std::cout << "\t" << (*i)->file()->leaf().string() << "\n";
}
/* Take the first CPL */
- boost::shared_ptr<dcp::CPL> cpl = dcp.cpls().front ();
+ std::shared_ptr<dcp::CPL> cpl = dcp.cpls().front ();
/* Get the picture asset in the first reel */
- boost::shared_ptr<dcp::MonoPictureAsset> picture_asset = boost::dynamic_pointer_cast<dcp::MonoPictureAsset> (
+ std::shared_ptr<dcp::MonoPictureAsset> picture_asset = std::dynamic_pointer_cast<dcp::MonoPictureAsset> (
cpl->reels().front()->main_picture()->asset()
);
/* Get a reader for it */
- boost::shared_ptr<dcp::MonoPictureAssetReader> picture_asset_reader = picture_asset->start_read();
+ std::shared_ptr<dcp::MonoPictureAssetReader> picture_asset_reader = picture_asset->start_read();
/* Get the 1000th frame of it */
- boost::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset_reader->get_frame(999);
+ std::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset_reader->get_frame(999);
/* Get the frame as an XYZ image */
- boost::shared_ptr<const dcp::OpenJPEGImage> picture_image_xyz = picture_frame_j2k->xyz_image ();
+ std::shared_ptr<const dcp::OpenJPEGImage> picture_image_xyz = picture_frame_j2k->xyz_image ();
/* Convert to ARGB */
boost::scoped_array<uint8_t> rgba (new uint8_t[picture_image_xyz->size().width * picture_image_xyz->size().height * 4]);