mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibMedia: Replace FlyString with String for Matroska track attributes
The values stored by these are either going to be fairly unique or too short to benefit from FlyString.
This commit is contained in:
parent
5456072d48
commit
e8238b4098
Notes:
github-actions[bot]
2025-10-28 00:35:04 +00:00
Author: https://github.com/Zaggy1024
Commit: e8238b4098
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/gmta ✅
3 changed files with 11 additions and 12 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
* Copyright (c) 2025, Gregory Bertilson <gregory@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -9,11 +10,10 @@
|
|||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/FixedArray.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Time.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibMedia/Color/CodingIndependentCodePoints.h>
|
||||
|
||||
namespace Media::Matroska {
|
||||
|
|
@ -116,10 +116,10 @@ public:
|
|||
void set_track_uid(u64 track_uid) { m_track_uid = track_uid; }
|
||||
TrackType track_type() const { return m_track_type; }
|
||||
void set_track_type(TrackType track_type) { m_track_type = track_type; }
|
||||
FlyString language() const { return m_language; }
|
||||
void set_language(FlyString const& language) { m_language = language; }
|
||||
FlyString codec_id() const { return m_codec_id; }
|
||||
void set_codec_id(FlyString const& codec_id) { m_codec_id = codec_id; }
|
||||
String language() const { return m_language; }
|
||||
void set_language(String const& language) { m_language = language; }
|
||||
String codec_id() const { return m_codec_id; }
|
||||
void set_codec_id(String const& codec_id) { m_codec_id = codec_id; }
|
||||
ReadonlyBytes codec_private_data() const LIFETIME_BOUND { return m_codec_private_data.span(); }
|
||||
ErrorOr<void> set_codec_private_data(ReadonlyBytes codec_private_data)
|
||||
{
|
||||
|
|
@ -151,8 +151,8 @@ private:
|
|||
u64 m_track_number { 0 };
|
||||
u64 m_track_uid { 0 };
|
||||
TrackType m_track_type { Invalid };
|
||||
FlyString m_language = "eng"_fly_string;
|
||||
FlyString m_codec_id;
|
||||
String m_language = "eng"_string;
|
||||
String m_codec_id;
|
||||
FixedArray<u8> m_codec_private_data;
|
||||
double m_timestamp_scale { 1 };
|
||||
u64 m_codec_delay { 0 };
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
* Copyright (c) 2022-2025, Gregory Bertilson <gregory@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -115,7 +115,7 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status(
|
|||
return &m_track_statuses.get(track).release_value();
|
||||
}
|
||||
|
||||
CodecID MatroskaDemuxer::get_codec_id_for_string(FlyString const& codec_id)
|
||||
static CodecID get_codec_id_for_string(String const& codec_id)
|
||||
{
|
||||
dbgln_if(MATROSKA_DEBUG, "Codec ID: {}", codec_id);
|
||||
if (codec_id == "V_VP8")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
* Copyright (c) 2022-2025, Gregory Bertilson <gregory@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -54,7 +54,6 @@ private:
|
|||
};
|
||||
|
||||
DecoderErrorOr<TrackStatus*> get_track_status(Track track);
|
||||
static CodecID get_codec_id_for_string(FlyString const& codec_id);
|
||||
|
||||
Reader m_reader;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue