summaryrefslogtreecommitdiff
path: root/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
diff options
context:
space:
mode:
authorFrank Galligan <fgalligan@google.com>2016-10-17 12:41:39 -0700
committerFrank Galligan <fgalligan@google.com>2016-10-17 12:45:05 -0700
commit808a560be6a71dd0d27f29c26f9fefb5e809d373 (patch)
tree0cccb37802013e6ac2b8447acccd4695c3762924 /third_party/libwebm/mkvmuxer/mkvmuxerutil.h
parent9e8efa5b189a5abf78b1bcbc8076893728129d1e (diff)
downloadlibvpx-808a560be6a71dd0d27f29c26f9fefb5e809d373.tar
libvpx-808a560be6a71dd0d27f29c26f9fefb5e809d373.tar.gz
libvpx-808a560be6a71dd0d27f29c26f9fefb5e809d373.tar.bz2
libvpx-808a560be6a71dd0d27f29c26f9fefb5e809d373.zip
third_party: Roll libwebm snapshot.
fc5f88d Fix temp files being left on system. c04a134 Add support for overriding PixelWidth and PixelHeight. c0160e0 Add support to explicitly set segment duration. 02bc809 Add support to estimate file duration. c97e3e7 Add support to output sub-sample encryption information. 26f4344 MakeUID: quiet unused param warning in Android builds d6af52a Change check to fix compile error. 1720020 webm_parser: Add Mesh value for ProjectionType 78f2c5a webm_parser: Use ./ prefix for includes da62f65 webm_parser: Remove webm/ prefix from public includes e15e8f2 webm_parser: Update README build instructions 5023f2b mkvmuxer: Fix Colour::Valid() cf16204 mkvmuxer_tests: Actually test cue points in the cue point test. 93e9fb3 Validate Colour element values. 8036925 mkvparser_tests: Add Projection element test. f52d38c mkvparser_tests: Add Colour element test. 826436a mkvparser: minor SeekHead::Entry clean up. 24fb44a mkvmuxer_tests: Add Projection element test. 1e0a8ea mkvmuxer_tests: Add Colour element test. 0278616 mkvmuxer: Colour accessors/mutators. 2346f8f Add mkvparser wrapper functions. 54d6b6b webm_info: Add Projection element support. 65fee06 mkvmuxer_sample: Add support for Projection element. 9a3f2b5 mkvparser_sample: Add support for Projection element. 41e814a mkvparser: Add Projection element support. 483a0ff mkvmuxer: Add Projection element support. 676a713 Add support for the Projection element 725f362 mkvmuxer: Fix memory leak when Colour is set multiple times. fa182de mkvparser_sample: Add output of audio track codec private size. 8f521f2 mkvparser_tests: Add invalid BlockGroup test. 39137d7 Remove docs saying binary elements default to 0 c147504 Fix legacy Makefile. 80685d3 Do not skip over unknown elements at the root level 58711e8 mkvparser_sample: Fix version info string. 837746f mkvparser_tests: Add invalid block test. 207cd80 Disambiguate sample sources and targets. a112d71 mkvparser_tests: Refactor invalid file loading code. 5dea33e Disambiguate test source and target names. 125049e parser_tests: Add another truncated chapter string test. 1de8d4c parser_tests: Add truncated chapter string test. ff8c2b6 parser_tests: Move cue validation to test_util. 4b0690f parser_tests: Add invalid lacing test. 9828e39 mkvmuxer: Set default doc type version to 4. 5495a59 webm_parser: Reference more files in CMakeLists.txt. 0c0ecd0 vpxpes_parser: Add start code emulation prevention support. 639a4bc webm2pes: Remove debug printfs(). 9a51102 webm2pes: fflush() in the correct conversion function. dc7f155 webm2pes: Track total bytes written. d518128 webm_parser: Enable usage of werror. e1fe762 webm2pes: Add test for mux/demux of large input. 1b24a79 vpxpes_parser: Read and store PTS when present. 6cf0a0f vpxpes_parser: Store frame payloads. 25d2602 webm_parser: Convert style to match the rest of libwebm 24be76d webm2pes: Replace VpxFrame with VideoFrame. b451c3b Add a basic video frame storage class. 05c90eb libwebm_util: Clarify error text in superframe parser. e6415af webm2pes: Make WritePesPacket() a public method. 8f840dd webm2pes: Move frame read out of PES packet write method. 448af97 webm2pes: Restore frame fragmentation support. f8bb714 cmake: Integrate new parsing API and tests. cb8ce0b Add a new incremental parsing API 900d322 vpxpes_parser/webm2pes: BCMV and PTS fixes. 4b73545 webm2pes: Add start code emulation prevention. 82903f3 Add column tiles and frame parallel to webm_info 5d91edf style_clean_up: Remove unnecessary parentheses a95aa4b vp9_level_stats: correct total_uncompressed_bits_ calculation f46566f mkvreader: Fix shorten-64-to-32 warning in 32 bit builds. 76630ca mkvwriter: Fix shorten-64-to-32 warning in 32 bit builds. a8ffbd4 webm2pes: Fix format specifier warnings. faf89d4 Add MaxLumaSampleRate grace percent to stats. d31e6c9 Fix profile 2 in vp9_header_parser. bd3ab3a Add flag to estimate last frame's duration to stats. c182ed9 Fix lint issue in hdr_util.h cc62ecd Add test for Cluster memory leak 196708a Change MaxLumaSampleRate to be based on frame resolution. cbd676b mkvmuxer: Fix leak when a Cluster isn't finalized 47f2843 Add parsing support for new features in CodecPrivate. 9a235e0 mkvmuxer: Set doctype to matroska when muxing non-WebM codecs. e3c9576 Add VP9 level output to webm_info. bbaaf2d Add class to gather VP9 level stats. 5cf549f cmake: Log compiler flag at check time. 8bb68c2 Add file to parse data from VP9 frames. df3412f Add support for setting VP9 profile and level to sample_muxer. 296429a Add support to parse VP9 profile. 87832d4 mkvmuxer: Fix Segment::Finalize in kLive mode 6df3e56 mkvmuxerutil.hpp: Add using directives for overloaded size utils. ec47928 mkvmuxerutil: Revert to using mkvmuxertypes. 4e3d037 Add support to output Colour elements to webm_info. a1dc4f2 Fix parsing of VP9 level. 039df94 Add TEST_TMPDIR environment variable d3656fd muxer_tests: ignore iwyu re gtest-message.h e76dd5e Fix file name in mkvmuxertypes shim. 1be5889 Add temporary include shims at old file locations. Change-Id: I6a1026814560be80d604a5ecb9b66406a1186dd9
Diffstat (limited to 'third_party/libwebm/mkvmuxer/mkvmuxerutil.h')
-rw-r--r--third_party/libwebm/mkvmuxer/mkvmuxerutil.h85
1 files changed, 51 insertions, 34 deletions
diff --git a/third_party/libwebm/mkvmuxer/mkvmuxerutil.h b/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
index 0e21a2dcb..132388da5 100644
--- a/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
+++ b/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
@@ -8,87 +8,104 @@
#ifndef MKVMUXER_MKVMUXERUTIL_H_
#define MKVMUXER_MKVMUXERUTIL_H_
-#include <stdint.h>
+#include "mkvmuxertypes.h"
+
+#include "stdint.h"
namespace mkvmuxer {
class Cluster;
class Frame;
class IMkvWriter;
-const uint64_t kEbmlUnknownValue = 0x01FFFFFFFFFFFFFFULL;
-const int64_t kMaxBlockTimecode = 0x07FFFLL;
+// TODO(tomfinegan): mkvmuxer:: integer types continue to be used here because
+// changing them causes pain for downstream projects. It would be nice if a
+// solution that allows removal of the mkvmuxer:: integer types while avoiding
+// pain for downstream users of libwebm. Considering that mkvmuxerutil.{cc,h}
+// are really, for the great majority of cases, EBML size calculation and writer
+// functions, perhaps a more EBML focused utility would be the way to go as a
+// first step.
+
+const uint64 kEbmlUnknownValue = 0x01FFFFFFFFFFFFFFULL;
+const int64 kMaxBlockTimecode = 0x07FFFLL;
// Writes out |value| in Big Endian order. Returns 0 on success.
-int32_t SerializeInt(IMkvWriter* writer, int64_t value, int32_t size);
+int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size);
// Returns the size in bytes of the element.
-int32_t GetUIntSize(uint64_t value);
-int32_t GetIntSize(int64_t value);
-int32_t GetCodedUIntSize(uint64_t value);
-uint64_t EbmlMasterElementSize(uint64_t type, uint64_t value);
-uint64_t EbmlElementSize(uint64_t type, int64_t value);
-uint64_t EbmlElementSize(uint64_t type, uint64_t value);
-uint64_t EbmlElementSize(uint64_t type, float value);
-uint64_t EbmlElementSize(uint64_t type, const char* value);
-uint64_t EbmlElementSize(uint64_t type, const uint8_t* value, uint64_t size);
-uint64_t EbmlDateElementSize(uint64_t type);
+int32 GetUIntSize(uint64 value);
+int32 GetIntSize(int64 value);
+int32 GetCodedUIntSize(uint64 value);
+uint64 EbmlMasterElementSize(uint64 type, uint64 value);
+uint64 EbmlElementSize(uint64 type, int64 value);
+uint64 EbmlElementSize(uint64 type, uint64 value);
+uint64 EbmlElementSize(uint64 type, float value);
+uint64 EbmlElementSize(uint64 type, const char* value);
+uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size);
+uint64 EbmlDateElementSize(uint64 type);
// Returns the size in bytes of the element assuming that the element was
// written using |fixed_size| bytes. If |fixed_size| is set to zero, then it
// computes the necessary number of bytes based on |value|.
-uint64_t EbmlElementSize(uint64_t type, uint64_t value, uint64_t fixed_size);
+uint64 EbmlElementSize(uint64 type, uint64 value, uint64 fixed_size);
// Creates an EBML coded number from |value| and writes it out. The size of
// the coded number is determined by the value of |value|. |value| must not
// be in a coded form. Returns 0 on success.
-int32_t WriteUInt(IMkvWriter* writer, uint64_t value);
+int32 WriteUInt(IMkvWriter* writer, uint64 value);
// Creates an EBML coded number from |value| and writes it out. The size of
// the coded number is determined by the value of |size|. |value| must not
// be in a coded form. Returns 0 on success.
-int32_t WriteUIntSize(IMkvWriter* writer, uint64_t value, int32_t size);
+int32 WriteUIntSize(IMkvWriter* writer, uint64 value, int32 size);
// Output an Mkv master element. Returns true if the element was written.
-bool WriteEbmlMasterElement(IMkvWriter* writer, uint64_t value, uint64_t size);
+bool WriteEbmlMasterElement(IMkvWriter* writer, uint64 value, uint64 size);
// Outputs an Mkv ID, calls |IMkvWriter::ElementStartNotify|, and passes the
// ID to |SerializeInt|. Returns 0 on success.
-int32_t WriteID(IMkvWriter* writer, uint64_t type);
+int32 WriteID(IMkvWriter* writer, uint64 type);
// Output an Mkv non-master element. Returns true if the element was written.
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, uint64_t value);
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, int64_t value);
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, float value);
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, const char* value);
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, const uint8_t* value,
- uint64_t size);
-bool WriteEbmlDateElement(IMkvWriter* writer, uint64_t type, int64_t value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, int64 value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const uint8* value,
+ uint64 size);
+bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value);
// Output an Mkv non-master element using fixed size. The element will be
// written out using exactly |fixed_size| bytes. If |fixed_size| is set to zero
// then it computes the necessary number of bytes based on |value|. Returns true
// if the element was written.
-bool WriteEbmlElement(IMkvWriter* writer, uint64_t type, uint64_t value,
- uint64_t fixed_size);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value,
+ uint64 fixed_size);
// Output a Mkv Frame. It decides the correct element to write (Block vs
// SimpleBlock) based on the parameters of the Frame.
-uint64_t WriteFrame(IMkvWriter* writer, const Frame* const frame,
- Cluster* cluster);
+uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
+ Cluster* cluster);
// Output a void element. |size| must be the entire size in bytes that will be
// void. The function will calculate the size of the void header and subtract
// it from |size|.
-uint64_t WriteVoidElement(IMkvWriter* writer, uint64_t size);
+uint64 WriteVoidElement(IMkvWriter* writer, uint64 size);
// Returns the version number of the muxer in |major|, |minor|, |build|,
// and |revision|.
-void GetVersion(int32_t* major, int32_t* minor, int32_t* build,
- int32_t* revision);
+void GetVersion(int32* major, int32* minor, int32* build, int32* revision);
// Returns a random number to be used for UID, using |seed| to seed
// the random-number generator (see POSIX rand_r() for semantics).
-uint64_t MakeUID(unsigned int* seed);
+uint64 MakeUID(unsigned int* seed);
+
+// Colour field validation helpers. All return true when |value| is valid.
+bool IsMatrixCoefficientsValueValid(uint64_t value);
+bool IsChromaSitingHorzValueValid(uint64_t value);
+bool IsChromaSitingVertValueValid(uint64_t value);
+bool IsColourRangeValueValid(uint64_t value);
+bool IsTransferCharacteristicsValueValid(uint64_t value);
+bool IsPrimariesValueValid(uint64_t value);
} // namespace mkvmuxer