shared_ptr<Image>
PlayerVideo::image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
{
- /* XXX: this assumes that image() and prepare() are only ever called with the same parameters */
+ /* XXX: this assumes that image() and prepare() are only ever called with the same parameters (except crop, inter size, out size, fade) */
boost::mutex::scoped_lock lm (_mutex);
- if (!_image) {
+ if (!_image || _crop != _image_crop || _inter_size != _image_inter_size || _out_size != _image_out_size || _fade != _image_fade) {
make_image (pixel_format, aligned, fast);
}
return _image;
void
PlayerVideo::make_image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
{
+ _image_crop = _crop;
+ _image_inter_size = _inter_size;
+ _image_out_size = _out_size;
+ _image_fade = _fade;
+
pair<shared_ptr<Image>, int> prox = _in->image (_inter_size);
shared_ptr<Image> im = prox.first;
int const reduce = prox.second;
PlayerVideo::same (shared_ptr<const PlayerVideo> other) const
{
if (_crop != other->_crop ||
- _fade.get_value_or(0) != other->_fade.get_value_or(0) ||
+ _fade != other->_fade ||
_inter_size != other->_inter_size ||
_out_size != other->_out_size ||
_eyes != other->_eyes ||
* @return true if this was possible, false if not.
*/
bool
-PlayerVideo::reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size)
+PlayerVideo::reset_metadata (shared_ptr<const Film> film, dcp::Size video_container_size, dcp::Size film_frame_size)
{
shared_ptr<Content> content = _content.lock();
if (!content || !_video_frame) {
}
_crop = content->video->crop();
- _fade = content->video->fade(_video_frame.get());
+ _fade = content->video->fade(film, _video_frame.get());
_inter_size = content->video->scale().size(content->video, video_container_size, film_frame_size);
_out_size = video_container_size;
_colour_conversion = content->video->colour_conversion();