mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-22 12:40:11 +00:00
minor refactoring
This commit is contained in:
parent
78244a48d2
commit
8f2e00f31b
@ -189,6 +189,17 @@ util::buffer_t<std::uint8_t> read_sps(const AVPacket *packet, int codec_id) {
|
||||
return write(*p, (AVCodecID)codec_id);
|
||||
}
|
||||
|
||||
util::buffer_t<std::uint8_t> make_sps(const AVCodecContext *ctx, int format) {
|
||||
switch(format) {
|
||||
case 0:
|
||||
return make_sps_h264(ctx);
|
||||
}
|
||||
|
||||
BOOST_LOG(warning) << "make_sps: video format ["sv << format << "] not supported"sv;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
bool validate_sps(const AVPacket *packet, int codec_id) {
|
||||
cbs::ctx_t ctx;
|
||||
if(ff_cbs_init(&ctx, (AVCodecID)codec_id, nullptr)) {
|
||||
|
@ -8,8 +8,7 @@ struct AVCodecContext;
|
||||
namespace cbs {
|
||||
|
||||
util::buffer_t<std::uint8_t> read_sps(const AVPacket *packet, int codec_id);
|
||||
util::buffer_t<std::uint8_t> make_sps_h264(const AVCodecContext *ctx);
|
||||
util::buffer_t<std::uint8_t> make_sps_hevc(const AVCodecContext *ctx);
|
||||
util::buffer_t<std::uint8_t> make_sps(const AVCodecContext *ctx, int video_format);
|
||||
|
||||
/**
|
||||
* Check if SPS->VUI is present
|
||||
|
@ -937,7 +937,7 @@ std::optional<session_t> make_session(const encoder_t &encoder, const config_t &
|
||||
return std::make_optional<session_t>(
|
||||
std::move(ctx),
|
||||
std::move(device),
|
||||
cbs::make_sps_h264(ctx.get()));
|
||||
cbs::make_sps(ctx.get(), config.videoFormat));
|
||||
}
|
||||
|
||||
void encode_run(
|
||||
|
Loading…
x
Reference in New Issue
Block a user