viewer: re-render both video and audio if parameters change

This commit is contained in:
itsmattkc
2020-02-24 11:57:39 +11:00
parent 6239107670
commit fceb1e8d3e
3 changed files with 39 additions and 7 deletions
+20
View File
@@ -77,6 +77,26 @@ const RenderMode::Mode &VideoRenderingParams::mode() const
return mode_;
}
bool VideoRenderingParams::operator==(const VideoRenderingParams &rhs) const
{
return width() == rhs.width()
&& height() == rhs.height()
&& time_base() == rhs.time_base()
&& format() == rhs.format()
&& mode() == rhs.mode()
&& divider() == rhs.divider();
}
bool VideoRenderingParams::operator!=(const VideoRenderingParams &rhs) const
{
return width() != rhs.width()
|| height() != rhs.height()
|| time_base() != rhs.time_base()
|| format() != rhs.format()
|| mode() != rhs.mode()
|| divider() != rhs.divider();
}
void VideoRenderingParams::calculate_effective_size()
{
effective_width_ = width() / divider_;
+3
View File
@@ -36,6 +36,9 @@ public:
const PixelFormat::Format& format() const;
const RenderMode::Mode& mode() const;
bool operator==(const VideoRenderingParams& rhs) const;
bool operator!=(const VideoRenderingParams& rhs) const;
private:
void calculate_effective_size();