Cleanup: remove unnecessary parameter to PlayerVideo::force().
authorCarl Hetherington <cth@carlh.net>
Sat, 18 Dec 2021 14:10:10 +0000 (15:10 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 18 Dec 2021 14:10:36 +0000 (15:10 +0100)
src/lib/ffmpeg_encoder.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/player_video.cc
src/lib/player_video.h
src/wx/film_viewer.cc
src/wx/gl_video_view.cc
src/wx/simple_video_view.cc
test/butler_test.cc
test/dcp_playback_test.cc
test/player_test.cc

index 6dc3a83d40bfda813b0e1546649bcd831f27048c..d4f0b4b472612bb7ee449bd7b51bad00d81fd9f6 100644 (file)
@@ -108,7 +108,7 @@ FFmpegEncoder::FFmpegEncoder (
        }
 
        _butler = std::make_shared<Butler>(
-               _film, _player, map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), VideoRange::VIDEO, Image::Alignment::PADDED, false, false
+               _film, _player, map, _output_audio_channels, bind(&PlayerVideo::force, FFmpegFileEncoder::pixel_format(format)), VideoRange::VIDEO, Image::Alignment::PADDED, false, false
                );
 }
 
index 705557f799b3b76f434eb182fe116b4a32b03e85..f9443b256ef79a2b3ccf29cccb45e77d9e4d8fe3 100644 (file)
@@ -400,7 +400,7 @@ FFmpegFileEncoder::video (shared_ptr<PlayerVideo> video, DCPTime time)
 {
        /* All our output formats are video range at the moment */
        auto image = video->image (
-               bind (&PlayerVideo::force, _1, _pixel_format),
+               bind (&PlayerVideo::force, _pixel_format),
                VideoRange::VIDEO,
                false
                );
index 4cc536bb7530583639e14e3ff7c6270549daf947..2f0616d4804a033bfa2aa94433aab7d46e10027c 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "content.h"
 #include "film.h"
 #include "image.h"
@@ -33,17 +34,19 @@ extern "C" {
 #include <libxml++/libxml++.h>
 #include <iostream>
 
+
 using std::cout;
 using std::dynamic_pointer_cast;
+using std::function;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
 using std::weak_ptr;
 using boost::optional;
-using std::function;
 using dcp::Data;
 using dcp::raw_convert;
 
+
 PlayerVideo::PlayerVideo (
        shared_ptr<const ImageProxy> in,
        Crop crop,
@@ -285,7 +288,7 @@ PlayerVideo::same (shared_ptr<const PlayerVideo> other) const
 }
 
 AVPixelFormat
-PlayerVideo::force (AVPixelFormat, AVPixelFormat force_to)
+PlayerVideo::force (AVPixelFormat force_to)
 {
        return force_to;
 }
index 237d2e3fe2858083d6a6d165dd0ac63999fee693..f2781c1a0c51c3e099dd0009604e04a89ce2c3df 100644 (file)
@@ -79,7 +79,7 @@ public:
        std::shared_ptr<Image> image (std::function<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool fast) const;
        std::shared_ptr<const Image> raw_image () const;
 
-       static AVPixelFormat force (AVPixelFormat, AVPixelFormat);
+       static AVPixelFormat force (AVPixelFormat);
        static AVPixelFormat keep_xyz_or_rgb (AVPixelFormat);
 
        void add_metadata (xmlpp::Node* node) const;
index ac12bea3f6f9870a001e976b20d6f5d0eb1d8e0a..d91a9db9ce981275c4c743c3dcf0e5c390d024f1 100644 (file)
@@ -68,6 +68,7 @@ using std::max;
 using std::shared_ptr;
 using std::string;
 using std::vector;
+using boost::bind;
 using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -223,7 +224,7 @@ FilmViewer::recreate_butler ()
                _player,
                Config::instance()->audio_mapping(_audio_channels),
                _audio_channels,
-               bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
+               bind(&PlayerVideo::force, AV_PIX_FMT_RGB24),
                VideoRange::FULL,
                j2k_gl_optimised ? Image::Alignment::COMPACT : Image::Alignment::PADDED,
                true,
index 0a82355373e60d78a6474170dc03b47ac2207709..72efce0e46688a187a08530ae0cb3e99a4ae38e8 100644 (file)
@@ -60,6 +60,7 @@
 using std::cout;
 using std::shared_ptr;
 using std::string;
+using boost::bind;
 using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -506,7 +507,7 @@ GLVideoView::draw ()
 void
 GLVideoView::set_image (shared_ptr<const PlayerVideo> pv)
 {
-       shared_ptr<const Image> video = _optimise_for_j2k ? pv->raw_image() : pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
+       shared_ptr<const Image> video = _optimise_for_j2k ? pv->raw_image() : pv->image(bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
 
        /* Only the player's black frames should be aligned at this stage, so this should
         * almost always have no work to do.
index f4ff9a4ebaea4da93ef57ba8d714953247eca46b..7f816c31d74905d8309b8c69480fec571254f84c 100644 (file)
@@ -34,6 +34,7 @@
 using std::max;
 using std::shared_ptr;
 using std::string;
+using boost::bind;
 using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -224,7 +225,7 @@ SimpleVideoView::update ()
 
        _state_timer.set ("get image");
 
-       _image = player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
+       _image = player_video().first->image(bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
 
        _state_timer.set ("ImageChanged");
        _viewer->image_changed (player_video().first);
index 3d524a3b258382d98f82786224fae38a69793eb2..f1ee446437bb51a1bc0b861558f077297094ff96 100644 (file)
@@ -32,6 +32,7 @@
 
 using std::make_shared;
 using std::shared_ptr;
+using boost::bind;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -59,7 +60,7 @@ BOOST_AUTO_TEST_CASE (butler_test1)
                map.set (i, i, 1);
        }
 
-       Butler butler (film, make_shared<Player>(film, Image::Alignment::COMPACT), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, false, false);
+       Butler butler (film, make_shared<Player>(film, Image::Alignment::COMPACT), map, 6, bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, false, false);
 
        BOOST_CHECK (butler.get_video(Butler::Behaviour::BLOCKING, 0).second == DCPTime());
        BOOST_CHECK (butler.get_video(Butler::Behaviour::BLOCKING, 0).second == DCPTime::from_frames(1, 24));
index 5117be9edd7566ecaa0a94aa7e959bcee235e7d6..032d1d90d2738ba96a32d0272776021b8cbb3b33 100644 (file)
@@ -29,6 +29,7 @@
 
 using std::make_shared;
 using std::make_shared;
+using boost::bind;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -48,7 +49,7 @@ BOOST_AUTO_TEST_CASE (dcp_playback_test)
                make_shared<Player>(film, Image::Alignment::PADDED),
                AudioMapping(6, 6),
                6,
-               bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
+               bind(&PlayerVideo::force, AV_PIX_FMT_RGB24),
                VideoRange::FULL,
                Image::Alignment::PADDED,
                true,
@@ -63,6 +64,6 @@ BOOST_AUTO_TEST_CASE (dcp_playback_test)
                }
                /* assuming DCP is 24fps/48kHz */
                butler->get_audio (Butler::Behaviour::BLOCKING, audio_buffer.data(), 2000);
-               p.first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
+               p.first->image(bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
        }
 }
index cafb14586a1e56421449c7e97b5b0c3366c4a5fc..79170611cf9496134b5ff5d261de8a63d10a17cd 100644 (file)
@@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
        player->set_always_burn_open_subtitles ();
        player->set_play_referenced ();
 
-       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false);
+       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false);
        butler->disable_audio();
 
        for (int i = 0; i < 10; ++i) {
@@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
                butler->seek (t, true);
                auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
                BOOST_CHECK_EQUAL(video.second.get(), t.get());
-               write_image(video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test_%1.png", i));
+               write_image(video.first->image(bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test_%1.png", i));
                /* This 14.08 is empirically chosen (hopefully) to accept changes in rendering between the reference and a test machine
                   (17.10 and 16.04 seem to anti-alias a little differently) but to reject gross errors e.g. missing fonts or missing
                   text altogether.
@@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
        player->set_always_burn_open_subtitles ();
        player->set_play_referenced ();
 
-       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false);
+       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false);
        butler->disable_audio();
 
        butler->seek(DCPTime::from_seconds(5), true);
@@ -276,7 +276,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
                auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
                BOOST_CHECK_EQUAL(video.second.get(), t.get());
                write_image(
-                       video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test2_%1.png", i)
+                       video.first->image(bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test2_%1.png", i)
                        );
                check_image(TestPaths::private_data() / String::compose("player_seek_test2_%1.png", i), String::compose("build/test/player_seek_test2_%1.png", i), 14.08);
        }
@@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE (player_trim_crash)
 
        auto player = std::make_shared<Player>(film, Image::Alignment::COMPACT);
        player->set_fast ();
-       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, true, false);
+       auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 6, bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, true, false);
 
        /* Wait for the butler to fill */
        dcpomatic_sleep_seconds (5);