Shaka Packager SDK
Loading...
Searching...
No Matches
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 <cstdint>
9#include <vector>
10
11#include <packager/media/base/bit_reader.h>
12#include <packager/media/base/rcheck.h>
13
14namespace shaka {
15namespace media {
16
17bool GetDTSXChannelMask(const std::vector<uint8_t>& udts, uint32_t& mask) {
18 // udts is the DTS-UHD Specific Box: ETSI TS 103 491 V1.2.1 Table B-2
19 // DecoderProfileCode(6 bits)
20 // FrameDurationCode(2 bits)
21 // MaxPayloadCode(3 bits)
22 // NumPresentationsCode(5 bits)
23 // ChannelMask (32 bits)
24 BitReader bit_reader(udts.data(), udts.size());
25 RCHECK(bit_reader.SkipBits(16));
26 RCHECK(bit_reader.ReadBits(32, &mask));
27 return true;
28}
29
30} // namespace media
31} // namespace shaka
All the methods that are virtual are virtual for mocking.