diff options
author | Harish Mahendrakar <hmahendrakar@google.com> | 2023-10-31 19:33:03 +0000 |
---|---|---|
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-11-17 02:50:12 +0000 |
commit | e546ccacd3177e86ab7cd5ff1c457748313a750f (patch) | |
tree | 1df2a4965f354fcb732ed90b80f33e7ee692b043 | |
parent | 0a7513cba230ffffd6f2bd5a67c87dbb448f8372 (diff) | |
download | libwebm-e546ccacd3177e86ab7cd5ff1c457748313a750f.tar.gz |
Upgrade libwebm to libwebm-1.0.0.31
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update libwebm
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Bug: 308688826
Test: TreeHugger
Test: atest CtsMediaV2TestCases:ExtractorTest \
CtsMediaV2TestCases:ExtractorUnitTest \
CtsMediaV2TestCases:MuxerTest \
CtsMediaV2TestCases:MuxerUnitTest
(cherry picked from https://android-review.googlesource.com/q/commit:76291c2912ba965a35f0dbdc0103c38289df3773)
Merged-In: I18bedd39853cf9c79053614c4ceb4f54ad430956
Change-Id: I18bedd39853cf9c79053614c4ceb4f54ad430956
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | m2ts/webm2pes.cc | 41 | ||||
-rw-r--r-- | mkvmuxer/mkvmuxerutil.cc | 2 | ||||
-rw-r--r-- | mkvparser/mkvparser.cc | 8 | ||||
-rw-r--r-- | testing/test_util.h | 5 | ||||
-rw-r--r-- | webm_parser/src/master_parser.h | 13 |
7 files changed, 48 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a35f34..85b2603 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,9 +334,6 @@ set(webvtt_common_sources set(vttdemux_sources ${webvtt_common_sources} "${LIBWEBM_SRC_DIR}/vttdemux.cc") -# Public headers that will be installed with the library. -set(webm_public_headers ${mkvmuxer_public_headers} ${mkvparser_public_headers}) - # Targets. add_library(mkvmuxer OBJECT ${mkvmuxer_sources}) add_library(mkvparser OBJECT ${mkvparser_sources}) @@ -372,8 +369,6 @@ if(ENABLE_WEBM_PARSER) add_executable(webm_parser_demo ${webm_parser_demo_sources}) target_link_libraries(webm_parser_demo LINK_PUBLIC webm) - - list(APPEND webm_public_headers ${webm_parser_public_headers}) endif() if(ENABLE_WEBMTS) @@ -459,7 +454,9 @@ if(ENABLE_IWYU) endif() endif() -set_target_properties(webm PROPERTIES PUBLIC_HEADER "${webm_public_headers}") +# webm_parser headers are rooted at webm/. +set_target_properties(webm PROPERTIES PUBLIC_HEADER + "${webm_parser_public_headers}") install( TARGETS webm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -470,3 +467,8 @@ install( # Install common headers into a subdirectory to avoid breaking nested includes. install(FILES ${libwebm_common_public_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webm/common) +# mkvmuxer and mkvparser headers are referenced with their prefix. +install(FILES ${mkvmuxer_public_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webm/mkvmuxer) +install(FILES ${mkvparser_public_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webm/mkvparser) @@ -13,11 +13,11 @@ third_party { type: GIT value: "https://chromium.googlesource.com/webm/libwebm" } - version: "libwebm-1.0.0.30" + version: "libwebm-1.0.0.31" license_type: NOTICE last_upgrade_date { year: 2023 - month: 7 - day: 11 + month: 10 + day: 31 } } diff --git a/m2ts/webm2pes.cc b/m2ts/webm2pes.cc index afa8a6b..a4169c0 100644 --- a/m2ts/webm2pes.cc +++ b/m2ts/webm2pes.cc @@ -33,9 +33,6 @@ std::string ToString(const char* str) { // void PesOptionalHeader::SetPtsBits(std::int64_t pts_90khz) { - std::uint64_t* pts_bits = &pts.bits; - *pts_bits = 0; - // PTS is broken up and stored in 40 bits as shown: // // PES PTS Only flag @@ -48,32 +45,36 @@ void PesOptionalHeader::SetPtsBits(std::int64_t pts_90khz) { const std::uint32_t pts2 = (pts_90khz >> 15) & 0x7FFF; const std::uint32_t pts3 = pts_90khz & 0x7FFF; - std::uint8_t buffer[5] = {0}; - // PTS only flag. - buffer[0] |= 1 << 5; - // Top 3 bits of PTS and 1 bit marker. - buffer[0] |= pts1 << 1; - // Marker. - buffer[0] |= 1; + pts.bits = 0; - // Next 15 bits of pts and 1 bit marker. - // Top 8 bits of second PTS chunk. - buffer[1] |= (pts2 >> 7) & 0xff; // bottom 7 bits of second PTS chunk. - buffer[2] |= (pts2 << 1); + pts.bits |= (pts3 << 1) & 0xff; // Marker. - buffer[2] |= 1; + pts.bits |= 1; // Last 15 bits of pts and 1 bit marker. // Top 8 bits of second PTS chunk. - buffer[3] |= (pts3 >> 7) & 0xff; + pts.bits <<= 8; + pts.bits |= (pts3 >> 7) & 0xff; + // bottom 7 bits of second PTS chunk. - buffer[4] |= (pts3 << 1) & 0xff; + pts.bits <<= 8; + pts.bits |= (pts2 << 1); // Marker. - buffer[4] |= 1; + pts.bits |= 1; - // Write bits into PesHeaderField. - std::memcpy(reinterpret_cast<std::uint8_t*>(pts_bits), buffer, 5); + // Next 15 bits of pts and 1 bit marker. + // Top 8 bits of second PTS chunk. + pts.bits <<= 8; + pts.bits |= (pts2 >> 7) & 0xff; + + // PTS only flag. + pts.bits <<= 8; + pts.bits |= 1 << 5; + // Top 3 bits of PTS and 1 bit marker. + pts.bits |= pts1 << 1; + // Marker. + pts.bits |= 1; } // Writes fields to |buffer| and returns true. Returns false when write or diff --git a/mkvmuxer/mkvmuxerutil.cc b/mkvmuxer/mkvmuxerutil.cc index 4d7952f..b4b22bd 100644 --- a/mkvmuxer/mkvmuxerutil.cc +++ b/mkvmuxer/mkvmuxerutil.cc @@ -607,7 +607,7 @@ uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) { void GetVersion(int32* major, int32* minor, int32* build, int32* revision) { *major = 0; *minor = 3; - *build = 2; + *build = 3; *revision = 0; } diff --git a/mkvparser/mkvparser.cc b/mkvparser/mkvparser.cc index de0fafc..eddbc7e 100644 --- a/mkvparser/mkvparser.cc +++ b/mkvparser/mkvparser.cc @@ -55,7 +55,7 @@ Type* SafeArrayAlloc(unsigned long long num_elements, void GetVersion(int& major, int& minor, int& build, int& revision) { major = 1; minor = 1; - build = 2; + build = 3; revision = 0; } @@ -246,7 +246,8 @@ long UnserializeFloat(IMkvReader* pReader, long long pos, long long size_, if (size == 4) { union { float f; - unsigned long ff; + uint32_t ff; + static_assert(sizeof(float) == sizeof(uint32_t), ""); }; ff = 0; @@ -264,7 +265,8 @@ long UnserializeFloat(IMkvReader* pReader, long long pos, long long size_, } else { union { double d; - unsigned long long dd; + uint64_t dd; + static_assert(sizeof(double) == sizeof(uint64_t), ""); }; dd = 0; diff --git a/testing/test_util.h b/testing/test_util.h index 5f85ec7..f50d259 100644 --- a/testing/test_util.h +++ b/testing/test_util.h @@ -8,9 +8,8 @@ #ifndef LIBWEBM_TESTING_TEST_UTIL_H_ #define LIBWEBM_TESTING_TEST_UTIL_H_ -#include <stdint.h> - #include <cstddef> +#include <cstdint> #include <string> namespace mkvparser { @@ -85,4 +84,4 @@ bool ParseMkvFileReleaseParser(const std::string& webm_file, } // namespace test -#endif // LIBWEBM_TESTING_TEST_UTIL_H_
\ No newline at end of file +#endif // LIBWEBM_TESTING_TEST_UTIL_H_ diff --git a/webm_parser/src/master_parser.h b/webm_parser/src/master_parser.h index 2000167..d3ca7c7 100644 --- a/webm_parser/src/master_parser.h +++ b/webm_parser/src/master_parser.h @@ -147,17 +147,20 @@ class MasterParser : public ElementParser { /* clang-format on */ }; - using StdHashId = std::hash<std::underlying_type<Id>::type>; + using StdHashIdKeyType = std::underlying_type<Id>::type; + using StdHashId = std::hash<StdHashIdKeyType>; // Hash functor for hashing Id enums for storage in std::unordered_map. struct IdHash : StdHashId { - // Type aliases for conforming to the std::hash interface. - using argument_type = Id; +#if __cpp_lib_is_invocable + using result_type = std::invoke_result<StdHashId, StdHashIdKeyType>::type; +#else using result_type = StdHashId::result_type; +#endif // __cpp_lib_is_invocable // Returns the hash of the given id. - result_type operator()(argument_type id) const { - return StdHashId::operator()(static_cast<StdHashId::argument_type>(id)); + result_type operator()(Id id) const { + return StdHashId::operator()(static_cast<StdHashIdKeyType>(id)); } }; |