diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-05 00:05:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-05 14:36:27 +0100 |
| commit | fe99eae4b95c5fcf2f3730efad4a18d0cb5c29bc (patch) | |
| tree | 265ca14896f63eeff210d602c5f11ed19d800ebf /examples | |
| parent | 7b717db244554300ebed8eade8421ee3faa28d33 (diff) | |
MXF -> Asset in lots of places.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/make_dcp.cc | 28 | ||||
| -rw-r--r-- | examples/read_dcp.cc | 22 |
2 files changed, 26 insertions, 24 deletions
diff --git a/examples/make_dcp.cc b/examples/make_dcp.cc index d8339171..7b15e5e0 100644 --- a/examples/make_dcp.cc +++ b/examples/make_dcp.cc @@ -33,10 +33,10 @@ #include "dcp.h" #include "cpl.h" -#include "mono_picture_mxf.h" -#include "mono_picture_mxf_writer.h" -#include "sound_mxf.h" -#include "sound_mxf_writer.h" +#include "mono_picture_asset.h" +#include "mono_picture_asset_writer.h" +#include "sound_asset.h" +#include "sound_asset_writer.h" #include "reel.h" #include "file.h" #include "reel_mono_picture_asset.h" @@ -49,15 +49,15 @@ main () /* Create a directory to put the DCP in */ boost::filesystem::create_directory ("DCP"); - /* Make a picture MXF. This is a file which combines JPEG2000 files together to make + /* Make a picture asset. This is a file which combines JPEG2000 files together to make up the video of the DCP. First, create the object, specifying a frame rate of 24 frames per second. */ - boost::shared_ptr<dcp::MonoPictureMXF> picture_mxf (new dcp::MonoPictureMXF (dcp::Fraction (24, 1))); + boost::shared_ptr<dcp::MonoPictureAsset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1))); /* Start off a write to it */ - boost::shared_ptr<dcp::PictureMXFWriter> picture_writer = picture_mxf->start_write ("DCP/picture.mxf", dcp::SMPTE, false); + boost::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", dcp::SMPTE, false); /* Write 24 frames of the same JPEG2000 file */ dcp::File picture ("examples/help.j2c"); @@ -71,8 +71,8 @@ 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::SoundMXF> sound_mxf (new dcp::SoundMXF (dcp::Fraction (24, 1), 48000, 2)); - boost::shared_ptr<dcp::SoundMXFWriter> sound_writer = sound_mxf->start_write ("DCP/sound.mxf", dcp::SMPTE); + boost::shared_ptr<dcp::SoundAsset> sound_asset (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 2)); + boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", dcp::SMPTE); /* Write some sine waves */ float* audio[2]; @@ -93,10 +93,10 @@ main () boost::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 MXFs that the reel should play. + (video) frame from the assets that the reel should play. */ - reel->add (boost::shared_ptr<dcp::ReelPictureAsset> (new dcp::ReelMonoPictureAsset (picture_mxf, 0))); - reel->add (boost::shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (sound_mxf, 0))); + 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))); /* Make a CPL with this reel */ boost::shared_ptr<dcp::CPL> cpl (new dcp::CPL ("My film", dcp::FEATURE)); @@ -105,8 +105,8 @@ main () /* Write the DCP */ dcp::DCP dcp ("DCP"); dcp.add (cpl); - dcp.add (picture_mxf); - dcp.add (sound_mxf); + dcp.add (picture_asset); + dcp.add (sound_asset); dcp.write_xml (dcp::SMPTE); return 0; diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc index 068fc09b..c7efd77b 100644 --- a/examples/read_dcp.cc +++ b/examples/read_dcp.cc @@ -19,7 +19,7 @@ /* If you are using an installed libdcp, these #includes would need to be changed to #include <dcp/dcp.h> -#include <dcp/picture_mxf.h> +#include <dcp/picture_asset.h> ... etc. ... */ @@ -28,9 +28,9 @@ #include "reel.h" #include "reel_picture_asset.h" #include "mono_picture_frame.h" -#include "mono_picture_mxf.h" -#include "stereo_picture_mxf.h" -#include "sound_mxf.h" +#include "mono_picture_asset.h" +#include "stereo_picture_asset.h" +#include "sound_asset.h" #include "subtitle_asset.h" #include "xyz_image.h" #include "colour_conversion.h" @@ -60,11 +60,11 @@ main () std::list<boost::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::MonoPictureMXF> (*i)) { + if (boost::dynamic_pointer_cast<dcp::MonoPictureAsset> (*i)) { std::cout << "2D picture\n"; - } else if (boost::dynamic_pointer_cast<dcp::StereoPictureMXF> (*i)) { + } else if (boost::dynamic_pointer_cast<dcp::StereoPictureAsset> (*i)) { std::cout << "3D picture\n"; - } else if (boost::dynamic_pointer_cast<dcp::SoundMXF> (*i)) { + } else if (boost::dynamic_pointer_cast<dcp::SoundAsset> (*i)) { std::cout << "Sound\n"; } else if (boost::dynamic_pointer_cast<dcp::SubtitleAsset> (*i)) { std::cout << "Subtitle\n"; @@ -77,11 +77,13 @@ main () /* Take the first CPL */ boost::shared_ptr<dcp::CPL> cpl = dcp.cpls().front (); - /* Get the MXF of the picture asset in the first reel */ - boost::shared_ptr<dcp::MonoPictureMXF> picture_mxf = boost::dynamic_pointer_cast<dcp::MonoPictureMXF> (cpl->reels().front()->main_picture()->mxf ()); + /* Get the picture asset in the first reel */ + boost::shared_ptr<dcp::MonoPictureAsset> picture_asset = boost::dynamic_pointer_cast<dcp::MonoPictureAsset> ( + cpl->reels().front()->main_picture()->asset() + ); /* Get the 1000th frame of it */ - boost::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_mxf->get_frame(999); + boost::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset->get_frame(999); /* Get the frame as an XYZ image */ boost::shared_ptr<const dcp::XYZImage> picture_image_xyz = picture_frame_j2k->xyz_image (); |
