ImageInput::ImageInput(const string &filename)
: movit::FlatInput({movit::COLORSPACE_sRGB, movit::GAMMA_sRGB}, movit::FORMAT_RGBA_POSTMULTIPLIED_ALPHA,
GL_UNSIGNED_BYTE, 1280, 720), // FIXME
ImageInput::ImageInput(const string &filename)
: movit::FlatInput({movit::COLORSPACE_sRGB, movit::GAMMA_sRGB}, movit::FORMAT_RGBA_POSTMULTIPLIED_ALPHA,
GL_UNSIGNED_BYTE, 1280, 720), // FIXME
{
if (current_image == nullptr) { // Could happen even though search_for_file() returned.
fprintf(stderr, "Couldn't load image, exiting.\n");
{
if (current_image == nullptr) { // Could happen even though search_for_file() returned.
fprintf(stderr, "Couldn't load image, exiting.\n");
{
unique_lock<mutex> lock(all_images_lock); // Held also during loading.
if (all_images.count(pathname)) {
{
unique_lock<mutex> lock(all_images_lock); // Held also during loading.
if (all_images.count(pathname)) {
all_images[pathname] = load_image_raw(pathname);
timespec first_modified = all_images[pathname]->last_modified;
update_threads[pathname] =
all_images[pathname] = load_image_raw(pathname);
timespec first_modified = all_images[pathname]->last_modified;
update_threads[pathname] =
- thread(bind(update_thread_func, pathname, first_modified));
+ thread(bind(update_thread_func, filename, pathname, first_modified));
// Fire up a thread to update the image every second.
// We could do inotify, but this is good enough for now.
// Fire up a thread to update the image every second.
// We could do inotify, but this is good enough for now.