using std::string;
using std::stringstream;
using std::set;
+using std::cout;
using boost::shared_ptr;
using boost::lexical_cast;
#include <libcxml/cxml.h>
#include "ffmpeg_content.h"
-#include "still_image_content.h"
-#include "moving_image_content.h"
+#include "image_content.h"
#include "sndfile_content.h"
#include "util.h"
if (type == "FFmpeg") {
content.reset (new FFmpegContent (film, node));
- } else if (type == "StillImage") {
- content.reset (new StillImageContent (film, node));
- } else if (type == "MovingImage") {
- content.reset (new MovingImageContent (film, node));
+ } else if (type == "Image") {
+ content.reset (new ImageContent (film, node));
} else if (type == "Sndfile") {
content.reset (new SndfileContent (film, node));
}
shared_ptr<Content> content;
if (valid_image_file (path)) {
- content.reset (new StillImageContent (film, path));
+ content.reset (new ImageContent (film, path));
} else if (SndfileContent::valid_file (path)) {
content.reset (new SndfileContent (film, path));
} else {
--- /dev/null
+/*
+ Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <libcxml/cxml.h>
+#include "image_content.h"
+#include "image_examiner.h"
+#include "config.h"
+#include "compose.hpp"
+#include "film.h"
+#include "job.h"
+
+#include "i18n.h"
+
+using std::string;
+using std::cout;
+using std::stringstream;
+using boost::shared_ptr;
+
+ImageContent::ImageContent (shared_ptr<const Film> f, boost::filesystem::path p)
+ : Content (f)
+ , VideoContent (f)
+{
+ if (boost::filesystem::is_regular_file (p)) {
+ _paths.push_back (p);
+ } else {
+ for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
+ if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) {
+ _paths.push_back (i->path ());
+ }
+ }
+
+ sort (_paths.begin(), _paths.end());
+ }
+}
+
+
+ImageContent::ImageContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
+ : Content (f, node)
+ , VideoContent (f, node)
+{
+
+}
+
+string
+ImageContent::summary () const
+{
+ /* Get the string() here so that the name does not have quotes around it */
+ if (still ()) {
+ return String::compose (_("%1 [still]"), path().filename().string());
+ }
+
+ return String::compose (_("%1 [moving images]"), path().filename().string());
+}
+
+string
+ImageContent::technical_summary () const
+{
+ string s = Content::technical_summary() + " - "
+ + VideoContent::technical_summary() + " - ";
+
+ if (still ()) {
+ s += _("still");
+ } else {
+ s += _("moving");
+ }
+
+ return s;
+}
+
+void
+ImageContent::as_xml (xmlpp::Node* node) const
+{
+ node->add_child("Type")->add_child_text ("Image");
+ Content::as_xml (node);
+ VideoContent::as_xml (node);
+}
+
+void
+ImageContent::examine (shared_ptr<Job> job)
+{
+ job->sub (_("Computing digest"));
+ Content::examine (job);
+
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+
+ shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
+
+ take_from_video_examiner (examiner);
+ set_video_length (examiner->video_length ());
+}
+
+void
+ImageContent::set_video_length (VideoContent::Frame len)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_length = len;
+ }
+
+ signal_changed (ContentProperty::LENGTH);
+}
+
+Time
+ImageContent::full_length () const
+{
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+
+ FrameRateConversion frc (video_frame_rate(), film->video_frame_rate ());
+ return video_length() * frc.factor() * TIME_HZ / video_frame_rate();
+}
+
+string
+ImageContent::identifier () const
+{
+ stringstream s;
+ s << VideoContent::identifier ();
+ s << "_" << video_length();
+ return s.str ();
+}
+
+bool
+ImageContent::still () const
+{
+ return number_of_paths() == 1;
+}
--- /dev/null
+/*
+ Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef DCPOMATIC_IMAGE_CONTENT_H
+#define DCPOMATIC_IMAGE_CONTENT_H
+
+#include <boost/enable_shared_from_this.hpp>
+#include "video_content.h"
+
+namespace cxml {
+ class Node;
+}
+
+class ImageContent : public VideoContent
+{
+public:
+ ImageContent (boost::shared_ptr<const Film>, boost::filesystem::path);
+ ImageContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
+
+ boost::shared_ptr<ImageContent> shared_from_this () {
+ return boost::dynamic_pointer_cast<ImageContent> (Content::shared_from_this ());
+ };
+
+ void examine (boost::shared_ptr<Job>);
+ std::string summary () const;
+ std::string technical_summary () const;
+ void as_xml (xmlpp::Node *) const;
+ Time full_length () const;
+
+ std::string identifier () const;
+
+ void set_video_length (VideoContent::Frame);
+ bool still () const;
+};
+
+#endif
--- /dev/null
+/*
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+#include <Magick++.h>
+#include "image_content.h"
+#include "image_decoder.h"
+#include "image.h"
+#include "film.h"
+#include "exceptions.h"
+
+#include "i18n.h"
+
+using std::cout;
+using boost::shared_ptr;
+using libdcp::Size;
+
+ImageDecoder::ImageDecoder (shared_ptr<const Film> f, shared_ptr<const ImageContent> c)
+ : Decoder (f)
+ , VideoDecoder (f, c)
+ , _image_content (c)
+{
+
+}
+
+void
+ImageDecoder::pass ()
+{
+ if (_video_position >= _image_content->video_length ()) {
+ return;
+ }
+
+ if (_image && _image_content->still ()) {
+ video (_image, true, _video_position);
+ return;
+ }
+
+ Magick::Image* magick_image = new Magick::Image (_image_content->path(_video_position).string ());
+ libdcp::Size size (magick_image->columns(), magick_image->rows());
+
+ _image.reset (new Image (PIX_FMT_RGB24, size, true));
+
+ using namespace MagickCore;
+
+ uint8_t* p = _image->data()[0];
+ for (int y = 0; y < size.height; ++y) {
+ uint8_t* q = p;
+ for (int x = 0; x < size.width; ++x) {
+ Magick::Color c = magick_image->pixelColor (x, y);
+ *q++ = c.redQuantum() * 255 / QuantumRange;
+ *q++ = c.greenQuantum() * 255 / QuantumRange;
+ *q++ = c.blueQuantum() * 255 / QuantumRange;
+ }
+ p += _image->stride()[0];
+ }
+
+ delete magick_image;
+
+ video (_image, false, _video_position);
+}
+
+void
+ImageDecoder::seek (VideoContent::Frame frame, bool)
+{
+ _video_position = frame;
+}
+
+bool
+ImageDecoder::done () const
+{
+ return _video_position >= _image_content->video_length ();
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "video_decoder.h"
+
+namespace Magick {
+ class Image;
+}
+
+class ImageContent;
+
+class ImageDecoder : public VideoDecoder
+{
+public:
+ ImageDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageContent>);
+
+ boost::shared_ptr<const ImageContent> content () {
+ return _image_content;
+ }
+
+ /* Decoder */
+
+ void pass ();
+ void seek (VideoContent::Frame, bool);
+ bool done () const;
+
+private:
+ boost::shared_ptr<const ImageContent> _image_content;
+ boost::shared_ptr<Image> _image;
+};
+
--- /dev/null
+/*
+ Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <iostream>
+#include <boost/lexical_cast.hpp>
+#include <Magick++.h>
+#include "image_content.h"
+#include "image_examiner.h"
+#include "film.h"
+#include "job.h"
+#include "exceptions.h"
+#include "config.h"
+
+#include "i18n.h"
+
+using std::cout;
+using std::list;
+using std::sort;
+using boost::shared_ptr;
+using boost::lexical_cast;
+using boost::bad_lexical_cast;
+
+ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const ImageContent> content, shared_ptr<Job> job)
+ : _film (film)
+ , _image_content (content)
+ , _video_length (0)
+{
+ list<unsigned int> frames;
+ size_t const N = content->number_of_paths ();
+
+ for (size_t i = 0; i < N; ++i) {
+ boost::filesystem::path const p = content->path (i);
+ try {
+ frames.push_back (lexical_cast<int> (p.stem().string()));
+ } catch (bad_lexical_cast &) {
+ /* We couldn't turn that filename into a number; never mind */
+ }
+
+ if (!_video_size) {
+ using namespace MagickCore;
+ Magick::Image* image = new Magick::Image (p.string());
+ _video_size = libdcp::Size (image->columns(), image->rows());
+ delete image;
+ }
+
+ job->set_progress (float (i) / N);
+ }
+
+ frames.sort ();
+
+ if (N > 1 && frames.front() != 0 && frames.front() != 1) {
+ throw StringError (String::compose (_("first frame in moving image directory is number %1"), frames.front ()));
+ }
+
+ if (N > 1 && frames.back() != frames.size() && frames.back() != (frames.size() - 1)) {
+ throw StringError (String::compose (_("there are %1 images in the directory but the last one is number %2"), frames.size(), frames.back ()));
+ }
+
+ if (content->still ()) {
+ _video_length = Config::instance()->default_still_length() * video_frame_rate();
+ } else {
+ _video_length = _image_content->number_of_paths ();
+ }
+}
+
+libdcp::Size
+ImageExaminer::video_size () const
+{
+ return _video_size.get ();
+}
+
+float
+ImageExaminer::video_frame_rate () const
+{
+ boost::shared_ptr<const Film> f = _film.lock ();
+ if (!f) {
+ return 24;
+ }
+
+ return f->video_frame_rate ();
+}
--- /dev/null
+/*
+ Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "video_examiner.h"
+
+namespace Magick {
+ class Image;
+}
+
+class ImageContent;
+
+class ImageExaminer : public VideoExaminer
+{
+public:
+ ImageExaminer (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageContent>, boost::shared_ptr<Job>);
+
+ float video_frame_rate () const;
+ libdcp::Size video_size () const;
+ VideoContent::Frame video_length () const {
+ return _video_length;
+ }
+
+private:
+ boost::weak_ptr<const Film> _film;
+ boost::shared_ptr<const ImageContent> _image_content;
+ boost::optional<libdcp::Size> _video_size;
+ VideoContent::Frame _video_length;
+};
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-class MovingImageContent;
-
-class MovingImage
-{
-public:
- MovingImage (boost::shared_ptr<const MovingImageContent> c)
- : _moving_image_content (c)
- {}
-
- boost::shared_ptr<const MovingImageContent> content () const {
- return _moving_image_content;
- }
-
-protected:
- boost::shared_ptr<const MovingImageContent> _moving_image_content;
-};
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <libcxml/cxml.h>
-#include "moving_image_content.h"
-#include "moving_image_examiner.h"
-#include "config.h"
-#include "compose.hpp"
-#include "film.h"
-#include "job.h"
-
-#include "i18n.h"
-
-using std::string;
-using std::cout;
-using std::list;
-using std::stringstream;
-using std::vector;
-using boost::shared_ptr;
-
-MovingImageContent::MovingImageContent (shared_ptr<const Film> f, boost::filesystem::path p)
- : Content (f)
- , VideoContent (f)
-{
- for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) {
- _paths.push_back (i->path ());
- }
- }
-
- sort (_paths.begin(), _paths.end());
-}
-
-MovingImageContent::MovingImageContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
- : Content (f, node)
- , VideoContent (f, node)
-{
-
-}
-
-string
-MovingImageContent::summary () const
-{
- /* Get the string() here so that the name does not have quotes around it */
- return String::compose (_("%1 [moving images]"), path().filename().string());
-}
-
-string
-MovingImageContent::technical_summary () const
-{
- return Content::technical_summary() + " - "
- + VideoContent::technical_summary() + " - "
- + "moving";
-}
-
-void
-MovingImageContent::as_xml (xmlpp::Node* node) const
-{
- node->add_child("Type")->add_child_text ("MovingImage");
- Content::as_xml (node);
- VideoContent::as_xml (node);
-}
-
-void
-MovingImageContent::examine (shared_ptr<Job> job)
-{
- job->sub (_("Computing digest"));
- Content::examine (job);
-
- shared_ptr<const Film> film = _film.lock ();
- assert (film);
-
- job->sub (_("Examining content"));
- shared_ptr<MovingImageExaminer> examiner (new MovingImageExaminer (film, shared_from_this(), job));
-
- take_from_video_examiner (examiner);
-
- _video_length = number_of_paths ();
-}
-
-Time
-MovingImageContent::full_length () const
-{
- shared_ptr<const Film> film = _film.lock ();
- assert (film);
-
- FrameRateConversion frc (video_frame_rate(), film->video_frame_rate ());
- return video_length() * frc.factor() * TIME_HZ / video_frame_rate();
-}
-
-string
-MovingImageContent::identifier () const
-{
- stringstream s;
- s << VideoContent::identifier ();
- s << "_" << video_length();
- return s.str ();
-}
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_MOVING_IMAGE_CONTENT_H
-#define DCPOMATIC_MOVING_IMAGE_CONTENT_H
-
-#include <boost/enable_shared_from_this.hpp>
-#include "video_content.h"
-
-namespace cxml {
- class Node;
-}
-
-/** A directory of image files which are to be presented as a movie */
-class MovingImageContent : public VideoContent
-{
-public:
- MovingImageContent (boost::shared_ptr<const Film>, boost::filesystem::path);
- MovingImageContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
-
- boost::shared_ptr<MovingImageContent> shared_from_this () {
- return boost::dynamic_pointer_cast<MovingImageContent> (Content::shared_from_this ());
- };
-
- void examine (boost::shared_ptr<Job>);
- std::string summary () const;
- std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
- Time full_length () const;
-
- std::string identifier () const;
-};
-
-#endif
+++ /dev/null
-/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-#include <Magick++.h>
-#include "moving_image_content.h"
-#include "moving_image_decoder.h"
-#include "image.h"
-#include "film.h"
-#include "exceptions.h"
-
-#include "i18n.h"
-
-using std::cout;
-using boost::shared_ptr;
-using libdcp::Size;
-
-MovingImageDecoder::MovingImageDecoder (shared_ptr<const Film> f, shared_ptr<const MovingImageContent> c)
- : Decoder (f)
- , VideoDecoder (f, c)
- , MovingImage (c)
-{
-
-}
-
-void
-MovingImageDecoder::pass ()
-{
- if (_video_position >= _moving_image_content->video_length ()) {
- return;
- }
-
- Magick::Image* magick_image = new Magick::Image (_moving_image_content->path(_video_position).string ());
- libdcp::Size size (magick_image->columns(), magick_image->rows());
-
- shared_ptr<Image> image (new Image (PIX_FMT_RGB24, size, true));
-
- using namespace MagickCore;
-
- uint8_t* p = image->data()[0];
- for (int y = 0; y < size.height; ++y) {
- uint8_t* q = p;
- for (int x = 0; x < size.width; ++x) {
- Magick::Color c = magick_image->pixelColor (x, y);
- *q++ = c.redQuantum() * 255 / QuantumRange;
- *q++ = c.greenQuantum() * 255 / QuantumRange;
- *q++ = c.blueQuantum() * 255 / QuantumRange;
- }
- p += image->stride()[0];
- }
-
- delete magick_image;
-
- video (image, false, _video_position);
-}
-
-void
-MovingImageDecoder::seek (VideoContent::Frame frame, bool)
-{
- _video_position = frame;
-}
-
-bool
-MovingImageDecoder::done () const
-{
- return _video_position >= _moving_image_content->video_length ();
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "video_decoder.h"
-#include "moving_image.h"
-
-namespace Magick {
- class Image;
-}
-
-class MovingImageContent;
-
-class MovingImageDecoder : public VideoDecoder, public MovingImage
-{
-public:
- MovingImageDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const MovingImageContent>);
-
- /* Decoder */
-
- void pass ();
- void seek (VideoContent::Frame, bool);
- bool done () const;
-};
-
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <boost/lexical_cast.hpp>
-#include <Magick++.h>
-#include "moving_image_content.h"
-#include "moving_image_examiner.h"
-#include "film.h"
-#include "job.h"
-#include "exceptions.h"
-
-#include "i18n.h"
-
-using std::cout;
-using std::list;
-using std::sort;
-using boost::shared_ptr;
-using boost::lexical_cast;
-
-MovingImageExaminer::MovingImageExaminer (shared_ptr<const Film> film, shared_ptr<const MovingImageContent> content, shared_ptr<Job> job)
- : MovingImage (content)
- , _film (film)
- , _video_length (0)
-{
- list<unsigned int> frames;
- size_t const N = content->number_of_paths ();
-
- int j = 0;
- for (size_t i = 0; i < N; ++i) {
- boost::filesystem::path const p = content->path (i);
- frames.push_back (lexical_cast<int> (p.stem().string()));
-
- if (!_video_size) {
- using namespace MagickCore;
- Magick::Image* image = new Magick::Image (p.string());
- _video_size = libdcp::Size (image->columns(), image->rows());
- delete image;
- }
-
- job->set_progress (float (i) / N);
- }
-
- frames.sort ();
-
- if (frames.size() < 2) {
- throw StringError (String::compose (_("only %1 file(s) found in moving image directory"), frames.size ()));
- }
-
- if (frames.front() != 0 && frames.front() != 1) {
- throw StringError (String::compose (_("first frame in moving image directory is number %1"), frames.front ()));
- }
-
- if (frames.back() != frames.size() && frames.back() != (frames.size() - 1)) {
- throw StringError (String::compose (_("there are %1 images in the directory but the last one is number %2"), frames.size(), frames.back ()));
- }
-
- _video_length = frames.size ();
-}
-
-libdcp::Size
-MovingImageExaminer::video_size () const
-{
- return _video_size.get ();
-}
-
-int
-MovingImageExaminer::video_length () const
-{
- return _video_length;
-}
-
-float
-MovingImageExaminer::video_frame_rate () const
-{
- return 24;
-}
-
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "moving_image.h"
-#include "video_examiner.h"
-
-namespace Magick {
- class Image;
-}
-
-class MovingImageContent;
-
-class MovingImageExaminer : public MovingImage, public VideoExaminer
-{
-public:
- MovingImageExaminer (boost::shared_ptr<const Film>, boost::shared_ptr<const MovingImageContent>, boost::shared_ptr<Job>);
-
- float video_frame_rate () const;
- libdcp::Size video_size () const;
- VideoContent::Frame video_length () const;
-
-private:
- boost::weak_ptr<const Film> _film;
- boost::optional<libdcp::Size> _video_size;
- VideoContent::Frame _video_length;
-};
#include "film.h"
#include "ffmpeg_decoder.h"
#include "ffmpeg_content.h"
-#include "still_image_decoder.h"
-#include "still_image_content.h"
-#include "moving_image_decoder.h"
-#include "moving_image_content.h"
+#include "image_decoder.h"
+#include "image_content.h"
#include "sndfile_decoder.h"
#include "sndfile_content.h"
#include "subtitle_content.h"
piece->decoder = fd;
}
- shared_ptr<const StillImageContent> ic = dynamic_pointer_cast<const StillImageContent> (*i);
+ shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (*i);
if (ic) {
- shared_ptr<StillImageDecoder> id;
+ bool reusing = false;
- /* See if we can re-use an old StillImageDecoder */
+ /* See if we can re-use an old ImageDecoder */
for (list<shared_ptr<Piece> >::const_iterator j = old_pieces.begin(); j != old_pieces.end(); ++j) {
- shared_ptr<StillImageDecoder> imd = dynamic_pointer_cast<StillImageDecoder> ((*j)->decoder);
+ shared_ptr<ImageDecoder> imd = dynamic_pointer_cast<ImageDecoder> ((*j)->decoder);
if (imd && imd->content() == ic) {
- id = imd;
+ piece = *j;
+ reusing = true;
}
}
- if (!id) {
- id.reset (new StillImageDecoder (_film, ic));
+ if (!reusing) {
+ shared_ptr<ImageDecoder> id (new ImageDecoder (_film, ic));
id->Video.connect (bind (&Player::process_video, this, weak_ptr<Piece> (piece), _1, _2, _3, _4, 0));
+ piece->decoder = id;
}
-
- piece->decoder = id;
- }
-
- shared_ptr<const MovingImageContent> mc = dynamic_pointer_cast<const MovingImageContent> (*i);
- if (mc) {
- shared_ptr<MovingImageDecoder> md;
-
- if (!md) {
- md.reset (new MovingImageDecoder (_film, mc));
- md->Video.connect (bind (&Player::process_video, this, weak_ptr<Piece> (piece), _1, _2, _3, _4, 0));
- }
-
- piece->decoder = md;
}
shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (*i);
#include "video_content.h"
#include "ffmpeg_decoder.h"
#include "ffmpeg_content.h"
-#include "still_image_decoder.h"
-#include "still_image_content.h"
+#include "image_decoder.h"
#include "content_factory.h"
#include "job.h"
#include "config.h"
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_STILL_IMAGE_H
-#define DCPOMATIC_STILL_IMAGE_H
-
-class StillImageContent;
-
-class StillImage
-{
-public:
- StillImage (boost::shared_ptr<const StillImageContent> c)
- : _still_image_content (c)
- {}
-
- boost::shared_ptr<const StillImageContent> content () const {
- return _still_image_content;
- }
-
-protected:
- boost::shared_ptr<const StillImageContent> _still_image_content;
-};
-
-#endif
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <libcxml/cxml.h>
-#include "still_image_content.h"
-#include "still_image_examiner.h"
-#include "config.h"
-#include "compose.hpp"
-#include "film.h"
-
-#include "i18n.h"
-
-using std::string;
-using std::cout;
-using std::stringstream;
-using boost::shared_ptr;
-
-StillImageContent::StillImageContent (shared_ptr<const Film> f, boost::filesystem::path p)
- : Content (f, p)
- , VideoContent (f, p)
-{
-
-}
-
-StillImageContent::StillImageContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
- : Content (f, node)
- , VideoContent (f, node)
-{
-
-}
-
-string
-StillImageContent::summary () const
-{
- /* Get the string() here so that the name does not have quotes around it */
- return String::compose (_("%1 [still]"), path().filename().string());
-}
-
-string
-StillImageContent::technical_summary () const
-{
- return Content::technical_summary() + " - "
- + VideoContent::technical_summary() + " - "
- + "still";
-}
-
-void
-StillImageContent::as_xml (xmlpp::Node* node) const
-{
- node->add_child("Type")->add_child_text ("StillImage");
- Content::as_xml (node);
- VideoContent::as_xml (node);
-}
-
-void
-StillImageContent::examine (shared_ptr<Job> job)
-{
- Content::examine (job);
-
- shared_ptr<const Film> film = _film.lock ();
- assert (film);
-
- shared_ptr<StillImageExaminer> examiner (new StillImageExaminer (film, shared_from_this()));
-
- take_from_video_examiner (examiner);
- set_video_length (Config::instance()->default_still_length() * video_frame_rate());
-}
-
-void
-StillImageContent::set_video_length (VideoContent::Frame len)
-{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _video_length = len;
- }
-
- signal_changed (ContentProperty::LENGTH);
-}
-
-Time
-StillImageContent::full_length () const
-{
- shared_ptr<const Film> film = _film.lock ();
- assert (film);
-
- FrameRateConversion frc (video_frame_rate(), film->video_frame_rate ());
- return video_length() * frc.factor() * TIME_HZ / video_frame_rate();
-}
-
-string
-StillImageContent::identifier () const
-{
- stringstream s;
- s << VideoContent::identifier ();
- s << "_" << video_length();
- return s.str ();
-}
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_STILL_IMAGE_CONTENT_H
-#define DCPOMATIC_STILL_IMAGE_CONTENT_H
-
-#include <boost/enable_shared_from_this.hpp>
-#include "video_content.h"
-
-namespace cxml {
- class Node;
-}
-
-/** A single image which is to be held on screen for some time (i.e. a slide) */
-class StillImageContent : public VideoContent
-{
-public:
- StillImageContent (boost::shared_ptr<const Film>, boost::filesystem::path);
- StillImageContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
-
- boost::shared_ptr<StillImageContent> shared_from_this () {
- return boost::dynamic_pointer_cast<StillImageContent> (Content::shared_from_this ());
- };
-
- void examine (boost::shared_ptr<Job>);
- std::string summary () const;
- std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
- Time full_length () const;
-
- std::string identifier () const;
-
- void set_video_length (VideoContent::Frame);
-};
-
-#endif
+++ /dev/null
-/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-#include <Magick++.h>
-#include "still_image_content.h"
-#include "still_image_decoder.h"
-#include "image.h"
-#include "film.h"
-#include "exceptions.h"
-
-#include "i18n.h"
-
-using std::cout;
-using boost::shared_ptr;
-using libdcp::Size;
-
-StillImageDecoder::StillImageDecoder (shared_ptr<const Film> f, shared_ptr<const StillImageContent> c)
- : Decoder (f)
- , VideoDecoder (f, c)
- , StillImage (c)
-{
-
-}
-
-void
-StillImageDecoder::pass ()
-{
- if (_video_position >= _still_image_content->video_length ()) {
- return;
- }
-
- if (_image) {
- video (_image, true, _video_position);
- return;
- }
-
- Magick::Image* magick_image = new Magick::Image (_still_image_content->path().string ());
- _video_size = libdcp::Size (magick_image->columns(), magick_image->rows());
-
- _image.reset (new Image (PIX_FMT_RGB24, _video_size.get(), true));
-
- using namespace MagickCore;
-
- uint8_t* p = _image->data()[0];
- for (int y = 0; y < _video_size->height; ++y) {
- uint8_t* q = p;
- for (int x = 0; x < _video_size->width; ++x) {
- Magick::Color c = magick_image->pixelColor (x, y);
- *q++ = c.redQuantum() * 255 / QuantumRange;
- *q++ = c.greenQuantum() * 255 / QuantumRange;
- *q++ = c.blueQuantum() * 255 / QuantumRange;
- }
- p += _image->stride()[0];
- }
-
- delete magick_image;
-
- video (_image, false, _video_position);
-}
-
-void
-StillImageDecoder::seek (VideoContent::Frame frame, bool)
-{
- _video_position = frame;
-}
-
-bool
-StillImageDecoder::done () const
-{
- return _video_position >= _still_image_content->video_length ();
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "video_decoder.h"
-#include "still_image.h"
-
-namespace Magick {
- class Image;
-}
-
-class StillImageContent;
-
-class StillImageDecoder : public VideoDecoder, public StillImage
-{
-public:
- StillImageDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const StillImageContent>);
-
- /* Decoder */
-
- void pass ();
- void seek (VideoContent::Frame, bool);
- bool done () const;
-
-private:
- boost::shared_ptr<Image> _image;
- mutable boost::optional<libdcp::Size> _video_size;
-};
-
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <Magick++.h>
-#include "still_image_content.h"
-#include "still_image_examiner.h"
-#include "film.h"
-
-#include "i18n.h"
-
-using std::cout;
-using boost::shared_ptr;
-
-StillImageExaminer::StillImageExaminer (shared_ptr<const Film> f, shared_ptr<const StillImageContent> c)
- : StillImage (c)
- , _film (f)
-{
- using namespace MagickCore;
- Magick::Image* image = new Magick::Image (_still_image_content->path().string());
- _video_size = libdcp::Size (image->columns(), image->rows());
- delete image;
-}
-
-libdcp::Size
-StillImageExaminer::video_size () const
-{
- return _video_size;
-}
-
-int
-StillImageExaminer::video_length () const
-{
- return _still_image_content->video_length ();
-}
-
-float
-StillImageExaminer::video_frame_rate () const
-{
- boost::shared_ptr<const Film> f = _film.lock ();
- if (!f) {
- return 24;
- }
-
- return f->video_frame_rate ();
-}
-
+++ /dev/null
-/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "still_image.h"
-#include "video_examiner.h"
-
-namespace Magick {
- class Image;
-}
-
-class StillImageContent;
-
-class StillImageExaminer : public StillImage, public VideoExaminer
-{
-public:
- StillImageExaminer (boost::shared_ptr<const Film>, boost::shared_ptr<const StillImageContent>);
-
- float video_frame_rate () const;
- libdcp::Size video_size () const;
- VideoContent::Frame video_length () const;
-
-private:
- boost::weak_ptr<const Film> _film;
- libdcp::Size _video_size;
-};
film.cc
filter.cc
image.cc
+ image_content.cc
+ image_decoder.cc
+ image_examiner.cc
job.cc
job_manager.cc
kdm.cc
log.cc
- moving_image_content.cc
- moving_image_decoder.cc
- moving_image_examiner.cc
player.cc
playlist.cc
ratio.cc
sndfile_content.cc
sndfile_decoder.cc
sound_processor.cc
- still_image_content.cc
- still_image_decoder.cc
- still_image_examiner.cc
subtitle_content.cc
subtitle_decoder.cc
timer.cc
#include <wx/dirdlg.h>
#include "lib/playlist.h"
#include "lib/film.h"
-#include "lib/moving_image_content.h"
+#include "lib/image_content.h"
#include "lib/content_factory.h"
#include "lib/examine_content_job.h"
#include "lib/job_manager.h"
shared_ptr<Content> content;
/* XXX: a bit nasty */
- if (dynamic_pointer_cast<MovingImageContent> (_content.front ())) {
+ shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (_content.front ());
+ if (ic && !ic->still ()) {
wxDirDialog* d = new wxDirDialog (0, _("Choose a folder"), wxT (""), wxDD_DIR_MUST_EXIST);
int const r = d->ShowModal ();
if (r == wxID_OK) {
- content.reset (new MovingImageContent (film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
+ content.reset (new ImageContent (film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
}
d->Destroy ();
} else {
#include "lib/filter.h"
#include "lib/ratio.h"
#include "lib/config.h"
-#include "lib/still_image_content.h"
-#include "lib/moving_image_content.h"
+#include "lib/image_content.h"
#include "lib/ffmpeg_content.h"
#include "lib/sndfile_content.h"
#include "lib/dcp_content_type.h"
}
_film->examine_and_add_content (
- shared_ptr<MovingImageContent> (
- new MovingImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
+ shared_ptr<ImageContent> (
+ new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
)
);
}
#include "lib/filter.h"
#include "lib/player.h"
#include "lib/video_content.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/still_image_content.h"
#include "lib/video_decoder.h"
#include "film_viewer.h"
#include "wx_util.h"
*/
#include "lib/content.h"
-#include "lib/still_image_content.h"
+#include "lib/image_content.h"
#include "timing_panel.h"
#include "wx_util.h"
#include "timecode.h"
}
}
- _length->set_editable (dynamic_pointer_cast<StillImageContent> (content));
+ shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (content);
+ _length->set_editable (ic && ic->still ());
}
void
{
ContentList c = _editor->selected_content ();
if (c.size() == 1) {
- shared_ptr<StillImageContent> ic = dynamic_pointer_cast<StillImageContent> (c.front ());
- if (ic) {
+ shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (c.front ());
+ if (ic && ic->still ()) {
ic->set_video_length (rint (_length->get (_editor->film()->video_frame_rate()) * ic->video_frame_rate() / TIME_HZ));
}
}
*/
#include <boost/test/unit_test.hpp>
-#include "lib/still_image_content.h"
+#include "lib/image_content.h"
#include "lib/dcp_content_type.h"
#include "lib/film.h"
#include "lib/ratio.h"
film->set_name ("black_fill_test");
film->set_container (Ratio::from_id ("185"));
film->set_sequence_video (false);
- shared_ptr<StillImageContent> contentA (new StillImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
contentA->set_ratio (Ratio::from_id ("185"));
- shared_ptr<StillImageContent> contentB (new StillImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
contentB->set_ratio (Ratio::from_id ("185"));
film->examine_and_add_content (contentA);
*/
#include <boost/test/unit_test.hpp>
-#include "lib/still_image_content.h"
+#include "lib/image_content.h"
#include "lib/ratio.h"
#include "lib/film.h"
#include "lib/dcp_content_type.h"
shared_ptr<Film> film = new_test_film ("scaling_test");
film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
film->set_name ("scaling_test");
- shared_ptr<StillImageContent> imc (new StillImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
film->examine_and_add_content (imc);