+2014-03-09 Carl Hetherington <cth@carlh.net>
+
+ * Fix display of no-scale display mode in the player.
+
2014-03-08 Carl Hetherington <cth@carlh.net>
* Fix incorrect audio analyses on multiple-stream content.
signal_changed (SEQUENCE_VIDEO);
}
+/** @return Size of the largest possible image in whatever resolution we are using */
libdcp::Size
Film::full_frame () const
{
return libdcp::Size ();
}
+/** @return Size of the frame */
+libdcp::Size
+Film::frame_size () const
+{
+ return fit_ratio_within (container()->ratio(), full_frame ());
+}
+
libdcp::KDM
Film::make_kdm (
shared_ptr<libdcp::Certificate> target,
}
libdcp::Size full_frame () const;
+ libdcp::Size frame_size () const;
std::list<boost::filesystem::path> dcps () const;
_playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
_playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
_film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
- set_video_container_size (fit_ratio_within (_film->container()->ratio (), _film->full_frame ()));
+ set_video_container_size (_film->frame_size ());
}
void
}
Time const time = content->position() + relative_time + extra - content->trim_start ();
- libdcp::Size const image_size = content->scale().size (content, _video_container_size);
+ libdcp::Size const image_size = content->scale().size (content, _video_container_size, _film->frame_size ());
shared_ptr<PlayerImage> pi (
new PlayerImage (
return _("No scale");
}
+/** @param display_container Size of the container that we are displaying this content in.
+ * @param film_container The size of the film's image.
+ */
libdcp::Size
-VideoContentScale::size (shared_ptr<const VideoContent> c, libdcp::Size container) const
+VideoContentScale::size (shared_ptr<const VideoContent> c, libdcp::Size display_container, libdcp::Size film_container) const
{
if (_ratio) {
- return fit_ratio_within (_ratio->ratio (), container);
+ return fit_ratio_within (_ratio->ratio (), display_container);
}
- /* Force scale if the container is smaller than the content's image */
- if (_scale || container.width < c->video_size().width || container.height < c->video_size().height) {
- return fit_ratio_within (c->video_size().ratio (), container);
+ /* Force scale if the film_container is smaller than the content's image */
+ if (_scale || film_container.width < c->video_size().width || film_container.height < c->video_size().height) {
+ return fit_ratio_within (c->video_size().ratio (), display_container);
}
- return c->video_size ();
+ /* Scale the image so that it will be in the right place in film_container, even if display_container is a
+ different size.
+ */
+ return libdcp::Size (
+ c->video_size().width * float(display_container.width) / film_container.width,
+ c->video_size().height * float(display_container.height) / film_container.height
+ );
}
void
VideoContentScale (bool);
VideoContentScale (boost::shared_ptr<cxml::Node>);
- libdcp::Size size (boost::shared_ptr<const VideoContent>, libdcp::Size) const;
+ libdcp::Size size (boost::shared_ptr<const VideoContent>, libdcp::Size, libdcp::Size) const;
std::string id () const;
std::string name () const;
void as_xml (xmlpp::Node *) const;
}
private:
+ /** a ratio to stretch the content to, or 0 for no stretch */
Ratio const * _ratio;
+ /** true if we want to scale the content */
bool _scale;
static std::vector<VideoContentScale> _scales;
}
_picture_asset->set_edit_rate (_film->video_frame_rate ());
- _picture_asset->set_size (fit_ratio_within (_film->container()->ratio(), _film->full_frame ()));
+ _picture_asset->set_size (_film->frame_size ());
_picture_asset->set_interop (_film->interop ());
if (_film->encrypted ()) {
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 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
if (frequent) {
return;
}
-
+
calculate_sizes ();
fetch_current_frame_again ();
}
++lines;
}
- libdcp::Size const container_size = fit_ratio_within (_editor->film()->container()->ratio (), _editor->film()->full_frame ());
- libdcp::Size const scaled = vcs->scale().size (vcs, container_size);
+ libdcp::Size const container_size = _editor->film()->frame_size ();
+ libdcp::Size const scaled = vcs->scale().size (vcs, container_size, container_size);
if (scaled != vcs->video_size_after_crop ()) {
d << wxString::Format (