Shaka Packager SDK
dts_audio_specific_config.cc
1 // Copyright (c) 2023 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 
6 #include <packager/media/codecs/dts_audio_specific_config.h>
7 
8 #include <packager/media/base/bit_reader.h>
9 #include <packager/media/base/rcheck.h>
10 
11 namespace shaka {
12 namespace media {
13 
14 bool GetDTSXChannelMask(const std::vector<uint8_t>& udts, uint32_t& mask) {
15  // udts is the DTS-UHD Specific Box: ETSI TS 103 491 V1.2.1 Table B-2
16  // DecoderProfileCode(6 bits)
17  // FrameDurationCode(2 bits)
18  // MaxPayloadCode(3 bits)
19  // NumPresentationsCode(5 bits)
20  // ChannelMask (32 bits)
21  BitReader bit_reader(udts.data(), udts.size());
22  RCHECK(bit_reader.SkipBits(16));
23  RCHECK(bit_reader.ReadBits(32, &mask));
24  return true;
25 }
26 
27 } // namespace media
28 } // namespace shaka
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66