footage combobox returns streams rather than footage

This commit is contained in:
itsmattkc
2019-09-19 00:51:45 +10:00
parent a059e9f72b
commit 088b0543eb
16 changed files with 94 additions and 23 deletions
+6 -7
View File
@@ -95,9 +95,9 @@ NodeOutput *MediaInput::texture_output()
return texture_output_;
}
void MediaInput::SetFootage(Footage *f)
void MediaInput::SetFootage(StreamPtr f)
{
footage_input_->set_value(PtrToValue(f));
footage_input_->set_value(QVariant::fromValue(f));
}
void MediaInput::Hash(QCryptographicHash *hash, NodeOutput *from, const rational &time)
@@ -284,10 +284,10 @@ bool MediaInput::SetupDecoder()
}
// Get currently selected Footage
Footage* footage = ValueToPtr<Footage>(footage_input_->get_value(0));
StreamPtr stream = footage_input_->get_value(0).value<StreamPtr>();
// If no footage is selected, return nothing
if (footage == nullptr) {
if (stream == nullptr) {
return false;
}
@@ -295,13 +295,12 @@ bool MediaInput::SetupDecoder()
// Determine which decoder to use
if (decoder_ == nullptr
&& (decoder_ = Decoder::CreateFromID(footage->decoder())) == nullptr) {
&& (decoder_ = Decoder::CreateFromID(stream->footage()->decoder())) == nullptr) {
return false;
}
if (decoder_->stream() == nullptr) {
// FIXME: Hardcoded stream 0
decoder_->set_stream(footage->stream(0));
decoder_->set_stream(stream);
}
return true;
+1 -1
View File
@@ -49,7 +49,7 @@ public:
NodeOutput* texture_output();
void SetFootage(Footage* f);
void SetFootage(StreamPtr f);
virtual void Hash(QCryptographicHash *hash, NodeOutput* from, const rational &time) override;