1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 #ifndef LIBWEBM_COMMON_HDR_UTIL_H_
9 #define LIBWEBM_COMMON_HDR_UTIL_H_
15 #include "mkvmuxer/mkvmuxer.h"
19 struct MasteringMetadata;
20 struct PrimaryChromaticity;
21 } // namespace mkvparser
24 // Utility types and functions for working with the Colour element and its
25 // children. Copiers return true upon success. Presence functions return true
26 // when the specified element is present.
28 // TODO(tomfinegan): These should be moved to libwebm_utils once c++11 is
29 // required by libwebm.
31 typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
33 bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
34 PrimaryChromaticityPtr* muxer_pc);
36 bool MasteringMetadataValuePresent(double value);
38 bool CopyMasteringMetadata(const mkvparser::MasteringMetadata& parser_mm,
39 mkvmuxer::MasteringMetadata* muxer_mm);
41 bool ColourValuePresent(long long value);
43 bool CopyColour(const mkvparser::Colour& parser_colour,
44 mkvmuxer::Colour* muxer_colour);
46 // Returns VP9 profile upon success or 0 upon failure.
47 int ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length);
49 } // namespace libwebm
51 #endif // LIBWEBM_COMMON_HDR_UTIL_H_