renderer/decoder: use same background mechanism to conform audio as well
This commit is contained in:
@@ -106,3 +106,27 @@ void AudioStream::clear_index()
|
||||
index_done_ = false;
|
||||
index_length_ = 0;
|
||||
}
|
||||
|
||||
bool AudioStream::has_conformed_version(const AudioRenderingParams ¶ms)
|
||||
{
|
||||
QMutexLocker locker(&index_access_lock_);
|
||||
|
||||
foreach (const AudioRenderingParams& p, conformed_) {
|
||||
if (p == params) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void AudioStream::append_conformed_version(const AudioRenderingParams ¶ms)
|
||||
{
|
||||
{
|
||||
QMutexLocker locker(&index_access_lock_);
|
||||
|
||||
conformed_.append(params);
|
||||
}
|
||||
|
||||
emit ConformAppended(params);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
#ifndef AUDIOSTREAM_H
|
||||
#define AUDIOSTREAM_H
|
||||
|
||||
#include <QVector>
|
||||
|
||||
#include "common/rational.h"
|
||||
#include "render/audioparams.h"
|
||||
#include "stream.h"
|
||||
|
||||
/**
|
||||
@@ -29,6 +32,7 @@
|
||||
*/
|
||||
class AudioStream : public Stream
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioStream();
|
||||
|
||||
@@ -51,6 +55,12 @@ public:
|
||||
|
||||
void clear_index();
|
||||
|
||||
bool has_conformed_version(const AudioRenderingParams& params);
|
||||
void append_conformed_version(const AudioRenderingParams& params);
|
||||
|
||||
signals:
|
||||
void ConformAppended(const AudioRenderingParams& params);
|
||||
|
||||
private:
|
||||
int channels_;
|
||||
uint64_t layout_;
|
||||
@@ -60,6 +70,8 @@ private:
|
||||
rational index_length_;
|
||||
bool index_done_;
|
||||
|
||||
QVector<AudioRenderingParams> conformed_;
|
||||
|
||||
};
|
||||
|
||||
using AudioStreamPtr = std::shared_ptr<AudioStream>;
|
||||
|
||||
Reference in New Issue
Block a user