footage: merge video and image streams and improve image sequence import process
Image streams were initially separated from video streams, but they're now joined with a parameter defining if they're a still image, image sequence, or regular video. The image sequence import process has also improved so that if images from the same sequence are imported too, they'll either be ignored or the user won't be asked again for those if they should be an image sequence (fixes #1193). Also shifts decoder "probe" process to return an item, useful if the decoder returns a non-footage item.
This commit is contained in:
@@ -278,33 +278,29 @@ void Sequence::set_parameters_from_footage(const QList<Footage *> footage)
|
||||
VideoStream* vs = static_cast<VideoStream*>(s.get());
|
||||
|
||||
// If this is a video stream, use these parameters
|
||||
if (!found_video_params && !vs->frame_rate().isNull()) {
|
||||
if (!found_video_params) {
|
||||
rational using_timebase;
|
||||
|
||||
if (vs->video_type() == VideoStream::kVideoTypeStill) {
|
||||
// If this is a still image, we'll use it's resolution but won't set
|
||||
// `found_video_params` in case something with a frame rate comes along which we'll
|
||||
// prioritize
|
||||
using_timebase = video_params().time_base();
|
||||
} else {
|
||||
using_timebase = vs->frame_rate().flipped();
|
||||
found_video_params = true;
|
||||
}
|
||||
|
||||
set_video_params(VideoParams(vs->width(),
|
||||
vs->height(),
|
||||
vs->frame_rate().flipped(),
|
||||
using_timebase,
|
||||
static_cast<PixelFormat::Format>(Config::Current()["DefaultSequencePreviewFormat"].toInt()),
|
||||
vs->pixel_aspect_ratio(),
|
||||
vs->interlacing(),
|
||||
VideoParams::generate_auto_divider(vs->width(), vs->height())));
|
||||
found_video_params = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Stream::kImage:
|
||||
if (!found_video_params) {
|
||||
// If this is an image stream, we'll use it's resolution but won't set `found_video_params` in case
|
||||
// something with a frame rate comes along which we'll prioritize
|
||||
ImageStream* is = static_cast<ImageStream*>(s.get());
|
||||
|
||||
set_video_params(VideoParams(is->width(),
|
||||
is->height(),
|
||||
video_params().time_base(),
|
||||
static_cast<PixelFormat::Format>(Config::Current()["DefaultSequencePreviewFormat"].toInt()),
|
||||
is->pixel_aspect_ratio(),
|
||||
is->interlacing(),
|
||||
VideoParams::generate_auto_divider(is->width(), is->height())));
|
||||
}
|
||||
break;
|
||||
case Stream::kAudio:
|
||||
if (!found_audio_params) {
|
||||
AudioStream* as = static_cast<AudioStream*>(s.get());
|
||||
|
||||
Reference in New Issue
Block a user