added samples type and duplicated video renderer

This commit is contained in:
itsmattkc
2019-10-22 13:22:30 +11:00
parent b3e6f8bbee
commit f1e4e1c685
16 changed files with 440 additions and 957 deletions
+20 -6
View File
@@ -22,14 +22,16 @@
#include <QDebug>
AudioRendererThreadBase::AudioRendererThreadBase(const int &sample_rate, const uint64_t &channel_layout, const olive::SampleFormat &format) :
audio_params_(sample_rate, channel_layout, format)
AudioRendererThreadBase::AudioRendererThreadBase(QOpenGLContext *share_ctx, const int &width, const int &height, const int &divider, const olive::PixelFormat &format, const olive::RenderMode &mode) :
share_ctx_(share_ctx),
render_instance_(width, height, divider, format, mode)
{
connect(share_ctx_, SIGNAL(aboutToBeDestroyed()), this, SLOT(Cancel()));
}
AudioRendererParams *AudioRendererThreadBase::params()
RenderInstance *AudioRendererThreadBase::render_instance()
{
return &audio_params_;
return &render_instance_;
}
void AudioRendererThreadBase::run()
@@ -37,11 +39,23 @@ void AudioRendererThreadBase::run()
// Lock mutex for main loop
mutex_.lock();
render_instance_.SetShareContext(share_ctx_);
// Allocate and create resources
bool started = render_instance_.Start();
// Signal that main thread can continue now
WakeCaller();
// Main loop (use Cancel() to exit it)
ProcessLoop();
if (started) {
// Main loop (use Cancel() to exit it)
ProcessLoop();
}
// Free all resources
render_instance_.Stop();
// Unlock mutex before exiting
mutex_.unlock();