]> git.sesse.net Git - casparcg/blobdiff - core/thumbnail_generator.cpp
#430 Fixed bug where it was assumed that all Decklink devices implements the IDeckLin...
[casparcg] / core / thumbnail_generator.cpp
index aded7f7fe0b36659a5bc9e34248702455ab9ca6e..a80702c8a9dcf62f765b0f1b415a9ae6d32bc3ae 100644 (file)
@@ -115,6 +115,7 @@ public:
                , thumbnail_creator_(thumbnail_creator)
                , media_info_repo_(std::move(media_info_repo))
                , producer_registry_(std::move(producer_registry))
+               , mipmap_(mipmap)
                , monitor_(monitor_factory.create(
                                media_path,
                                filesystem_event::ALL,
@@ -245,31 +246,6 @@ public:
                std::promise<void> thumbnail_ready;
 
                {
-                       auto producer = frame_producer::empty();
-
-                       try
-                       {
-                               producer = producer_registry_->create_thumbnail_producer(
-                                               frame_producer_dependencies(image_mixer_, { }, format_desc_, producer_registry_),
-                                               media_file.wstring());
-                       }
-                       catch (const boost::thread_interrupted&)
-                       {
-                               throw;
-                       }
-                       catch (...)
-                       {
-                               CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
-                               CASPAR_LOG(info) << L"Thumbnail producer failed to initialize for " << media_file_with_extension << L". Turn on log level debug to see more information.";
-                               return;
-                       }
-
-                       if (producer == frame_producer::empty())
-                       {
-                               CASPAR_LOG(debug) << L"No appropriate thumbnail producer found for " << media_file_with_extension;
-                               return;
-                       }
-
                        boost::filesystem::create_directories(png_file.parent_path());
                        output_->on_send = [this, &png_file] (const_frame frame)
                        {
@@ -281,7 +257,7 @@ public:
 
                        try
                        {
-                               raw_frame = producer->create_thumbnail_frame();
+                               raw_frame = producer_registry_->create_thumbnail(frame_producer_dependencies(image_mixer_, {}, format_desc_, producer_registry_), media_file.wstring());
                                media_info_repo_->remove(file.wstring());
                                media_info_repo_->get(file.wstring());
                        }
@@ -291,15 +267,15 @@ public:
                        }
                        catch (...)
                        {
-                               CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
-                               CASPAR_LOG(info) << L"Thumbnail producer failed to create thumbnail for " << media_file_with_extension << L". Turn on log level debug to see more information.";
+                               CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(trace);
+                               CASPAR_LOG(info) << L"Thumbnail producer failed to create thumbnail for " << media_file_with_extension << L". Turn on log level trace to see more information.";
                                return;
                        }
 
                        if (raw_frame == draw_frame::empty()
                                        || raw_frame == draw_frame::late())
                        {
-                               CASPAR_LOG(debug) << L"No thumbnail generated for " << media_file_with_extension;
+                               CASPAR_LOG(debug) << L"No thumbnail producer for " << media_file_with_extension;
                                return;
                        }