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_
13 #include "mkvmuxer/mkvmuxer.h"
17 struct MasteringMetadata;
18 struct PrimaryChromaticity;
19 } // namespace mkvparser
22 // Utility types and functions for working with the Colour element and its
23 // children. Copiers return true upon success. Presence functions return true
24 // when the specified element is present.
26 // TODO(tomfinegan): These should be moved to libwebm_utils once c++11 is
27 // required by libwebm.
29 typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
31 bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
32 PrimaryChromaticityPtr* muxer_pc);
34 bool MasteringMetadataValuePresent(double value);
36 bool CopyMasteringMetadata(const mkvparser::MasteringMetadata& parser_mm,
37 mkvmuxer::MasteringMetadata* muxer_mm);
39 bool ColourValuePresent(long long value);
41 bool CopyColour(const mkvparser::Colour& parser_colour,
42 mkvmuxer::Colour* muxer_colour);
44 } // namespace libwebm
46 #endif // LIBWEBM_COMMON_HDR_UTIL_H_