various: allow users to override the start and end index of image sequences
Also includes various fixes to footage property setting/signalling.
This commit is contained in:
@@ -91,11 +91,13 @@ bool ImageStream::premultiplied_alpha() const
|
||||
void ImageStream::set_premultiplied_alpha(bool e)
|
||||
{
|
||||
premultiplied_alpha_ = e;
|
||||
|
||||
emit ParametersChanged();
|
||||
}
|
||||
|
||||
const QString &ImageStream::colorspace() const
|
||||
const QString &ImageStream::colorspace(bool default_if_empty) const
|
||||
{
|
||||
if (colorspace_.isEmpty()) {
|
||||
if (colorspace_.isEmpty() && default_if_empty) {
|
||||
return footage()->project()->default_input_colorspace();
|
||||
} else {
|
||||
return colorspace_;
|
||||
@@ -106,7 +108,7 @@ void ImageStream::set_colorspace(const QString &color)
|
||||
{
|
||||
colorspace_ = color;
|
||||
|
||||
emit ColorSpaceChanged();
|
||||
emit ParametersChanged();
|
||||
}
|
||||
|
||||
void ImageStream::ColorConfigChanged()
|
||||
@@ -123,13 +125,13 @@ void ImageStream::ColorConfigChanged()
|
||||
}
|
||||
|
||||
// Either way, the color calculation has likely changed so we signal here
|
||||
emit ColorSpaceChanged();
|
||||
emit ParametersChanged();
|
||||
}
|
||||
|
||||
void ImageStream::DefaultColorSpaceChanged()
|
||||
{
|
||||
// If no colorspace is set, this stream uses the default color space and it's just changed
|
||||
if (colorspace_.isEmpty()) {
|
||||
emit ColorSpaceChanged();
|
||||
emit ParametersChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,12 +43,9 @@ public:
|
||||
bool premultiplied_alpha() const;
|
||||
void set_premultiplied_alpha(bool e);
|
||||
|
||||
const QString& colorspace() const;
|
||||
const QString& colorspace(bool default_if_empty = true) const;
|
||||
void set_colorspace(const QString& color);
|
||||
|
||||
signals:
|
||||
void ColorSpaceChanged();
|
||||
|
||||
protected:
|
||||
virtual void FootageSetEvent(Footage*) override;
|
||||
|
||||
|
||||
@@ -107,6 +107,8 @@ const int64_t &Stream::duration() const
|
||||
void Stream::set_duration(const int64_t &duration)
|
||||
{
|
||||
duration_ = duration;
|
||||
|
||||
emit ParametersChanged();
|
||||
}
|
||||
|
||||
bool Stream::enabled() const
|
||||
|
||||
@@ -115,6 +115,8 @@ protected:
|
||||
signals:
|
||||
void IndexChanged();
|
||||
|
||||
void ParametersChanged();
|
||||
|
||||
private:
|
||||
Footage* footage_;
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
const int64_t VideoStream::kEndTimestamp = AV_NOPTS_VALUE;
|
||||
|
||||
VideoStream::VideoStream() :
|
||||
start_time_(0)
|
||||
start_time_(0),
|
||||
is_image_sequence_(false)
|
||||
{
|
||||
set_type(kVideo);
|
||||
}
|
||||
@@ -57,6 +58,17 @@ const int64_t &VideoStream::start_time() const
|
||||
void VideoStream::set_start_time(const int64_t &start_time)
|
||||
{
|
||||
start_time_ = start_time;
|
||||
emit ParametersChanged();
|
||||
}
|
||||
|
||||
bool VideoStream::is_image_sequence() const
|
||||
{
|
||||
return is_image_sequence_;
|
||||
}
|
||||
|
||||
void VideoStream::set_image_sequence(bool e)
|
||||
{
|
||||
is_image_sequence_ = e;
|
||||
}
|
||||
|
||||
int64_t VideoStream::get_closest_timestamp_in_frame_index(const rational &time)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
class VideoStream : public ImageStream
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VideoStream();
|
||||
|
||||
@@ -43,6 +44,9 @@ public:
|
||||
const int64_t& start_time() const;
|
||||
void set_start_time(const int64_t& start_time);
|
||||
|
||||
bool is_image_sequence() const;
|
||||
void set_image_sequence(bool e);
|
||||
|
||||
int64_t get_closest_timestamp_in_frame_index(const rational& time);
|
||||
int64_t get_closest_timestamp_in_frame_index(int64_t timestamp);
|
||||
void clear_frame_index();
|
||||
@@ -62,6 +66,8 @@ private:
|
||||
|
||||
QMutex index_access_lock_;
|
||||
|
||||
bool is_image_sequence_;
|
||||
|
||||
};
|
||||
|
||||
using VideoStreamPtr = std::shared_ptr<VideoStream>;
|
||||
|
||||
Reference in New Issue
Block a user