Skip to content

Truly independent web browser

LibMedia: Remove the unused ContainerNavigator class

Zaggy1024e155ed43af77
diff --git a/Libraries/LibMedia/Containers/ContainerNavigator.h b/Libraries/LibMedia/Containers/ContainerNavigator.h
deleted file mode 100644
index 41056ffb86a..00000000000
--- a/Libraries/LibMedia/Containers/ContainerNavigator.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2026-present, the Ladybird developers.
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#pragma once
-
-#include <AK/HashMap.h>
-#include <AK/Optional.h>
-#include <AK/Time.h>
-#include <AK/Variant.h>
-#include <AK/Vector.h>
-#include <LibMedia/MediaStream.h>
-#include <LibMedia/TimeRanges.h>
-#include <LibMediaCodecs/DecoderError.h>
-
-namespace Media {
-
-struct SeekSkipped { };
-
-struct SeekedPosition {
- i64 byte_position;
- AK::Duration timestamp;
-};
-
-using SeekResult = Variant<Empty, SeekSkipped, SeekedPosition>;
-
-class ContainerNavigator {
-public:
- AK_ALLOC_WITH_KMALLOC;
-
- virtual ~ContainerNavigator() = default;
-
- // Seeks arrive from each track's demuxing thread, and the buffered-ranges scan runs on its
- // own thread; implementations must tolerate all of these running concurrently.
- virtual DecoderErrorOr<SeekResult> seek_to_timestamp(u64 track_identifier, AK::Duration) const
- {
- (void)track_identifier;
- return Empty {};
- }
- // Returns a scan for each audio and video track in the container.
- virtual Vector<BufferedRangesScan> buffered_time_ranges_by_track(Vector<MediaStream::ByteRange> const& byte_ranges) const = 0;
-};
-
-// Adapts a navigator over a single-track container to the per-track interface. Such containers
-// hold their format's only stream, so the track identifier is always stream index zero.
-class SingleTrackContainerNavigator : public ContainerNavigator {
-public:
- virtual DecoderErrorOr<SeekResult> seek_to_timestamp(u64, AK::Duration timestamp) const final
- {
- return seek_to_timestamp(timestamp);
- }
-
- virtual Vector<BufferedRangesScan> buffered_time_ranges_by_track(Vector<MediaStream::ByteRange> const& byte_ranges) const final
- {
- return { buffered_time_ranges(byte_ranges) };
- }
-
-protected:
- virtual DecoderErrorOr<SeekResult> seek_to_timestamp(AK::Duration) const { return Empty {}; }
- virtual BufferedRangesScan buffered_time_ranges(Vector<MediaStream::ByteRange> const& byte_ranges) const = 0;
-};
-
-}
diff --git a/Libraries/LibMedia/Containers/FrameScanTimeline.h b/Libraries/LibMedia/Containers/FrameScanTimeline.h
index e491762e20f..e3a01dbb1e1 100644
--- a/Libraries/LibMedia/Containers/FrameScanTimeline.h
+++ b/Libraries/LibMedia/Containers/FrameScanTimeline.h
@@ -13,7 +13,6 @@
#include <AK/Time.h>
#include <AK/Variant.h>
#include <AK/Vector.h>
-#include <LibMedia/Containers/ContainerNavigator.h>
#include <LibMedia/Export.h>
#include <LibMedia/MediaStream.h>
#include <LibMedia/TimeRanges.h>
@@ -57,6 +56,11 @@ protected:
}
};
+struct SeekedPosition {
+ i64 byte_position;
+ AK::Duration timestamp;
+};
+
enum class DurationSource : u8 {
Declared,
Estimated,
diff --git a/Libraries/LibMedia/Forward.h b/Libraries/LibMedia/Forward.h
index 73b8f01dd47..3ceafe9d006 100644
--- a/Libraries/LibMedia/Forward.h
+++ b/Libraries/LibMedia/Forward.h
@@ -17,7 +17,6 @@ class AudioOutputFactory;
class AudioPlaybackSink;
class AudioProducer;
class AudioSink;
-class ContainerNavigator;
class DecodedAudioProducer;
class DecodedVideoProducer;
class Demuxer;