mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Tests/LibMedia: Add a test for H.264 decoding through FFmpeg
This commit is contained in:
parent
48a21d5d6a
commit
084cf68dd5
Notes:
sideshowbarker
2024-07-16 22:22:13 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/084cf68dd5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/230 Reviewed-by: https://github.com/ADKaster
4 changed files with 22 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
set(TEST_SOURCES
|
||||
TestH264Decode.cpp
|
||||
TestParseMatroska.cpp
|
||||
TestVP9Decode.cpp
|
||||
)
|
||||
|
@ -7,6 +8,7 @@ foreach(source IN LISTS TEST_SOURCES)
|
|||
serenity_test("${source}" LibMedia LIBS LibMedia)
|
||||
endforeach()
|
||||
|
||||
install(FILES avc_in_matroska.mkv DESTINATION usr/Tests/LibMedia)
|
||||
install(FILES vp9_in_webm.webm DESTINATION usr/Tests/LibMedia)
|
||||
install(FILES vp9_4k.webm DESTINATION usr/Tests/LibMedia)
|
||||
install(FILES vp9_clamp_reference_mvs.webm DESTINATION usr/Tests/LibMedia)
|
||||
|
|
19
Tests/LibMedia/TestH264Decode.cpp
Normal file
19
Tests/LibMedia/TestH264Decode.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibMedia/FFmpeg/FFmpegVideoDecoder.h>
|
||||
|
||||
#include "TestMediaCommon.h"
|
||||
|
||||
static NonnullOwnPtr<Media::VideoDecoder> make_decoder(Media::Matroska::SampleIterator const& iterator)
|
||||
{
|
||||
return MUST(Media::FFmpeg::FFmpegVideoDecoder::try_create(Media::CodecID::H264, iterator.track().codec_private_data()));
|
||||
}
|
||||
|
||||
TEST_CASE(avc_in_matroska)
|
||||
{
|
||||
decode_video("./avc_in_matroska.mkv"sv, 50, make_decoder);
|
||||
}
|
BIN
Tests/LibMedia/avc_in_matroska.mkv
Normal file
BIN
Tests/LibMedia/avc_in_matroska.mkv
Normal file
Binary file not shown.
|
@ -85,6 +85,7 @@ public:
|
|||
DecoderErrorOr<Block> next_block();
|
||||
Cluster const& current_cluster() const { return *m_current_cluster; }
|
||||
Optional<Duration> const& last_timestamp() const { return m_last_timestamp; }
|
||||
TrackEntry const& track() const { return *m_track; }
|
||||
|
||||
private:
|
||||
friend class Reader;
|
||||
|
|
Loading…
Reference in a new issue