42 #include <asdcp/AS_DCP.h>
50 SoundFrame::SoundFrame (ASDCP::PCM::MXFReader* reader,
int n, std::shared_ptr<const DecryptionContext> c,
bool check_hmac)
51 :
Frame<ASDCP::PCM::MXFReader, ASDCP::PCM::FrameBuffer> (reader, n, c, check_hmac)
53 ASDCP::PCM::AudioDescriptor desc;
54 reader->FillAudioDescriptor (desc);
55 _channels = desc.ChannelCount;
56 _bits = desc.QuantizationBits;
61 SoundFrame::get (
int channel,
int frame)
const
66 uint8_t
const * d = data() + (frame * _channels * 3) + (channel * 3);
68 return (d[0] << 8 | (d[1] << 16) | (d[2] << 24)) >> 8;
72 uint8_t
const * d = data() + (frame * _channels * 2) + (channel * 2);
73 return d[0] | (d[1] << 8);
82 SoundFrame::channels ()
const
89 SoundFrame::samples ()
const
91 return size() / (_channels * _bits / 8);
Namespace for everything in libdcp.