added samples type and duplicated video renderer
This commit is contained in:
@@ -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 ÷r, 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();
|
||||
|
||||
Reference in New Issue
Block a user