diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index 9bf70b3b9..ca1a85ebb 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -48,7 +48,7 @@ #include "global/config.h" #include "global/path.h" #include "rendering/audio.h" -#include "rendering/bitdepths.h" +#include "rendering/pixelformats.h" #include "panels/panels.h" #include "ui/columnedgridlayout.h" #include "ui/mainwindow.h" @@ -170,36 +170,62 @@ void PreferencesDialog::delete_previews(PreviewDeleteTypes type) { void PreferencesDialog::populate_ocio_menus(OCIO::ConstConfigRcPtr config) { - // Get current display name (if the config is empty, get the current default display) - QString current_display = olive::CurrentConfig.ocio_display; - if (current_display.isEmpty()) { - current_display = config->getDefaultDisplay(); - } + if (config == nullptr) { - // Populate the display menu - ocio_display->clear(); - for (int i=0;igetNumDisplays();i++) { - ocio_display->addItem(config->getDisplay(i)); + // Just clear everything + ocio_display->clear(); + ocio_view->clear(); + ocio_look->clear(); - // Check if this index is the currently selected - if (config->getDisplay(i) == current_display) { - ocio_display->setCurrentIndex(i); + } else { + + // Get current display name (if the config is empty, get the current default display) + QString current_display = olive::CurrentConfig.ocio_display; + if (current_display.isEmpty()) { + current_display = config->getDefaultDisplay(); } - } - update_ocio_view_menu(config); + // Populate the display menu + ocio_display->clear(); + for (int i=0;igetNumDisplays();i++) { + ocio_display->addItem(config->getDisplay(i)); - // Populate the look menu - ocio_look->clear(); - ocio_look->addItem(tr("(None)"), QString()); - for (int i=0;igetNumLooks();i++) { - const char* look = config->getLookNameByIndex(i); - - ocio_look->addItem(look, look); - - if (look == olive::CurrentConfig.ocio_look) { - ocio_look->setCurrentIndex(i); + // Check if this index is the currently selected + if (config->getDisplay(i) == current_display) { + ocio_display->setCurrentIndex(i); + } } + + update_ocio_view_menu(config); + + // Populate the look menu + ocio_look->clear(); + ocio_look->addItem(tr("(None)"), QString()); + for (int i=0;igetNumLooks();i++) { + const char* look = config->getLookNameByIndex(i); + + ocio_look->addItem(look, look); + + if (look == olive::CurrentConfig.ocio_look) { + ocio_look->setCurrentIndex(i); + } + } + + } +} + +OCIO::ConstConfigRcPtr PreferencesDialog::TestOCIOConfig(const QString &url) +{ + // Check whether OCIO can load it + try { + OCIO::ConstConfigRcPtr config = OCIO::Config::CreateFromFile(ocio_config_file->text().toUtf8()); + return config; + } catch (OCIO::Exception& e) { + QMessageBox::critical(this, + tr("OpenColorIO Config Error"), + tr("Failed to set OpenColorIO configuration: %1").arg(e.what()), + QMessageBox::Ok); + return nullptr; } } @@ -231,13 +257,13 @@ void PreferencesDialog::update_ocio_view_menu(OCIO::ConstConfigRcPtr config) void PreferencesDialog::update_ocio_config(const QString &s) { - if (!s.isEmpty() && QFileInfo::exists(s)) { - try { - OCIO::ConstConfigRcPtr file_config = OCIO::Config::CreateFromFile(s.toUtf8()); + OCIO::ConstConfigRcPtr file_config = nullptr; - populate_ocio_menus(file_config); - } catch (OCIO::Exception& e) {} + if (!s.isEmpty() && QFileInfo::exists(s)) { + file_config = TestOCIOConfig(s); } + + populate_ocio_menus(file_config); } void PreferencesDialog::AddBoolPair(QCheckBox *ui, bool *value, bool restart_required) @@ -315,13 +341,9 @@ void PreferencesDialog::accept() { } else if (olive::CurrentConfig.ocio_config_path != ocio_config_file->text()) { // Check whether OCIO can load it - try { - OCIO::Config::CreateFromFile(ocio_config_file->text().toUtf8()); - } catch (OCIO::Exception& e) { - QMessageBox::critical(this, - tr("OpenColorIO Config Error"), - tr("Failed to set OpenColorIO configuration: %1").arg(e.what()), - QMessageBox::Ok); + OCIO::ConstConfigRcPtr file_config = TestOCIOConfig(ocio_config_file->text().toUtf8()); + + if (file_config == nullptr) { return; } @@ -1066,8 +1088,8 @@ void PreferencesDialog::setup_ui() { // COLOR MANAGEMENT -> Bit Depth -> Playback playback_bit_depth = new QComboBox(); - for (int i=0;iaddItem(olive::rendering::bit_depths.at(i).name, i); + for (int i=0;iaddItem(olive::pixel_formats.at(i).name, i); } playback_bit_depth->setCurrentIndex(olive::CurrentConfig.playback_bit_depth); bit_depth_groupbox_layout->addWidget(new QLabel(tr("Playback (Offline):")), 0, 0); @@ -1075,8 +1097,8 @@ void PreferencesDialog::setup_ui() { // COLOR MANAGEMENT -> Bit Depth -> Export export_bit_depth = new QComboBox(); - for (int i=0;iaddItem(olive::rendering::bit_depths.at(i).name, i); + for (int i=0;iaddItem(olive::pixel_formats.at(i).name, i); } export_bit_depth->setCurrentIndex(olive::CurrentConfig.export_bit_depth); bit_depth_groupbox_layout->addWidget(new QLabel(tr("Export (Online):")), 0, 2); diff --git a/dialogs/preferencesdialog.h b/dialogs/preferencesdialog.h index a7cb00c9a..eb6c5663c 100644 --- a/dialogs/preferencesdialog.h +++ b/dialogs/preferencesdialog.h @@ -301,6 +301,19 @@ private: */ QVector key_shortcut_fields; + /** + * @brief Tests an OpenColorIO configuration file to determine whether it's valid and throws a messagebox if not + * + * @param url + * + * URL to the OpenColorIO configuration file. + * + * @return + * + * A OCIO::ConstConfigRcPtr config pointer if the configuration file is valid, nullptr if not. + */ + OCIO::ConstConfigRcPtr TestOCIOConfig(const QString& url); + /** * @brief Add an automated QCheckBox+boolean value pair * diff --git a/global/config.cpp b/global/config.cpp index e28ccbe1d..760fb789a 100644 --- a/global/config.cpp +++ b/global/config.cpp @@ -80,8 +80,8 @@ Config::Config() default_sequence_framerate(29.97), default_sequence_audio_frequency(48000), default_sequence_audio_channel_layout(3), - playback_bit_depth(olive::rendering::PIX_FMT_RGBA16F), - export_bit_depth(olive::rendering::PIX_FMT_RGBA32F) + playback_bit_depth(olive::PIX_FMT_RGBA16F), + export_bit_depth(olive::PIX_FMT_RGBA32F) {} void Config::load(QString path) { diff --git a/main.cpp b/main.cpp index db19302bc..395ac1813 100644 --- a/main.cpp +++ b/main.cpp @@ -24,7 +24,7 @@ #include "global/config.h" #include "global/global.h" #include "panels/timeline.h" -#include "rendering/bitdepths.h" +#include "rendering/pixelformats.h" #include "ui/mediaiconservice.h" #include "ui/mainwindow.h" @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { olive::timeline::MultiplyTrackSizesByDPI(); // set up rendering bit depths - olive::rendering::InitializeBitDepths(); + olive::InitializePixelFormats(); // connect main window's first paint to global's init finished function QObject::connect(&w, SIGNAL(finished_first_paint()), olive::Global.get(), SLOT(finished_initialize()), Qt::QueuedConnection); diff --git a/olive.pro b/olive.pro index 58b62e807..5f3e23a85 100644 --- a/olive.pro +++ b/olive.pro @@ -173,12 +173,12 @@ SOURCES += \ ui/blur.cpp \ ui/menu.cpp \ rendering/qopenglshaderprogramptr.cpp \ - rendering/bitdepths.cpp \ timeline/mediaimportdata.cpp \ dialogs/autocutsilencedialog.cpp \ ui/columnedgridlayout.cpp \ rendering/shadergenerators.cpp \ - global/timing.cpp + global/timing.cpp \ + rendering/pixelformats.cpp HEADERS += \ ui/mainwindow.h \ @@ -305,12 +305,12 @@ HEADERS += \ ui/blur.h \ ui/menu.h \ rendering/qopenglshaderprogramptr.h \ - rendering/bitdepths.h \ timeline/mediaimportdata.h \ dialogs/autocutsilencedialog.h \ ui/columnedgridlayout.h \ rendering/shadergenerators.h \ - global/timing.h + global/timing.h \ + rendering/pixelformats.h FORMS += diff --git a/project/media.cpp b/project/media.cpp index 1e77305a2..7a908f7ef 100644 --- a/project/media.cpp +++ b/project/media.cpp @@ -63,7 +63,8 @@ QString get_channel_layout_name(int channels, uint64_t layout) { Media::Media() : root(false), - type(-1) + type(-1), + disable_thumbnail_(false) { } @@ -230,6 +231,11 @@ void Media::set_name(const QString &n) { } } +void Media::disable_thumbnail(bool disable) +{ + disable_thumbnail_ = disable; +} + double Media::get_frame_rate(int stream) { switch (get_type()) { case MEDIA_TYPE_FOOTAGE: @@ -308,7 +314,8 @@ QVariant Media::data(int column, int role) { if (column == 0) { if (get_type() == MEDIA_TYPE_FOOTAGE) { Footage* f = to_footage(); - if (f->video_tracks.size() > 0 + if (!disable_thumbnail_ + && f->video_tracks.size() > 0 && f->video_tracks.at(0).preview_done) { return QIcon(QPixmap::fromImage(f->video_tracks.at(0).video_preview)); } diff --git a/project/media.h b/project/media.h index 7462b28f9..a604e2180 100644 --- a/project/media.h +++ b/project/media.h @@ -60,6 +60,7 @@ public: int get_type(); const QString& get_name(); void set_name(const QString& n); + void disable_thumbnail(bool disable); double get_frame_rate(int stream = -1); int get_sampling_rate(int stream = -1); @@ -95,6 +96,7 @@ private: QString folder_name; QString tooltip; QIcon icon; + bool disable_thumbnail_; }; #endif // MEDIA_H diff --git a/project/proxygenerator.cpp b/project/proxygenerator.cpp index 7a8ee8b6f..f90f5699d 100644 --- a/project/proxygenerator.cpp +++ b/project/proxygenerator.cpp @@ -20,23 +20,24 @@ #include "proxygenerator.h" -#include "global/path.h" -#include "project/previewgenerator.h" -#include "ui/mainwindow.h" - -#include -#include -#include -#include - -#include - extern "C" { #include #include #include } +#include +#include +#include +#include +#include + +#include "global/path.h" +#include "project/previewgenerator.h" +#include "ui/mediaiconservice.h" +#include "ui/mainwindow.h" + +// TODO provide more codecs than just this one enum AVCodecID temp_enc_codec = AV_CODEC_ID_PRORES; ProxyGenerator::ProxyGenerator() : cancelled(false) {} @@ -123,7 +124,7 @@ void ProxyGenerator::transcode(const ProxyInfo& info) { enc_ctx->width = qFloor(dec_ctx->width*info.size_multiplier); enc_ctx->height = qFloor(dec_ctx->height*info.size_multiplier); enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio; - enc_ctx->pix_fmt = enc_codec->pix_fmts[0]; + enc_ctx->pix_fmt = avcodec_find_best_pix_fmt_of_list(enc_codec->pix_fmts, dec_ctx->pix_fmt, 1, nullptr); enc_ctx->framerate = dec_ctx->framerate; enc_ctx->time_base = in_stream->time_base; out_stream->time_base = in_stream->time_base; @@ -356,9 +357,15 @@ void ProxyGenerator::run() { // set skip to false skip = false; + // set media icon to animated loading icon + olive::media_icon_service->SetMediaIcon(info.media, ICON_TYPE_LOADING); + // transcode proxy transcode(info); + // set media icon back to video + olive::media_icon_service->SetMediaIcon(info.media, ICON_TYPE_VIDEO); + // we're finished with this proxy, remove it proxy_queue.removeFirst(); diff --git a/rendering/bitdepths.cpp b/rendering/bitdepths.cpp deleted file mode 100644 index f2a623088..000000000 --- a/rendering/bitdepths.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/*** - - Olive - Non-Linear Video Editor - Copyright (C) 2019 Olive Team - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -***/ - -#include "bitdepths.h" - -#include - -namespace olive { -namespace rendering { - -QVector bit_depths; - -void InitializeBitDepths() { - - bit_depths.resize(PIX_FMT_COUNT); - - bit_depths[PIX_FMT_RGBA8].name = QCoreApplication::translate("bitdepths", "8-bit"); - bit_depths[PIX_FMT_RGBA8].internal_format = GL_RGBA8; - bit_depths[PIX_FMT_RGBA8].pixel_format = GL_RGBA; - bit_depths[PIX_FMT_RGBA8].pixel_type = GL_UNSIGNED_BYTE; - bit_depths[PIX_FMT_RGBA8].bytes_per_pixel = 4; - - bit_depths[PIX_FMT_RGBA16].name = QCoreApplication::translate("bitdepths", "16-bit Integer"); - bit_depths[PIX_FMT_RGBA16].internal_format = GL_RGBA16; - bit_depths[PIX_FMT_RGBA16].pixel_format = GL_RGBA; - bit_depths[PIX_FMT_RGBA16].pixel_type = GL_UNSIGNED_SHORT; - bit_depths[PIX_FMT_RGBA16].bytes_per_pixel = 8; - - bit_depths[PIX_FMT_RGBA16F].name = QCoreApplication::translate("bitdepths", "Half-Float (16-bit)"); - bit_depths[PIX_FMT_RGBA16F].internal_format = GL_RGBA16F; - bit_depths[PIX_FMT_RGBA16F].pixel_format = GL_RGBA; - bit_depths[PIX_FMT_RGBA16F].pixel_type = GL_HALF_FLOAT; - bit_depths[PIX_FMT_RGBA16F].bytes_per_pixel = 8; - - bit_depths[PIX_FMT_RGBA32F].name = QCoreApplication::translate("bitdepths", "Full-Float (32-bit)"); - bit_depths[PIX_FMT_RGBA32F].internal_format = GL_RGBA32F; - bit_depths[PIX_FMT_RGBA32F].pixel_format = GL_RGBA; - bit_depths[PIX_FMT_RGBA32F].pixel_type = GL_FLOAT; - bit_depths[PIX_FMT_RGBA32F].bytes_per_pixel = 16; - -} - -} -} - diff --git a/rendering/cacher.cpp b/rendering/cacher.cpp index 2ae5dfd52..917f79b6f 100644 --- a/rendering/cacher.cpp +++ b/rendering/cacher.cpp @@ -999,10 +999,10 @@ void Cacher::OpenWorker() { if (pix_fmt == AV_PIX_FMT_RGBA) { qDebug() << "This is an 8-bit image."; - media_pixel_format_ = olive::rendering::PIX_FMT_RGBA8; + media_pixel_format_ = olive::PIX_FMT_RGBA8; } else { qDebug() << "This is an HDR image."; - media_pixel_format_ = olive::rendering::PIX_FMT_RGBA16; + media_pixel_format_ = olive::PIX_FMT_RGBA16; } const char* chosen_format = av_get_pix_fmt_name(pix_fmt); @@ -1353,7 +1353,7 @@ ClipQueue *Cacher::queue() return &queue_; } -const olive::rendering::PixelFormat &Cacher::media_pixel_format() +const olive::PixelFormat &Cacher::media_pixel_format() { return media_pixel_format_; } diff --git a/rendering/cacher.h b/rendering/cacher.h index 0cda89d61..0b215a673 100644 --- a/rendering/cacher.h +++ b/rendering/cacher.h @@ -43,7 +43,7 @@ extern "C" { #include #include "rendering/clipqueue.h" -#include "rendering/bitdepths.h" +#include "rendering/pixelformats.h" class Clip; @@ -262,7 +262,7 @@ public: * * A olive::rendering::PixelFormat value corresponding to a member of olive::rendering::bit_depths. */ - const olive::rendering::PixelFormat& media_pixel_format(); + const olive::PixelFormat& media_pixel_format(); private: /** @@ -596,7 +596,7 @@ private: /** * @brief Internal struct holding bit depth information for the current media */ - olive::rendering::PixelFormat media_pixel_format_; + olive::PixelFormat media_pixel_format_; }; #endif // CACHER_H diff --git a/rendering/framebuffercollection.cpp b/rendering/framebuffercollection.cpp new file mode 100644 index 000000000..f8f3ed2b0 --- /dev/null +++ b/rendering/framebuffercollection.cpp @@ -0,0 +1,68 @@ +#include "framebuffercollection.h" + +FramebufferCollection::FramebufferCollection() +{ + +} + +void FramebufferCollection::Create(QOpenGLContext* ctx, + int width, + int height, + int count) +{ + Q_ASSERT(count > 1); + + fbo_.resize(count); + for (int i=0;i + +#include "framebufferobject.h" + +class FramebufferCollection +{ +public: + FramebufferCollection(); + + void Create(QOpenGLContext *ctx, int width, int height, int count); + void Destroy(); + + GLuint CurrentTexture(); + const FramebufferObject& CurrentFramebuffer(); + const FramebufferObject& NextFramebuffer(); + bool TextureBelongsToCollection(GLuint tex); + + bool IsCreated(); +private: + QVector fbo_; + int fbo_index_; +}; + +#endif // FRAMEBUFFERCOLLECTION_H diff --git a/rendering/framebufferobject.cpp b/rendering/framebufferobject.cpp index 00360ca8f..a8a0980d8 100644 --- a/rendering/framebufferobject.cpp +++ b/rendering/framebufferobject.cpp @@ -26,7 +26,7 @@ #include "global/config.h" #include "global/global.h" -#include "bitdepths.h" +#include "pixelformats.h" FramebufferObject::FramebufferObject() : buffer_(0), @@ -65,9 +65,9 @@ void FramebufferObject::Create(QOpenGLContext *ctx, int width, int height) ctx->functions()->glBindTexture(GL_TEXTURE_2D, texture_); // allocate storage for texture - const olive::rendering::BitDepthInfo& bit_depth = olive::rendering::bit_depths.at(olive::Global->is_exporting() ? - olive::CurrentConfig.export_bit_depth : - olive::CurrentConfig.playback_bit_depth); + const olive::PixelFormatInfo& bit_depth = olive::pixel_formats.at(olive::Global->is_exporting() ? + olive::CurrentConfig.export_bit_depth : + olive::CurrentConfig.playback_bit_depth); ctx->functions()->glTexImage2D( GL_TEXTURE_2D, diff --git a/rendering/pixelformats.cpp b/rendering/pixelformats.cpp new file mode 100644 index 000000000..6f970e5d6 --- /dev/null +++ b/rendering/pixelformats.cpp @@ -0,0 +1,60 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#include "pixelformats.h" + +#include + +namespace olive { + +QVector pixel_formats; + +void InitializePixelFormats() { + + pixel_formats.resize(PIX_FMT_COUNT); + + pixel_formats[PIX_FMT_RGBA8].name = QCoreApplication::translate("bitdepths", "8-bit"); + pixel_formats[PIX_FMT_RGBA8].internal_format = GL_RGBA8; + pixel_formats[PIX_FMT_RGBA8].pixel_format = GL_RGBA; + pixel_formats[PIX_FMT_RGBA8].pixel_type = GL_UNSIGNED_BYTE; + pixel_formats[PIX_FMT_RGBA8].bytes_per_pixel = 4; + + pixel_formats[PIX_FMT_RGBA16].name = QCoreApplication::translate("bitdepths", "16-bit Integer"); + pixel_formats[PIX_FMT_RGBA16].internal_format = GL_RGBA16; + pixel_formats[PIX_FMT_RGBA16].pixel_format = GL_RGBA; + pixel_formats[PIX_FMT_RGBA16].pixel_type = GL_UNSIGNED_SHORT; + pixel_formats[PIX_FMT_RGBA16].bytes_per_pixel = 8; + + pixel_formats[PIX_FMT_RGBA16F].name = QCoreApplication::translate("bitdepths", "Half-Float (16-bit)"); + pixel_formats[PIX_FMT_RGBA16F].internal_format = GL_RGBA16F; + pixel_formats[PIX_FMT_RGBA16F].pixel_format = GL_RGBA; + pixel_formats[PIX_FMT_RGBA16F].pixel_type = GL_HALF_FLOAT; + pixel_formats[PIX_FMT_RGBA16F].bytes_per_pixel = 8; + + pixel_formats[PIX_FMT_RGBA32F].name = QCoreApplication::translate("bitdepths", "Full-Float (32-bit)"); + pixel_formats[PIX_FMT_RGBA32F].internal_format = GL_RGBA32F; + pixel_formats[PIX_FMT_RGBA32F].pixel_format = GL_RGBA; + pixel_formats[PIX_FMT_RGBA32F].pixel_type = GL_FLOAT; + pixel_formats[PIX_FMT_RGBA32F].bytes_per_pixel = 16; + +} + +} + diff --git a/rendering/bitdepths.h b/rendering/pixelformats.h similarity index 82% rename from rendering/bitdepths.h rename to rendering/pixelformats.h index 0cbd70bb5..2e913c531 100644 --- a/rendering/bitdepths.h +++ b/rendering/pixelformats.h @@ -26,9 +26,8 @@ #include namespace olive { -namespace rendering { -struct BitDepthInfo { +struct PixelFormatInfo { QString name; GLint internal_format; GLenum pixel_format; @@ -37,10 +36,10 @@ struct BitDepthInfo { }; /** - * @brief The OlivePixelFormat enum + * @brief The PixelFormat enum * * Olive's internal supported pixel formats. With the exception of OLIVE_PIX_FMT_COUNT, these must all - * be defined in InitializeBitDepths(). + * be defined in InitializePixelFormats(). */ enum PixelFormat { PIX_FMT_RGBA8, @@ -50,11 +49,10 @@ enum PixelFormat { PIX_FMT_COUNT }; -extern QVector bit_depths; +extern QVector pixel_formats; -void InitializeBitDepths(); +void InitializePixelFormats(); -} } #endif // BITDEPTHS_H diff --git a/timeline/clip.cpp b/timeline/clip.cpp index 3f0a6b516..c5c62f9e5 100644 --- a/timeline/clip.cpp +++ b/timeline/clip.cpp @@ -585,9 +585,9 @@ bool Clip::Retrieve() int video_width = cacher.media_width(); int video_height = cacher.media_height(); - const olive::rendering::BitDepthInfo& bit_depth_info = olive::rendering::bit_depths.at(cacher.media_pixel_format()); + const olive::PixelFormatInfo& pix_fmt_info = olive::pixel_formats.at(cacher.media_pixel_format()); - f->glPixelStorei(GL_UNPACK_ROW_LENGTH, frame->linesize[0]/bit_depth_info.bytes_per_pixel); + f->glPixelStorei(GL_UNPACK_ROW_LENGTH, frame->linesize[0]/pix_fmt_info.bytes_per_pixel); if (allocate_data) { @@ -595,12 +595,29 @@ bool Clip::Retrieve() // the texture is using the correct dimensions, but then treat it as if it's the original resolution in the // composition f->glTexImage2D( - GL_TEXTURE_2D, 0, bit_depth_info.internal_format, video_width, video_height, 0, bit_depth_info.pixel_format, bit_depth_info.pixel_type, frame->data[0] + GL_TEXTURE_2D, + 0, + pix_fmt_info.internal_format, + video_width, + video_height, + 0, + pix_fmt_info.pixel_format, + pix_fmt_info.pixel_type, + frame->data[0] ); } else { - f->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, video_width, video_height, bit_depth_info.pixel_format, bit_depth_info.pixel_type, frame->data[0]); + f->glTexSubImage2D(GL_TEXTURE_2D, + 0, + 0, + 0, + video_width, + video_height, + pix_fmt_info.pixel_format, + pix_fmt_info.pixel_type, + frame->data[0] + ); } diff --git a/ui/mediaiconservice.cpp b/ui/mediaiconservice.cpp index ad0626cf0..955d31db0 100644 --- a/ui/mediaiconservice.cpp +++ b/ui/mediaiconservice.cpp @@ -37,12 +37,13 @@ MediaIconService::MediaIconService() { throbber_pixmap_ = QPixmap(":/icons/throbber.png"); } -void MediaIconService::SetMediaIcon(Media *media, int icon_type) { +void MediaIconService::SetMediaIcon(Media *media, IconType icon_type) { // if this icon is already part of the throbber animation loop, remove it if (throbber_items_.contains(media)) { throbber_lock_.lock(); throbber_items_.removeAll(media); + media->disable_thumbnail(false); throbber_lock_.unlock(); @@ -66,6 +67,8 @@ void MediaIconService::SetMediaIcon(Media *media, int icon_type) { case ICON_TYPE_LOADING: throbber_items_.append(media); + media->disable_thumbnail(true); + // if the animation timer isn't running, start it if (!throbber_animator_.isActive()) { // set starting frame to 0 diff --git a/ui/mediaiconservice.h b/ui/mediaiconservice.h index 3b3062e05..70ed586fd 100644 --- a/ui/mediaiconservice.h +++ b/ui/mediaiconservice.h @@ -40,7 +40,7 @@ class MediaIconService : public QObject { public: MediaIconService(); public slots: - void SetMediaIcon(Media* media, int icon_type); + void SetMediaIcon(Media* media, IconType icon_type); signals: void IconChanged(); private slots: