Files
ladybird/Libraries/LibMedia/FFmpeg/FFmpegIOContext.h
Zaggy1024 972438c4d7 LibMedia: Abstract the interface of IncrementallyPopulatedStream
The way that other classes interact with IncrementallyPopulatedStream
is now through a virtual interface MediaStream and MediaStreamCursor.
This way, we can have simpler implementations of reading media data
that will not require an RB tree and synchronization.
2026-01-30 10:02:00 -06:00

32 lines
720 B
C++

/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/NonnullOwnPtr.h>
#include <AK/NonnullRefPtr.h>
#include <LibMedia/FFmpeg/FFmpegForward.h>
#include <LibMedia/Forward.h>
namespace Media::FFmpeg {
class FFmpegIOContext {
public:
explicit FFmpegIOContext(NonnullRefPtr<MediaStreamCursor>, AVIOContext*);
~FFmpegIOContext();
static ErrorOr<NonnullOwnPtr<FFmpegIOContext>> create(NonnullRefPtr<MediaStreamCursor>);
AVIOContext* avio_context() const { return m_avio_context; }
private:
NonnullRefPtr<MediaStreamCursor> m_stream_cursor;
AVIOContext* m_avio_context { nullptr };
};
}