frame/texture: use dividers when allocating buffers
Allows render pipeline to know the "real" and "simulated" resolution of a divided buffer.
This commit is contained in:
@@ -57,7 +57,7 @@ void Decoder::set_stream(StreamPtr fs)
|
||||
stream_ = fs;
|
||||
}
|
||||
|
||||
FramePtr Decoder::RetrieveVideo(const rational &/*timecode*/, const int &/*divider*/)
|
||||
FramePtr Decoder::RetrieveVideo(const rational &/*timecode*/, const int &/*divider*/, bool /*use_proxies*/)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ public:
|
||||
* A FramePtr of valid data at this timecode or nullptr if there was nothing to retrieve at the provided timecode or
|
||||
* the media could not be opened.
|
||||
*/
|
||||
virtual FramePtr RetrieveVideo(const rational& timecode, const int& divider);
|
||||
virtual FramePtr RetrieveVideo(const rational& timecode, const int& divider, bool use_proxies);
|
||||
|
||||
/**
|
||||
* @brief Retrieve video frame
|
||||
|
||||
@@ -135,7 +135,7 @@ bool FFmpegDecoder::Open()
|
||||
return true;
|
||||
}
|
||||
|
||||
FramePtr FFmpegDecoder::RetrieveVideo(const rational &timecode, const int ÷r)
|
||||
FramePtr FFmpegDecoder::RetrieveVideo(const rational &timecode, const int ÷r, bool use_proxies)
|
||||
{
|
||||
QMutexLocker locker(&mutex_);
|
||||
|
||||
@@ -169,9 +169,10 @@ FramePtr FFmpegDecoder::RetrieveVideo(const rational &timecode, const int &divid
|
||||
|
||||
if (in) {
|
||||
FramePtr copy = Frame::Create();
|
||||
copy->set_video_params(VideoRenderingParams(GetScaledDimension(vs->width(), vs->using_proxy()),
|
||||
GetScaledDimension(vs->height(), vs->using_proxy()),
|
||||
native_pix_fmt_));
|
||||
copy->set_video_params(VideoRenderingParams(vs->width(),
|
||||
vs->height(),
|
||||
native_pix_fmt_,
|
||||
vs->using_proxy()));
|
||||
copy->set_timestamp(Timecode::timestamp_to_time(target_ts, time_base_));
|
||||
copy->set_sample_aspect_ratio(aspect_ratio_);
|
||||
copy->allocate();
|
||||
@@ -314,9 +315,10 @@ FramePtr FFmpegDecoder::RetrieveVideo(const rational &timecode, const int &divid
|
||||
|
||||
// Create frame to return
|
||||
FramePtr copy = Frame::Create();
|
||||
copy->set_video_params(VideoRenderingParams(GetScaledDimension(vs->width(), divider),
|
||||
GetScaledDimension(vs->height(), divider),
|
||||
native_pix_fmt_));
|
||||
copy->set_video_params(VideoRenderingParams(vs->width(),
|
||||
vs->height(),
|
||||
native_pix_fmt_,
|
||||
divider));
|
||||
copy->set_timestamp(Timecode::timestamp_to_time(target_ts, time_base_));
|
||||
copy->set_sample_aspect_ratio(aspect_ratio_);
|
||||
copy->allocate();
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
virtual bool Probe(Footage *f, const QAtomicInt *cancelled) override;
|
||||
|
||||
virtual bool Open() override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider) override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider, bool use_proxies) override;
|
||||
virtual SampleBufferPtr RetrieveAudio(const rational &timecode, const rational &length, const AudioRenderingParams& params) override;
|
||||
virtual void Close() override;
|
||||
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@ void Frame::set_video_params(const VideoRenderingParams ¶ms)
|
||||
params_ = params;
|
||||
|
||||
// Align linesize to 16
|
||||
linesize_ = qCeil(static_cast<double>(params.width()) / 16.0) * 16;
|
||||
linesize_ = qCeil(static_cast<double>(width()) / 16.0) * 16;
|
||||
}
|
||||
|
||||
int Frame::linesize_pixels() const
|
||||
@@ -62,12 +62,12 @@ int Frame::linesize_bytes() const
|
||||
|
||||
const int &Frame::width() const
|
||||
{
|
||||
return params_.width();
|
||||
return params_.effective_width();
|
||||
}
|
||||
|
||||
const int &Frame::height() const
|
||||
{
|
||||
return params_.height();
|
||||
return params_.effective_height();
|
||||
}
|
||||
|
||||
const PixelFormat::Format &Frame::format() const
|
||||
|
||||
@@ -154,7 +154,7 @@ bool OIIODecoder::Open()
|
||||
return true;
|
||||
}
|
||||
|
||||
FramePtr OIIODecoder::RetrieveVideo(const rational &timecode, const int& divider)
|
||||
FramePtr OIIODecoder::RetrieveVideo(const rational &timecode, const int& divider, bool /*use_proxies*/)
|
||||
{
|
||||
QMutexLocker locker(&mutex_);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
virtual bool Probe(Footage *f, const QAtomicInt* cancelled) override;
|
||||
|
||||
virtual bool Open() override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider) override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider, bool use_proxies) override;
|
||||
virtual void Close() override;
|
||||
|
||||
virtual bool SupportsVideo() override;
|
||||
|
||||
Reference in New Issue
Block a user