More player debugging for butler video-full states.
[dcpomatic.git] / src / wx / film_viewer.cc
1 /*
2     Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 /** @file  src/film_viewer.cc
22  *  @brief A wx widget to view a preview of a Film.
23  */
24
25 #include "film_viewer.h"
26 #include "playhead_to_timecode_dialog.h"
27 #include "playhead_to_frame_dialog.h"
28 #include "wx_util.h"
29 #include "closed_captions_dialog.h"
30 #include "lib/film.h"
31 #include "lib/ratio.h"
32 #include "lib/util.h"
33 #include "lib/job_manager.h"
34 #include "lib/image.h"
35 #include "lib/exceptions.h"
36 #include "lib/examine_content_job.h"
37 #include "lib/filter.h"
38 #include "lib/player.h"
39 #include "lib/player_video.h"
40 #include "lib/video_content.h"
41 #include "lib/video_decoder.h"
42 #include "lib/timer.h"
43 #include "lib/butler.h"
44 #include "lib/log.h"
45 #include "lib/config.h"
46 #include "lib/compose.hpp"
47 #include "lib/dcpomatic_log.h"
48 extern "C" {
49 #include <libavutil/pixfmt.h>
50 }
51 #include <dcp/exceptions.h>
52 #include <wx/tglbtn.h>
53 #include <iostream>
54 #include <iomanip>
55
56 using std::string;
57 using std::pair;
58 using std::min;
59 using std::max;
60 using std::cout;
61 using std::list;
62 using std::bad_alloc;
63 using std::make_pair;
64 using std::exception;
65 using boost::shared_ptr;
66 using boost::dynamic_pointer_cast;
67 using boost::weak_ptr;
68 using boost::optional;
69 using dcp::Size;
70
71 static
72 int
73 rtaudio_callback (void* out, void *, unsigned int frames, double, RtAudioStreamStatus, void* data)
74 {
75         return reinterpret_cast<FilmViewer*>(data)->audio_callback (out, frames);
76 }
77
78 FilmViewer::FilmViewer (wxWindow* p)
79         : _panel (new wxPanel (p))
80         , _coalesce_player_changes (false)
81         , _audio (DCPOMATIC_RTAUDIO_API)
82         , _audio_channels (0)
83         , _audio_block_size (1024)
84         , _playing (false)
85         , _latency_history_count (0)
86         , _dropped (0)
87         , _closed_captions_dialog (new ClosedCaptionsDialog(p))
88         , _outline_content (false)
89         , _eyes (EYES_LEFT)
90         , _pad_black (false)
91 #ifdef DCPOMATIC_VARIANT_SWAROOP
92         , _in_watermark (false)
93         , _background_image (false)
94 #endif
95 {
96 #ifndef __WXOSX__
97         _panel->SetDoubleBuffered (true);
98 #endif
99
100         _panel->SetBackgroundStyle (wxBG_STYLE_PAINT);
101         _panel->SetBackgroundColour (*wxBLACK);
102
103         _panel->Bind (wxEVT_PAINT, boost::bind (&FilmViewer::paint_panel, this));
104         _panel->Bind (wxEVT_SIZE,  boost::bind (&FilmViewer::panel_sized, this, _1));
105         _timer.Bind  (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this));
106
107         set_film (shared_ptr<Film> ());
108
109         _config_changed_connection = Config::instance()->Changed.connect (bind (&FilmViewer::config_changed, this, _1));
110         config_changed (Config::SOUND_OUTPUT);
111 }
112
113 FilmViewer::~FilmViewer ()
114 {
115         stop ();
116 }
117
118 void
119 FilmViewer::set_film (shared_ptr<Film> film)
120 {
121         if (_film == film) {
122                 return;
123         }
124
125         _film = film;
126         _video_position = DCPTime ();
127         _player_video.first.reset ();
128         _player_video.second = DCPTime ();
129
130         _frame.reset ();
131         _closed_captions_dialog->clear ();
132
133         if (!_film) {
134                 _player.reset ();
135                 recreate_butler ();
136                 _frame.reset ();
137                 refresh_panel ();
138                 return;
139         }
140
141         try {
142                 _player.reset (new Player (_film, _film->playlist ()));
143                 _player->set_fast ();
144                 if (_dcp_decode_reduction) {
145                         _player->set_dcp_decode_reduction (_dcp_decode_reduction);
146                 }
147         } catch (bad_alloc &) {
148                 error_dialog (_panel, _("There is not enough free memory to do that."));
149                 _film.reset ();
150                 return;
151         }
152
153         _player->set_always_burn_open_subtitles ();
154         _player->set_play_referenced ();
155
156         _film->Change.connect (boost::bind (&FilmViewer::film_change, this, _1, _2));
157         _player->Change.connect (boost::bind (&FilmViewer::player_change, this, _1, _2, _3));
158
159         /* Keep about 1 second's worth of history samples */
160         _latency_history_count = _film->audio_frame_rate() / _audio_block_size;
161
162         recreate_butler ();
163
164         calculate_sizes ();
165         slow_refresh ();
166 }
167
168 void
169 FilmViewer::recreate_butler ()
170 {
171         bool const was_running = stop ();
172         _butler.reset ();
173
174         if (!_film) {
175                 return;
176         }
177
178         AudioMapping map = AudioMapping (_film->audio_channels(), _audio_channels);
179
180         if (_audio_channels != 2 || _film->audio_channels() < 3) {
181                 for (int i = 0; i < min (_film->audio_channels(), _audio_channels); ++i) {
182                         map.set (i, i, 1);
183                 }
184         } else {
185                 /* Special case: stereo output, at least 3 channel input.
186                    Map so that Lt = L(-3dB) + Ls(-3dB) + C(-6dB) + Lfe(-10dB)
187                                Rt = R(-3dB) + Rs(-3dB) + C(-6dB) + Lfe(-10dB)
188                 */
189                 map.set (dcp::LEFT,   0, 1 / sqrt(2)); // L -> Lt
190                 map.set (dcp::RIGHT,  1, 1 / sqrt(2)); // R -> Rt
191                 map.set (dcp::CENTRE, 0, 1 / 2.0); // C -> Lt
192                 map.set (dcp::CENTRE, 1, 1 / 2.0); // C -> Rt
193                 map.set (dcp::LFE,    0, 1 / sqrt(10)); // Lfe -> Lt
194                 map.set (dcp::LFE,    1, 1 / sqrt(10)); // Lfe -> Rt
195                 map.set (dcp::LS,     0, 1 / sqrt(2)); // Ls -> Lt
196                 map.set (dcp::RS,     1, 1 / sqrt(2)); // Rs -> Rt
197         }
198
199         _butler.reset (new Butler(_player, map, _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
200         if (!Config::instance()->sound() && !_audio.isStreamOpen()) {
201                 _butler->disable_audio ();
202         }
203
204         _closed_captions_dialog->set_butler (_butler);
205
206         if (was_running) {
207                 start ();
208         }
209 }
210
211 void
212 FilmViewer::refresh_panel ()
213 {
214         _panel->Refresh ();
215         _panel->Update ();
216 }
217
218 void
219 FilmViewer::get ()
220 {
221         DCPOMATIC_ASSERT (_butler);
222
223         do {
224                 Butler::Error e;
225                 _player_video = _butler->get_video (&e);
226                 if (!_player_video.first && e == Butler::AGAIN) {
227                         signal_manager->when_idle (boost::bind(&FilmViewer::get, this));
228                         return;
229                 }
230         } while (
231                 _player_video.first &&
232                 _film->three_d() &&
233                 _eyes != _player_video.first->eyes() &&
234                 _player_video.first->eyes() != EYES_BOTH
235                 );
236
237         _butler->rethrow ();
238
239         display_player_video ();
240 }
241
242 void
243 FilmViewer::display_player_video ()
244 {
245         if (!_player_video.first) {
246                 _frame.reset ();
247                 refresh_panel ();
248                 return;
249         }
250
251         if (_playing && (time() - _player_video.second) > one_video_frame()) {
252                 /* Too late; just drop this frame before we try to get its image (which will be the time-consuming
253                    part if this frame is J2K).
254                 */
255                 _video_position = _player_video.second;
256                 ++_dropped;
257                 return;
258         }
259
260         /* In an ideal world, what we would do here is:
261          *
262          * 1. convert to XYZ exactly as we do in the DCP creation path.
263          * 2. convert back to RGB for the preview display, compensating
264          *    for the monitor etc. etc.
265          *
266          * but this is inefficient if the source is RGB.  Since we don't
267          * (currently) care too much about the precise accuracy of the preview's
268          * colour mapping (and we care more about its speed) we try to short-
269          * circuit this "ideal" situation in some cases.
270          *
271          * The content's specified colour conversion indicates the colourspace
272          * which the content is in (according to the user).
273          *
274          * PlayerVideo::image (bound to PlayerVideo::force) will take the source
275          * image and convert it (from whatever the user has said it is) to RGB.
276          */
277
278         _frame = _player_video.first->image (bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true);
279
280         ImageChanged (_player_video.first);
281
282         _video_position = _player_video.second;
283         _inter_position = _player_video.first->inter_position ();
284         _inter_size = _player_video.first->inter_size ();
285
286         refresh_panel ();
287
288         _closed_captions_dialog->update (time());
289 }
290
291 void
292 FilmViewer::timer ()
293 {
294         if (!_film || !_playing) {
295                 return;
296         }
297
298         get ();
299         PositionChanged ();
300         DCPTime const next = _video_position + one_video_frame();
301
302         if (next >= _film->length()) {
303                 stop ();
304                 Finished ();
305                 return;
306         }
307
308         LOG_DEBUG_PLAYER("%1 -> %2; delay %3", next.seconds(), time().seconds(), max((next.seconds() - time().seconds()) * 1000, 1.0));
309         _timer.Start (max ((next.seconds() - time().seconds()) * 1000, 1.0), wxTIMER_ONE_SHOT);
310
311         if (_butler) {
312                 _butler->rethrow ();
313         }
314 }
315
316 bool
317 #ifdef DCPOMATIC_VARIANT_SWAROOP
318 FilmViewer::maybe_draw_background_image (wxPaintDC& dc)
319 {
320         optional<boost::filesystem::path> bg = Config::instance()->player_background_image();
321         if (bg) {
322                 wxImage image (std_to_wx(bg->string()));
323                 wxBitmap bitmap (image);
324                 dc.DrawBitmap (bitmap, max(0, (_panel_size.width - image.GetSize().GetWidth()) / 2), max(0, (_panel_size.height - image.GetSize().GetHeight()) / 2));
325                 return true;
326         }
327
328         return false;
329 }
330 #else
331 FilmViewer::maybe_draw_background_image (wxPaintDC &)
332 {
333         return false;
334 }
335 #endif
336
337 void
338 FilmViewer::paint_panel ()
339 {
340         wxPaintDC dc (_panel);
341
342 #ifdef DCPOMATIC_VARIANT_SWAROOP
343         if (_background_image) {
344                 dc.Clear ();
345                 maybe_draw_background_image (dc);
346                 return;
347         }
348 #endif
349
350         if (!_out_size.width || !_out_size.height || !_film || !_frame || _out_size != _frame->size()) {
351                 dc.Clear ();
352                 return;
353         }
354
355         wxImage frame (_out_size.width, _out_size.height, _frame->data()[0], true);
356         wxBitmap frame_bitmap (frame);
357         dc.DrawBitmap (frame_bitmap, 0, max(0, (_panel_size.height - _out_size.height) / 2));
358
359 #ifdef DCPOMATIC_VARIANT_SWAROOP
360         DCPTime const period = DCPTime::from_seconds(Config::instance()->player_watermark_period() * 60);
361         int64_t n = _video_position.get() / period.get();
362         DCPTime from(n * period.get());
363         DCPTime to = from + DCPTime::from_seconds(Config::instance()->player_watermark_duration() / 1000.0);
364         if (from <= _video_position && _video_position <= to) {
365                 if (!_in_watermark) {
366                         _in_watermark = true;
367                         _watermark_x = rand() % _panel_size.width;
368                         _watermark_y = rand() % _panel_size.height;
369                 }
370                 dc.SetTextForeground(*wxWHITE);
371                 string wm = Config::instance()->player_watermark_theatre();
372                 boost::posix_time::ptime t = boost::posix_time::second_clock::local_time();
373                 wm += "\n" + boost::posix_time::to_iso_extended_string(t);
374                 dc.DrawText(std_to_wx(wm), _watermark_x, _watermark_y);
375         } else {
376                 _in_watermark = false;
377         }
378 #endif
379
380         if (_out_size.width < _panel_size.width) {
381                 /* XXX: these colours are right for GNOME; may need adjusting for other OS */
382                 wxPen   p (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
383                 wxBrush b (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
384                 dc.SetPen (p);
385                 dc.SetBrush (b);
386                 dc.DrawRectangle (_out_size.width, 0, _panel_size.width - _out_size.width, _panel_size.height);
387         }
388
389         if (_out_size.height < _panel_size.height) {
390                 wxPen   p (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
391                 wxBrush b (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
392                 dc.SetPen (p);
393                 dc.SetBrush (b);
394                 int const gap = (_panel_size.height - _out_size.height) / 2;
395                 dc.DrawRectangle (0, 0, _panel_size.width, gap);
396                 dc.DrawRectangle (0, gap + _out_size.height + 1, _panel_size.width, gap);
397         }
398
399         if (_outline_content) {
400                 wxPen p (wxColour (255, 0, 0), 2);
401                 dc.SetPen (p);
402                 dc.SetBrush (*wxTRANSPARENT_BRUSH);
403                 dc.DrawRectangle (_inter_position.x, _inter_position.y + (_panel_size.height - _out_size.height) / 2, _inter_size.width, _inter_size.height);
404         }
405 }
406
407 void
408 FilmViewer::set_outline_content (bool o)
409 {
410         _outline_content = o;
411         refresh_panel ();
412 }
413
414 void
415 FilmViewer::set_eyes (Eyes e)
416 {
417         _eyes = e;
418         slow_refresh ();
419 }
420
421 void
422 FilmViewer::panel_sized (wxSizeEvent& ev)
423 {
424         _panel_size.width = ev.GetSize().GetWidth();
425         _panel_size.height = ev.GetSize().GetHeight();
426
427         calculate_sizes ();
428         if (!quick_refresh()) {
429                 slow_refresh ();
430         }
431         PositionChanged ();
432 }
433
434 void
435 FilmViewer::calculate_sizes ()
436 {
437         if (!_film || !_player) {
438                 return;
439         }
440
441         Ratio const * container = _film->container ();
442
443         float const panel_ratio = _panel_size.ratio ();
444         float const film_ratio = container ? container->ratio () : 1.78;
445
446         if (panel_ratio < film_ratio) {
447                 /* panel is less widscreen than the film; clamp width */
448                 _out_size.width = _panel_size.width;
449                 _out_size.height = lrintf (_out_size.width / film_ratio);
450         } else {
451                 /* panel is more widescreen than the film; clamp height */
452                 _out_size.height = _panel_size.height;
453                 _out_size.width = lrintf (_out_size.height * film_ratio);
454         }
455
456         /* Catch silly values */
457         _out_size.width = max (64, _out_size.width);
458         _out_size.height = max (64, _out_size.height);
459
460         _player->set_video_container_size (_out_size);
461 }
462
463 void
464 FilmViewer::start ()
465 {
466         if (!_film) {
467                 return;
468         }
469
470         optional<bool> v = PlaybackPermitted ();
471         if (v && !*v) {
472                 /* Computer says no */
473                 return;
474         }
475
476         if (_audio.isStreamOpen()) {
477                 _audio.setStreamTime (_video_position.seconds());
478                 _audio.startStream ();
479         }
480
481         _playing = true;
482         _dropped = 0;
483         timer ();
484         Started (position());
485 }
486
487 bool
488 FilmViewer::stop ()
489 {
490         if (_audio.isStreamRunning()) {
491                 /* stop stream and discard any remaining queued samples */
492                 _audio.abortStream ();
493         }
494
495         if (!_playing) {
496                 return false;
497         }
498
499         _playing = false;
500         Stopped (position());
501         return true;
502 }
503
504 void
505 FilmViewer::player_change (ChangeType type, int property, bool frequent)
506 {
507         if (type != CHANGE_TYPE_DONE || frequent) {
508                 return;
509         }
510
511         if (_coalesce_player_changes) {
512                 _pending_player_changes.push_back (property);
513                 return;
514         }
515
516         calculate_sizes ();
517         bool refreshed = false;
518         if (
519                 property == VideoContentProperty::CROP ||
520                 property == VideoContentProperty::SCALE ||
521                 property == VideoContentProperty::FADE_IN ||
522                 property == VideoContentProperty::FADE_OUT ||
523                 property == VideoContentProperty::COLOUR_CONVERSION ||
524                 property == PlayerProperty::VIDEO_CONTAINER_SIZE ||
525                 property == PlayerProperty::FILM_CONTAINER
526                 ) {
527                 refreshed = quick_refresh ();
528         }
529
530         if (!refreshed) {
531                 slow_refresh ();
532         }
533         PositionChanged ();
534 }
535
536 void
537 FilmViewer::film_change (ChangeType type, Film::Property p)
538 {
539         if (type == CHANGE_TYPE_DONE && p == Film::AUDIO_CHANNELS) {
540                 recreate_butler ();
541         }
542 }
543
544 /** Re-get the current frame slowly by seeking */
545 void
546 FilmViewer::slow_refresh ()
547 {
548         seek (_video_position, true);
549 }
550
551 /** Try to re-get the current frame quickly by resetting the metadata
552  *  in the PlayerVideo that we used last time.
553  *  @return true if this was possible, false if not.
554  */
555 bool
556 FilmViewer::quick_refresh ()
557 {
558         if (!_player_video.first) {
559                 return false;
560         }
561
562         if (!_player_video.first->reset_metadata (_film, _player->video_container_size(), _film->frame_size())) {
563                 return false;
564         }
565
566         display_player_video ();
567         return true;
568 }
569
570 void
571 FilmViewer::seek (shared_ptr<Content> content, ContentTime t, bool accurate)
572 {
573         optional<DCPTime> dt = _player->content_time_to_dcp (content, t);
574         if (dt) {
575                 seek (*dt, accurate);
576         }
577 }
578
579 void
580 FilmViewer::set_coalesce_player_changes (bool c)
581 {
582         _coalesce_player_changes = c;
583
584         if (!c) {
585                 BOOST_FOREACH (int i, _pending_player_changes) {
586                         player_change (CHANGE_TYPE_DONE, i, false);
587                 }
588                 _pending_player_changes.clear ();
589         }
590 }
591
592 void
593 FilmViewer::seek (DCPTime t, bool accurate)
594 {
595         if (!_butler) {
596                 return;
597         }
598
599         if (t < DCPTime ()) {
600                 t = DCPTime ();
601         }
602
603         if (t >= _film->length ()) {
604                 t = _film->length ();
605         }
606
607         bool const was_running = stop ();
608
609         _closed_captions_dialog->clear ();
610         _butler->seek (t, accurate);
611         get ();
612
613         if (was_running) {
614                 start ();
615         }
616
617         PositionChanged ();
618 }
619
620 void
621 FilmViewer::config_changed (Config::Property p)
622 {
623 #ifdef DCPOMATIC_VARIANT_SWAROOP
624         if (p == Config::PLAYER_BACKGROUND_IMAGE) {
625                 refresh_panel ();
626                 return;
627         }
628 #endif
629
630         if (p != Config::SOUND && p != Config::SOUND_OUTPUT) {
631                 return;
632         }
633
634         if (_audio.isStreamOpen ()) {
635                 _audio.closeStream ();
636         }
637
638         if (Config::instance()->sound() && _audio.getDeviceCount() > 0) {
639                 unsigned int st = 0;
640                 if (Config::instance()->sound_output()) {
641                         while (st < _audio.getDeviceCount()) {
642                                 if (_audio.getDeviceInfo(st).name == Config::instance()->sound_output().get()) {
643                                         break;
644                                 }
645                                 ++st;
646                         }
647                         if (st == _audio.getDeviceCount()) {
648                                 st = _audio.getDefaultOutputDevice();
649                         }
650                 } else {
651                         st = _audio.getDefaultOutputDevice();
652                 }
653
654                 _audio_channels = _audio.getDeviceInfo(st).outputChannels;
655
656                 RtAudio::StreamParameters sp;
657                 sp.deviceId = st;
658                 sp.nChannels = _audio_channels;
659                 sp.firstChannel = 0;
660                 try {
661                         _audio.openStream (&sp, 0, RTAUDIO_FLOAT32, 48000, &_audio_block_size, &rtaudio_callback, this);
662 #ifdef DCPOMATIC_USE_RTERROR
663                 } catch (RtError& e) {
664 #else
665                 } catch (RtAudioError& e) {
666 #endif
667                         error_dialog (
668                                 _panel,
669                                 _("Could not set up audio output.  There will be no audio during the preview."), std_to_wx(e.what())
670                                 );
671                 }
672                 recreate_butler ();
673
674         } else {
675                 _audio_channels = 0;
676                 recreate_butler ();
677         }
678 }
679
680 DCPTime
681 FilmViewer::uncorrected_time () const
682 {
683         if (_audio.isStreamRunning ()) {
684                 return DCPTime::from_seconds (const_cast<RtAudio*>(&_audio)->getStreamTime());
685         }
686
687         return _video_position;
688 }
689
690 DCPTime
691 FilmViewer::time () const
692 {
693         if (_audio.isStreamRunning ()) {
694                 return DCPTime::from_seconds (const_cast<RtAudio*>(&_audio)->getStreamTime ()) -
695                         DCPTime::from_frames (average_latency(), _film->audio_frame_rate());
696         }
697
698         return _video_position;
699 }
700
701 int
702 FilmViewer::audio_callback (void* out_p, unsigned int frames)
703 {
704         while (true) {
705                 optional<DCPTime> t = _butler->get_audio (reinterpret_cast<float*> (out_p), frames);
706                 if (!t || DCPTime(uncorrected_time() - *t) < one_video_frame()) {
707                         /* There was an underrun or this audio is on time; carry on */
708                         break;
709                 }
710                 /* The audio we just got was (very) late; drop it and get some more. */
711         }
712
713         boost::mutex::scoped_lock lm (_latency_history_mutex, boost::try_to_lock);
714         if (lm) {
715                 _latency_history.push_back (_audio.getStreamLatency ());
716                 if (_latency_history.size() > static_cast<size_t> (_latency_history_count)) {
717                         _latency_history.pop_front ();
718                 }
719         }
720
721         return 0;
722 }
723
724 Frame
725 FilmViewer::average_latency () const
726 {
727         boost::mutex::scoped_lock lm (_latency_history_mutex);
728         if (_latency_history.empty()) {
729                 return 0;
730         }
731
732         Frame total = 0;
733         BOOST_FOREACH (Frame i, _latency_history) {
734                 total += i;
735         }
736
737         return total / _latency_history.size();
738 }
739
740 void
741 FilmViewer::set_dcp_decode_reduction (optional<int> reduction)
742 {
743         _dcp_decode_reduction = reduction;
744         if (_player) {
745                 _player->set_dcp_decode_reduction (reduction);
746         }
747 }
748
749 optional<int>
750 FilmViewer::dcp_decode_reduction () const
751 {
752         return _dcp_decode_reduction;
753 }
754
755 DCPTime
756 FilmViewer::one_video_frame () const
757 {
758         return DCPTime::from_frames (1, _film->video_frame_rate());
759 }
760
761 /** Open a dialog box showing our film's closed captions */
762 void
763 FilmViewer::show_closed_captions ()
764 {
765         _closed_captions_dialog->Show();
766 }
767
768 void
769 FilmViewer::seek_by (DCPTime by, bool accurate)
770 {
771         seek (_video_position + by, accurate);
772 }
773
774 void
775 FilmViewer::set_pad_black (bool p)
776 {
777         _pad_black = p;
778 }