codec system rework
Codecs are now much cleaner and thread safe by design.
This commit is contained in:
@@ -66,38 +66,6 @@ void AudioStream::set_sample_rate(const int &sample_rate)
|
||||
sample_rate_ = sample_rate;
|
||||
}
|
||||
|
||||
bool AudioStream::try_start_conforming(const AudioParams ¶ms)
|
||||
{
|
||||
QMutexLocker locker(proxy_access_lock());
|
||||
|
||||
if (!currently_conforming_.contains(params)
|
||||
&& !conformed_.contains(params)) {
|
||||
currently_conforming_.append(params);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioStream::has_conformed_version(const AudioParams ¶ms)
|
||||
{
|
||||
QMutexLocker locker(proxy_access_lock());
|
||||
|
||||
return conformed_.contains(params);
|
||||
}
|
||||
|
||||
void AudioStream::append_conformed_version(const AudioParams ¶ms)
|
||||
{
|
||||
{
|
||||
QMutexLocker locker(proxy_access_lock());
|
||||
|
||||
currently_conforming_.removeOne(params);
|
||||
conformed_.append(params);
|
||||
}
|
||||
|
||||
emit ConformAppended(params);
|
||||
}
|
||||
|
||||
QIcon AudioStream::icon() const
|
||||
{
|
||||
return icon::Audio;
|
||||
|
||||
@@ -49,10 +49,6 @@ public:
|
||||
const int& sample_rate() const;
|
||||
void set_sample_rate(const int& sample_rate);
|
||||
|
||||
bool try_start_conforming(const AudioParams& params);
|
||||
bool has_conformed_version(const AudioParams& params);
|
||||
void append_conformed_version(const AudioParams& params);
|
||||
|
||||
virtual QIcon icon() const override;
|
||||
|
||||
protected:
|
||||
@@ -60,18 +56,11 @@ protected:
|
||||
|
||||
virtual void SaveCustomParameters(QXmlStreamWriter* writer) const override;
|
||||
|
||||
signals:
|
||||
void ConformAppended(OLIVE_NAMESPACE::AudioParams params);
|
||||
|
||||
private:
|
||||
int channels_;
|
||||
uint64_t layout_;
|
||||
int sample_rate_;
|
||||
|
||||
QList<AudioParams> conformed_;
|
||||
|
||||
QList<AudioParams> currently_conforming_;
|
||||
|
||||
};
|
||||
|
||||
using AudioStreamPtr = std::shared_ptr<AudioStream>;
|
||||
|
||||
@@ -308,7 +308,7 @@ bool Footage::CompareFootageToItsFilename(FootagePtr footage)
|
||||
} else {
|
||||
// Footage may have changed and we'll have to re-probe it. It also may not have, in which
|
||||
// case nothing needs to change.
|
||||
ItemPtr item = Decoder::ProbeMedia(footage->project(), footage->filename(), nullptr);
|
||||
ItemPtr item = Decoder::Probe(footage->project(), footage->filename(), nullptr);
|
||||
|
||||
if (item && item->type() == footage->type()) {
|
||||
// Item is the same type, that's a good sign. Let's look for any differences.
|
||||
|
||||
Reference in New Issue
Block a user