projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Attempt to fix Sony digest validation by indenting the <Signer>
[libdcp.git]
/
examples
/
make_dcp.cc
diff --git
a/examples/make_dcp.cc
b/examples/make_dcp.cc
index d86cd30a3b5be016adfd1ddc74b22d6002f2394d..0c7ebf77add9c1b4014804a304182f84bd8ad49f 100644
(file)
--- a/
examples/make_dcp.cc
+++ b/
examples/make_dcp.cc
@@
-1,20
+1,20
@@
/*
Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
/*
Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
- This program is free software; you can redistribute it and/or modify
+ This file is part of libdcp.
+
+ libdcp is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
This program
is distributed in the hope that it will be useful,
+
libdcp
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+ along with libdcp. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file examples/make_dcp.cc
*/
/** @file examples/make_dcp.cc
@@
-25,38
+25,39
@@
#include <string>
/* If you are using an installed libdcp, these #includes would need to be changed to
#include <string>
/* If you are using an installed libdcp, these #includes would need to be changed to
-#include <
lib
dcp/dcp.h>
-#include <
lib
dcp/cpl.h>
-#include <
lib
dcp/mono_picture_asset.h>
+#include <dcp/dcp.h>
+#include <dcp/cpl.h>
+#include <dcp/mono_picture_asset.h>
... etc. ...
*/
#include "dcp.h"
#include "cpl.h"
... etc. ...
*/
#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"
#include "reel_sound_asset.h"
#include "reel.h"
#include "file.h"
#include "reel_mono_picture_asset.h"
#include "reel_sound_asset.h"
+#include <cmath>
int
main ()
{
/* Create a directory to put the DCP in */
boost::filesystem::create_directory ("DCP");
int
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.
*/
up the video of the DCP. First, create the object, specifying a frame rate of 24 frames
per second.
*/
- boost::shared_ptr<dcp::MonoPicture
MXF> picture_mxf (new dcp::MonoPictureMXF (dcp::Fraction (24, 1)
));
+ boost::shared_ptr<dcp::MonoPicture
Asset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE
));
/* Start off a write to it */
/* Start off a write to it */
- boost::shared_ptr<dcp::Picture
MXFWriter> picture_writer = picture_mxf->start_write ("DCP/picture.mxf", dcp::SMPTE
, false);
+ boost::shared_ptr<dcp::Picture
AssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf"
, false);
/* Write 24 frames of the same JPEG2000 file */
dcp::File picture ("examples/help.j2c");
/* Write 24 frames of the same JPEG2000 file */
dcp::File picture ("examples/help.j2c");
@@
-70,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).
*/
/* 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::Sound
MXF> sound_mxf (new dcp::SoundMXF (dcp::Fraction (24, 1), 48000, 2
));
- boost::shared_ptr<dcp::Sound
MXFWriter> sound_writer = sound_mxf->start_write ("DCP/sound.mxf", dcp::SMPTE
);
+ boost::shared_ptr<dcp::Sound
Asset> sound_asset (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 2, dcp::SMPTE
));
+ boost::shared_ptr<dcp::Sound
AssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf"
);
/* Write some sine waves */
float* audio[2];
/* Write some sine waves */
float* audio[2];
@@
-92,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
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
MXF
s that the reel should play.
+ (video) frame from the
asset
s 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));
/* Make a CPL with this reel */
boost::shared_ptr<dcp::CPL> cpl (new dcp::CPL ("My film", dcp::FEATURE));
@@
-104,9
+105,7
@@
main ()
/* Write the DCP */
dcp::DCP dcp ("DCP");
dcp.add (cpl);
/* Write the DCP */
dcp::DCP dcp ("DCP");
dcp.add (cpl);
- dcp.add (picture_mxf);
- dcp.add (sound_mxf);
dcp.write_xml (dcp::SMPTE);
dcp.write_xml (dcp::SMPTE);
-
+
return 0;
}
return 0;
}