You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Adding new settings class to be used for changing realtime settings used by libopenshot, such as scaling mode for preview vs final render, or hardware decode, etc...
This commit is contained in:
@@ -1748,11 +1748,16 @@ void FFmpegWriter::OutputStreamInfo()
|
||||
// Init a collection of software rescalers (thread safe)
|
||||
void FFmpegWriter::InitScalers(int source_width, int source_height)
|
||||
{
|
||||
int scale_mode = SWS_FAST_BILINEAR;
|
||||
if (openshot::Settings::Instance()->HIGH_QUALITY_SCALING) {
|
||||
scale_mode = SWS_LANCZOS;
|
||||
}
|
||||
|
||||
// Init software rescalers vector (many of them, one for each thread)
|
||||
for (int x = 0; x < num_of_rescalers; x++)
|
||||
{
|
||||
// Init the software scaler from FFMpeg
|
||||
img_convert_ctx = sws_getContext(source_width, source_height, PIX_FMT_RGBA, info.width, info.height, AV_GET_CODEC_PIXEL_FORMAT(video_st, video_st->codec), SWS_LANCZOS, NULL, NULL, NULL);
|
||||
img_convert_ctx = sws_getContext(source_width, source_height, PIX_FMT_RGBA, info.width, info.height, AV_GET_CODEC_PIXEL_FORMAT(video_st, video_st->codec), scale_mode, NULL, NULL, NULL);
|
||||
|
||||
// Add rescaler to vector
|
||||
image_rescalers.push_back(img_convert_ctx);
|
||||
|
||||
Reference in New Issue
Block a user