mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 17:00:35 +03:00
Tests/LibVideo: Add a test for Matroska files containing CRC32 elements
This commit is contained in:
parent
cf1cb04af0
commit
b94c132dd1
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/SerenityOS/serenity/commit/b94c132dd1 Pull-request: https://github.com/SerenityOS/serenity/pull/19599 Reviewed-by: https://github.com/trflynn89
@ -1,4 +1,5 @@
|
||||
set(TEST_SOURCES
|
||||
TestParseMatroska.cpp
|
||||
TestVP9Decode.cpp
|
||||
)
|
||||
|
||||
@ -10,3 +11,4 @@ install(FILES vp9_in_webm.webm DESTINATION usr/Tests/LibVideo)
|
||||
install(FILES vp9_4k.webm DESTINATION usr/Tests/LibVideo)
|
||||
install(FILES vp9_clamp_reference_mvs.webm DESTINATION usr/Tests/LibVideo)
|
||||
install(FILES vp9_oob_blocks.webm DESTINATION usr/Tests/LibVideo)
|
||||
install(FILES master_elements_containing_crc32.mkv DESTINATION usr/Tests/LibVideo)
|
||||
|
@ -1,4 +1,4 @@
|
||||
## vp9_clamp_reference_mvs.webm
|
||||
## vp9_clamp_reference_mvs.webm & master_elements_containing_crc32.mkv
|
||||
|
||||
Licensed under [Creative Commons Attribution 3.0](http://creativecommons.org/licenses/by/3.0/)\
|
||||
(c) copyright 2008, Blender Foundation / [www.bigbuckbunny.org](https://www.bigbuckbunny.org)
|
||||
|
25
Tests/LibVideo/TestParseMatroska.cpp
Normal file
25
Tests/LibVideo/TestParseMatroska.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <LibVideo/Containers/Matroska/Reader.h>
|
||||
|
||||
TEST_CASE(master_elements_containing_crc32)
|
||||
{
|
||||
auto matroska_reader = MUST(Video::Matroska::Reader::from_file("master_elements_containing_crc32.mkv"sv));
|
||||
u64 video_track = 0;
|
||||
MUST(matroska_reader.for_each_track_of_type(Video::Matroska::TrackEntry::TrackType::Video, [&](Video::Matroska::TrackEntry const& track_entry) -> Video::DecoderErrorOr<IterationDecision> {
|
||||
video_track = track_entry.track_number();
|
||||
return IterationDecision::Break;
|
||||
}));
|
||||
VERIFY(video_track == 1);
|
||||
|
||||
auto iterator = MUST(matroska_reader.create_sample_iterator(video_track));
|
||||
MUST(iterator.next_block());
|
||||
MUST(matroska_reader.seek_to_random_access_point(iterator, Duration::from_seconds(7)));
|
||||
MUST(iterator.next_block());
|
||||
}
|
BIN
Tests/LibVideo/master_elements_containing_crc32.mkv
Normal file
BIN
Tests/LibVideo/master_elements_containing_crc32.mkv
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user