frames Previously, when the video renderer received a dirty cache signal, it would proceed to extract all frames from the range and queue them. However, this could be extremely slow for long ranges since it had to iterate through the entire range and calculate the individual frames it contained. Now, we use the same range combining system as audio and automatically calculate the next frame within the range only when necessary. Essentially the same work, but split up over time and done only when needed leading to no discernible UI pause when invalidating cache.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef AUDIORENDERBACKEND_H
|
|
#define AUDIORENDERBACKEND_H
|
|
|
|
#include "common/timerange.h"
|
|
#include "renderbackend.h"
|
|
|
|
class AudioRenderBackend : public RenderBackend
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
AudioRenderBackend(QObject* parent = nullptr);
|
|
|
|
/**
|
|
* @brief Set parameters of the Renderer
|
|
*
|
|
* The Renderer owns the buffers that are used in the rendering process and this function sets the kind of buffers
|
|
* to use. The Renderer must be stopped when calling this function.
|
|
*/
|
|
void SetParameters(const AudioRenderingParams ¶ms);
|
|
|
|
virtual QIODevice* GetAudioPullDevice() = 0;
|
|
|
|
const AudioRenderingParams& params();
|
|
|
|
QString CachePathName();
|
|
|
|
protected:
|
|
virtual void ConnectViewer(ViewerOutput* node) override;
|
|
|
|
virtual void DisconnectViewer(ViewerOutput* node) override;
|
|
|
|
/**
|
|
* @brief Internal function for generating the cache ID
|
|
*/
|
|
virtual bool GenerateCacheIDInternal(QCryptographicHash& hash) override;
|
|
|
|
virtual NodeInput* GetDependentInput() override;
|
|
|
|
virtual bool CanRender() override;
|
|
|
|
private:
|
|
AudioRenderingParams params_;
|
|
|
|
};
|
|
|
|
#endif // AUDIORENDERBACKEND_H
|