summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-08 23:56:30 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-10 21:13:04 +0200
commitb4e4f2f752bf451e38cf47190a4d4df228ff7db9 (patch)
treead49d1b37050f038e0c4e5ac91e55e4ac808a8dd /src
parentc39eb25116392813e064c963a9bce014e92805b3 (diff)
White space: video_view.{cc,h}
Diffstat (limited to 'src')
-rw-r--r--src/wx/video_view.cc52
-rw-r--r--src/wx/video_view.h88
2 files changed, 70 insertions, 70 deletions
diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc
index c658e3663..0cb4a46ce 100644
--- a/src/wx/video_view.cc
+++ b/src/wx/video_view.cc
@@ -36,20 +36,20 @@ static constexpr int TOO_MANY_DROPPED_FRAMES = 20;
static constexpr int TOO_MANY_DROPPED_PERIOD = 5.0;
-VideoView::VideoView (FilmViewer* viewer)
- : _viewer (viewer)
- , _state_timer ("viewer")
+VideoView::VideoView(FilmViewer* viewer)
+ : _viewer(viewer)
+ , _state_timer("viewer")
{
}
void
-VideoView::clear ()
+VideoView::clear()
{
- boost::mutex::scoped_lock lm (_mutex);
- _player_video.first.reset ();
- _player_video.second = dcpomatic::DCPTime ();
+ boost::mutex::scoped_lock lm(_mutex);
+ _player_video.first.reset();
+ _player_video.second = dcpomatic::DCPTime();
}
@@ -59,25 +59,25 @@ VideoView::clear ()
* if there is a frame.
*/
VideoView::NextFrameResult
-VideoView::get_next_frame (bool non_blocking)
+VideoView::get_next_frame(bool non_blocking)
{
if (length() == dcpomatic::DCPTime()) {
return FAIL;
}
- auto butler = _viewer->butler ();
+ auto butler = _viewer->butler();
if (!butler) {
return FAIL;
}
- add_get ();
+ add_get();
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
do {
Butler::Error e;
- auto pv = butler->get_video (non_blocking ? Butler::Behaviour::NON_BLOCKING : Butler::Behaviour::BLOCKING, &e);
+ auto pv = butler->get_video(non_blocking ? Butler::Behaviour::NON_BLOCKING : Butler::Behaviour::BLOCKING, &e);
if (e.code == Butler::Error::Code::DIED) {
- LOG_ERROR ("Butler died with {}", e.summary());
+ LOG_ERROR("Butler died with {}", e.summary());
}
if (!pv.first) {
return e.code == Butler::Error::Code::AGAIN ? AGAIN : FAIL;
@@ -99,15 +99,15 @@ VideoView::get_next_frame (bool non_blocking)
dcpomatic::DCPTime
-VideoView::one_video_frame () const
+VideoView::one_video_frame() const
{
- return dcpomatic::DCPTime::from_frames (1, video_frame_rate());
+ return dcpomatic::DCPTime::from_frames(1, video_frame_rate());
}
/** @return Time in ms until the next frame is due, or empty if nothing is due */
optional<int>
-VideoView::time_until_next_frame () const
+VideoView::time_until_next_frame() const
{
if (length() == dcpomatic::DCPTime()) {
/* There's no content, so this doesn't matter */
@@ -124,9 +124,9 @@ VideoView::time_until_next_frame () const
void
-VideoView::start ()
+VideoView::start()
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_dropped = 0;
_errored = 0;
gettimeofday(&_dropped_check_period_start, nullptr);
@@ -134,9 +134,9 @@ VideoView::start ()
bool
-VideoView::reset_metadata (shared_ptr<const Film> film, dcp::Size player_video_container_size)
+VideoView::reset_metadata(shared_ptr<const Film> film, dcp::Size player_video_container_size)
{
- auto pv = player_video ();
+ auto pv = player_video();
if (!pv.first) {
return false;
}
@@ -145,22 +145,22 @@ VideoView::reset_metadata (shared_ptr<const Film> film, dcp::Size player_video_c
return false;
}
- update ();
+ update();
return true;
}
void
-VideoView::add_dropped ()
+VideoView::add_dropped()
{
bool too_many = false;
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
++_dropped;
if (_dropped > TOO_MANY_DROPPED_FRAMES) {
struct timeval now;
- gettimeofday (&now, nullptr);
+ gettimeofday(&now, nullptr);
double const elapsed = seconds(now) - seconds(_dropped_check_period_start);
too_many = elapsed < TOO_MANY_DROPPED_PERIOD;
_dropped = 0;
@@ -169,13 +169,13 @@ VideoView::add_dropped ()
}
if (too_many) {
- emit (boost::bind(boost::ref(TooManyDropped)));
+ emit(boost::bind(boost::ref(TooManyDropped)));
}
}
wxColour
-VideoView::pad_colour () const
+VideoView::pad_colour() const
{
if (_viewer->pad_black()) {
return wxColour(0, 0, 0);
diff --git a/src/wx/video_view.h b/src/wx/video_view.h
index 3ea03a5fd..422323fe7 100644
--- a/src/wx/video_view.h
+++ b/src/wx/video_view.h
@@ -48,20 +48,20 @@ class wxWindow;
class VideoView : public ExceptionStore, public Signaller
{
public:
- VideoView (FilmViewer* viewer);
- virtual ~VideoView () {}
+ VideoView(FilmViewer* viewer);
+ virtual ~VideoView() {}
- VideoView (VideoView const&) = delete;
- VideoView& operator= (VideoView const&) = delete;
+ VideoView(VideoView const&) = delete;
+ VideoView& operator=(VideoView const&) = delete;
/** @return the thing displaying the image */
- virtual wxWindow* get () const = 0;
+ virtual wxWindow* get() const = 0;
/** Re-make and display the image from the current _player_video */
- virtual void update () = 0;
+ virtual void update() = 0;
/** Called when playback starts */
- virtual void start ();
+ virtual void start();
/** Called when playback stops */
- virtual void stop () {}
+ virtual void stop() {}
enum NextFrameResult {
FAIL,
@@ -70,10 +70,10 @@ public:
};
/** Get the next frame and display it; used after seek */
- virtual NextFrameResult display_next_frame (bool) = 0;
+ virtual NextFrameResult display_next_frame(bool) = 0;
- void clear ();
- bool reset_metadata (std::shared_ptr<const Film> film, dcp::Size player_video_container_size);
+ void clear();
+ bool reset_metadata(std::shared_ptr<const Film> film, dcp::Size player_video_container_size);
/** Emitted from the GUI thread when our display changes in size */
boost::signals2::signal<void()> Sized;
@@ -83,27 +83,27 @@ public:
/* Accessors for FilmViewer */
- int dropped () const {
- boost::mutex::scoped_lock lm (_mutex);
+ int dropped() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _dropped;
}
- int errored () const {
- boost::mutex::scoped_lock lm (_mutex);
+ int errored() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _errored;
}
- int gets () const {
- boost::mutex::scoped_lock lm (_mutex);
+ int gets() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _gets;
}
- StateTimer const & state_timer () const {
+ StateTimer const & state_timer() const {
return _state_timer;
}
- dcpomatic::DCPTime position () const {
- boost::mutex::scoped_lock lm (_mutex);
+ dcpomatic::DCPTime position() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _player_video.second;
}
@@ -112,23 +112,23 @@ public:
* we can then use (thread) safely.
*/
- void set_video_frame_rate (int r) {
- boost::mutex::scoped_lock lm (_mutex);
+ void set_video_frame_rate(int r) {
+ boost::mutex::scoped_lock lm(_mutex);
_video_frame_rate = r;
}
- void set_length (dcpomatic::DCPTime len) {
- boost::mutex::scoped_lock lm (_mutex);
+ void set_length(dcpomatic::DCPTime len) {
+ boost::mutex::scoped_lock lm(_mutex);
_length = len;
}
- void set_eyes (Eyes eyes) {
- boost::mutex::scoped_lock lm (_mutex);
+ void set_eyes(Eyes eyes) {
+ boost::mutex::scoped_lock lm(_mutex);
_eyes = eyes;
}
- void set_three_d (bool t) {
- boost::mutex::scoped_lock lm (_mutex);
+ void set_three_d(bool t) {
+ boost::mutex::scoped_lock lm(_mutex);
_three_d = t;
}
@@ -137,43 +137,43 @@ public:
}
protected:
- NextFrameResult get_next_frame (bool non_blocking);
- boost::optional<int> time_until_next_frame () const;
- dcpomatic::DCPTime one_video_frame () const;
+ NextFrameResult get_next_frame(bool non_blocking);
+ boost::optional<int> time_until_next_frame() const;
+ dcpomatic::DCPTime one_video_frame() const;
- wxColour pad_colour () const;
+ wxColour pad_colour() const;
- wxColour outline_content_colour () const {
+ wxColour outline_content_colour() const {
return wxColour(255, 0, 0);
}
- wxColour outline_subtitles_colour () const {
+ wxColour outline_subtitles_colour() const {
return wxColour(0, 255, 0);
}
- wxColour crop_guess_colour () const {
+ wxColour crop_guess_colour() const {
return wxColour(0, 0, 255);
}
- int video_frame_rate () const {
- boost::mutex::scoped_lock lm (_mutex);
+ int video_frame_rate() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _video_frame_rate;
}
- dcpomatic::DCPTime length () const {
- boost::mutex::scoped_lock lm (_mutex);
+ dcpomatic::DCPTime length() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _length;
}
- std::pair<std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> player_video () const {
- boost::mutex::scoped_lock lm (_mutex);
+ std::pair<std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> player_video() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _player_video;
}
- void add_dropped ();
+ void add_dropped();
- void add_get () {
- boost::mutex::scoped_lock lm (_mutex);
+ void add_get() {
+ boost::mutex::scoped_lock lm(_mutex);
++_gets;
}