mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibMedia: Demux videos with FFmpeg
This gives us access to container types other than Matroska, the biggest one being MP4.
This commit is contained in:
parent
3412935a62
commit
b789ba5e5f
Notes:
github-actions[bot]
2025-03-13 18:34:55 +00:00
Author: https://github.com/Lubrsi
Commit: b789ba5e5f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3892
Reviewed-by: https://github.com/ADKaster
12 changed files with 358 additions and 29 deletions
|
@ -14,7 +14,7 @@ extern "C" {
|
|||
|
||||
namespace Media::FFmpeg {
|
||||
|
||||
static inline AVCodecID ffmpeg_codec_id_from_serenity_codec_id(CodecID codec)
|
||||
static inline AVCodecID ffmpeg_codec_id_from_media_codec_id(CodecID codec)
|
||||
{
|
||||
switch (codec) {
|
||||
case CodecID::VP8:
|
||||
|
@ -45,4 +45,35 @@ static inline AVCodecID ffmpeg_codec_id_from_serenity_codec_id(CodecID codec)
|
|||
}
|
||||
}
|
||||
|
||||
static inline CodecID media_codec_id_from_ffmpeg_codec_id(AVCodecID codec)
|
||||
{
|
||||
switch (codec) {
|
||||
case AV_CODEC_ID_VP8:
|
||||
return CodecID::VP8;
|
||||
case AV_CODEC_ID_VP9:
|
||||
return CodecID::VP9;
|
||||
case AV_CODEC_ID_H261:
|
||||
return CodecID::H261;
|
||||
case AV_CODEC_ID_MPEG2VIDEO:
|
||||
// FIXME: This could also map to CodecID::MPEG1
|
||||
return CodecID::H262;
|
||||
case AV_CODEC_ID_H263:
|
||||
return CodecID::H263;
|
||||
case AV_CODEC_ID_H264:
|
||||
return CodecID::H264;
|
||||
case AV_CODEC_ID_HEVC:
|
||||
return CodecID::H265;
|
||||
case AV_CODEC_ID_AV1:
|
||||
return CodecID::AV1;
|
||||
case AV_CODEC_ID_THEORA:
|
||||
return CodecID::Theora;
|
||||
case AV_CODEC_ID_VORBIS:
|
||||
return CodecID::Vorbis;
|
||||
case AV_CODEC_ID_OPUS:
|
||||
return CodecID::Opus;
|
||||
default:
|
||||
return CodecID::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue