summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-09-09 00:32:08 +0100
committerCarl Hetherington <cth@carlh.net>2016-09-09 00:32:08 +0100
commit17af99550ea468bf6702f4973630a24629a65ff7 (patch)
tree00be394a21f6506c2425b0b6691ac42a23a277c2
parentfe83eb5293fa4027856f6ee9faec7bfc8288badf (diff)
Simplify previous commit and remove some debugging.
-rw-r--r--examples/make_dcp.cc2
-rw-r--r--src/rgb_xyz.cc2
-rw-r--r--src/sound_asset.cc4
-rw-r--r--src/sound_asset.h2
-rw-r--r--src/sound_asset_writer.cc23
-rw-r--r--src/sound_asset_writer.h2
-rw-r--r--src/types.h14
-rw-r--r--test/dcp_test.cc6
-rw-r--r--test/encryption_test.cc2
9 files changed, 14 insertions, 43 deletions
diff --git a/examples/make_dcp.cc b/examples/make_dcp.cc
index f0021e6b..582dd946 100644
--- a/examples/make_dcp.cc
+++ b/examples/make_dcp.cc
@@ -72,7 +72,7 @@ main ()
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));
- boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", dcp::SMPTE, dcp::CHANNEL_ASSIGNMENT_51);
+ boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", dcp::SMPTE);
/* Write some sine waves */
float* audio[2];
diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc
index 2eccb77a..d299340e 100644
--- a/src/rgb_xyz.cc
+++ b/src/rgb_xyz.cc
@@ -365,9 +365,7 @@ dcp::xyz_to_xyz (uint8_t const * xyz_16, dcp::Size size, int stride)
uint16_t const * p = reinterpret_cast<uint16_t const *> (xyz_16 + y * stride);
for (int x = 0; x < size.width; ++x) {
/* Truncate 16-bit to 12-bit */
- cout << *p << " ";
xyz_12->data(0)[jn] = *p++ >> 4;
- cout << xyz_12->data(0)[jn] << "\n";
xyz_12->data(1)[jn] = *p++ >> 4;
xyz_12->data(2)[jn] = *p++ >> 4;
++jn;
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 2202311a..11fd4b2f 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -192,10 +192,10 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
}
shared_ptr<SoundAssetWriter>
-SoundAsset::start_write (boost::filesystem::path file, Standard standard, ChannelAssignment assign)
+SoundAsset::start_write (boost::filesystem::path file, Standard standard)
{
/* XXX: can't we use a shared_ptr here? */
- return shared_ptr<SoundAssetWriter> (new SoundAssetWriter (this, file, standard, assign));
+ return shared_ptr<SoundAssetWriter> (new SoundAssetWriter (this, file, standard));
}
shared_ptr<SoundAssetReader>
diff --git a/src/sound_asset.h b/src/sound_asset.h
index b3e5fec3..a29eecd0 100644
--- a/src/sound_asset.h
+++ b/src/sound_asset.h
@@ -58,7 +58,7 @@ public:
explicit SoundAsset (boost::filesystem::path file);
SoundAsset (Fraction edit_rate, int sampling_rate, int channels);
- boost::shared_ptr<SoundAssetWriter> start_write (boost::filesystem::path file, Standard standard, ChannelAssignment assign);
+ boost::shared_ptr<SoundAssetWriter> start_write (boost::filesystem::path file, Standard standard);
boost::shared_ptr<SoundAssetReader> start_read () const;
bool equals (
diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc
index f7513d91..92855db7 100644
--- a/src/sound_asset_writer.cc
+++ b/src/sound_asset_writer.cc
@@ -51,7 +51,7 @@ struct SoundAssetWriter::ASDCPState
ASDCP::PCM::AudioDescriptor audio_desc;
};
-SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path file, Standard standard, ChannelAssignment assign)
+SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path file, Standard standard)
: AssetWriter (asset, file, standard)
, _state (new SoundAssetWriter::ASDCPState)
, _sound_asset (asset)
@@ -69,23 +69,10 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path f
if (standard == INTEROP) {
_state->audio_desc.ChannelFormat = ASDCP::PCM::CF_NONE;
} else {
- switch (assign) {
- case CHANNEL_ASSIGNMENT_51:
- _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_1;
- break;
- case CHANNEL_ASSIGNMENT_61:
- _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_2;
- break;
- case CHANNEL_ASSIGNMENT_71:
- _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_3;
- break;
- case CHANNEL_ASSIGNMENT_WTF:
- _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_4;
- break;
- case CHANNEL_ASSIGNMENT_71_DS:
- _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_5;
- break;
- }
+ /* Just use WTF ("wild track format") for SMPTE for now; searches suggest that this
+ uses the same assignment as Interop.
+ */
+ _state->audio_desc.ChannelFormat = ASDCP::PCM::CF_CFG_4;
}
_state->frame_buffer.Capacity (ASDCP::PCM::CalcFrameBufferSize (_state->audio_desc));
diff --git a/src/sound_asset_writer.h b/src/sound_asset_writer.h
index b13300c2..02639423 100644
--- a/src/sound_asset_writer.h
+++ b/src/sound_asset_writer.h
@@ -63,7 +63,7 @@ public:
private:
friend class SoundAsset;
- SoundAssetWriter (SoundAsset *, boost::filesystem::path, Standard standard, ChannelAssignment);
+ SoundAssetWriter (SoundAsset *, boost::filesystem::path, Standard standard);
void write_current_frame ();
diff --git a/src/types.h b/src/types.h
index c3aee26b..dd2e10a6 100644
--- a/src/types.h
+++ b/src/types.h
@@ -232,20 +232,6 @@ enum Formulation {
DCI_SPECIFIC
};
-/** Possible channel assignments for SMPTE DCP audio */
-enum ChannelAssignment {
- /** L/R/C/Lfe/Ls/Rs/HI/VI */
- CHANNEL_ASSIGNMENT_51,
- /** L/R/C/Lfe/Ls/Rs/Cs/unused/HI/VI */
- CHANNEL_ASSIGNMENT_61,
- /** L/R/C/Lfe/Ls/Rs/Lc/Rc/HI/VI */
- CHANNEL_ASSIGNMENT_71,
- /** "Wild track format"; no assignment */
- CHANNEL_ASSIGNMENT_WTF,
- /** L/R/C/Lfe/Ls/Rs/Lrs/Rrs/HI/VI */
- CHANNEL_ASSIGNMENT_71_DS
-};
-
/** @class Colour
* @brief An RGB colour.
*/
diff --git a/test/dcp_test.cc b/test/dcp_test.cc
index bbc6ff83..ce10ee28 100644
--- a/test/dcp_test.cc
+++ b/test/dcp_test.cc
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE (dcp_test1)
shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 1));
ms->set_metadata (mxf_meta);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test1/audio.mxf", dcp::SMPTE, dcp::CHANNEL_ASSIGNMENT_51);
+ shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test1/audio.mxf", dcp::SMPTE);
SF_INFO info;
info.format = 0;
@@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE (dcp_test2)
shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 1));
ms->set_metadata (mxf_meta);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test2/audio.mxf", dcp::SMPTE, dcp::CHANNEL_ASSIGNMENT_51);
+ shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test2/audio.mxf", dcp::SMPTE);
SF_INFO info;
info.format = 0;
@@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE (dcp_test5)
shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 1));
ms->set_metadata (mxf_meta);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test5/audio.mxf", dcp::SMPTE, dcp::CHANNEL_ASSIGNMENT_51);
+ shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/dcp_test5/audio.mxf", dcp::SMPTE);
SF_INFO info;
info.format = 0;
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index 665169d9..a817d246 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE (encryption_test)
shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 1));
ms->set_metadata (mxf_metadata);
ms->set_key (key);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/encryption_test/audio.mxf", dcp::SMPTE, dcp::CHANNEL_ASSIGNMENT_51);
+ shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write ("build/test/DCP/encryption_test/audio.mxf", dcp::SMPTE);
SF_INFO info;
info.format = 0;