mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibMedia: Move FFmpegIOContext into it's own file
This allows it to be reused for video.
This commit is contained in:
parent
2f9d2acdb2
commit
3412935a62
Notes:
github-actions[bot]
2025-03-13 18:35:00 +00:00
Author: https://github.com/Lubrsi
Commit: 3412935a62
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3892
Reviewed-by: https://github.com/ADKaster
5 changed files with 117 additions and 84 deletions
32
Libraries/LibMedia/FFmpeg/FFmpegIOContext.h
Normal file
32
Libraries/LibMedia/FFmpeg/FFmpegIOContext.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
}
|
||||
|
||||
namespace Media::FFmpeg {
|
||||
|
||||
class FFmpegIOContext {
|
||||
public:
|
||||
explicit FFmpegIOContext(AVIOContext*);
|
||||
~FFmpegIOContext();
|
||||
|
||||
static ErrorOr<NonnullOwnPtr<FFmpegIOContext>> create(AK::SeekableStream& stream);
|
||||
|
||||
AVIOContext* avio_context() const { return m_avio_context; }
|
||||
|
||||
private:
|
||||
AVIOContext* m_avio_context { nullptr };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue