LibVideo: Replace DeprecatedFlyString with FlyString

This commit is contained in:
Kevin Meyer 2024-01-02 15:45:53 +01:00 committed by Andrew Kaster
parent 8b2144c8e6
commit 284f14d046
Notes: sideshowbarker 2024-07-17 01:12:07 +09:00
5 changed files with 13 additions and 13 deletions

View file

@ -8,7 +8,7 @@
#include <AK/ByteBuffer.h>
#include <AK/ByteString.h>
#include <AK/DeprecatedFlyString.h>
#include <AK/FlyString.h>
#include <AK/HashMap.h>
#include <AK/OwnPtr.h>
#include <AK/Time.h>
@ -115,10 +115,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; }
DeprecatedFlyString language() const { return m_language; }
void set_language(DeprecatedFlyString const& language) { m_language = language; }
DeprecatedFlyString codec_id() const { return m_codec_id; }
void set_codec_id(DeprecatedFlyString const& codec_id) { m_codec_id = codec_id; }
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; }
double timestamp_scale() const { return m_timestamp_scale; }
void set_timestamp_scale(double timestamp_scale) { m_timestamp_scale = timestamp_scale; }
u64 codec_delay() const { return m_codec_delay; }
@ -144,8 +144,8 @@ private:
u64 m_track_number { 0 };
u64 m_track_uid { 0 };
TrackType m_track_type { Invalid };
DeprecatedFlyString m_language = "eng";
DeprecatedFlyString m_codec_id;
FlyString m_language = "eng"_fly_string;
FlyString m_codec_id;
double m_timestamp_scale { 1 };
u64 m_codec_delay { 0 };
u64 m_timestamp_offset { 0 };

View file

@ -71,7 +71,7 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status(
return &m_track_statuses.get(track).release_value();
}
CodecID MatroskaDemuxer::get_codec_id_for_string(DeprecatedFlyString const& codec_id)
CodecID MatroskaDemuxer::get_codec_id_for_string(FlyString const& codec_id)
{
dbgln_if(MATROSKA_DEBUG, "Codec ID: {}", codec_id);
if (codec_id == "V_VP8")

View file

@ -46,7 +46,7 @@ private:
};
DecoderErrorOr<TrackStatus*> get_track_status(Track track);
CodecID get_codec_id_for_string(DeprecatedFlyString const& codec_id);
CodecID get_codec_id_for_string(FlyString const& codec_id);
Reader m_reader;

View file

@ -468,11 +468,11 @@ static DecoderErrorOr<TrackEntry> parse_track_entry(Streamer& streamer)
dbgln_if(MATROSKA_TRACE_DEBUG, "Read TrackType attribute: {}", to_underlying(track_entry.track_type()));
break;
case TRACK_LANGUAGE_ID:
track_entry.set_language(TRY_READ(streamer.read_string()));
track_entry.set_language(DECODER_TRY_ALLOC(FlyString::from_utf8(TRY_READ(streamer.read_string()).view())));
dbgln_if(MATROSKA_TRACE_DEBUG, "Read Track's Language attribute: {}", track_entry.language());
break;
case TRACK_CODEC_ID:
track_entry.set_codec_id(TRY_READ(streamer.read_string()));
track_entry.set_codec_id(DECODER_TRY_ALLOC(FlyString::from_utf8(TRY_READ(streamer.read_string()).view())));
dbgln_if(MATROSKA_TRACE_DEBUG, "Read Track's CodecID attribute: {}", track_entry.codec_id());
break;
case TRACK_TIMESTAMP_SCALE_ID:

View file

@ -52,8 +52,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
outln("\tTrack #{} with TrackID {}", track_entry.track_number(), track_entry.track_uid());
outln("\tTrack has TrackType {}", static_cast<u8>(track_entry.track_type()));
outln("\tTrack has Language \"{}\"", track_entry.language().characters());
outln("\tTrack has CodecID \"{}\"", track_entry.codec_id().characters());
outln("\tTrack has Language \"{}\"", track_entry.language());
outln("\tTrack has CodecID \"{}\"", track_entry.codec_id());
outln("\tTrack has TrackTimestampScale {}", track_entry.timestamp_scale());
outln("\tTrack has CodecDelay {}", track_entry.codec_delay());