I want to make qt application that contains video play function.
Already, I can play video using VLC-QT Library, and its Examples
Some reason, I want stretch preview.
I found change aspect ratio, but that is only support with enum
/*
enum Ratio {
Original,
Ignore, !< QML aspect ratio only
R_16_9,
R_16_10,
R_185_100,
R_221_100,
R_235_100,
R_239_100,
R_4_3,
R_5_4,
R_5_3,
R_1_1
}
*/
Vlc::Ratio r = Vlc::Ratio::R_1_1;
ui->video->setDefaultAspectRatio(r);
ui->video->setAspectRatio(r);
ui->video->setCurrentCropRatio(r);
ui->video->setDefaultCropRatio(r);
ui->video->setCropRatio(r);
ui->video->enableDefaultSettings();
Current:
How I can configure stretch mode?
I also encountered the same problem, and after my attempts, the following solution is feasible
You can keep the same aspect ratio as QWidget in QWidget::resizeEvent(QResizeEvent* event);