From ed68bfad5c795afb342c5228f3c1dc7770a6d646 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 6 Nov 2018 22:43:52 +0000 Subject: Switch PlayerVideo::always_rgb to a new ::force and use it in FFmpegFileEncoder. --- src/lib/ffmpeg_file_encoder.cc | 8 +------- src/lib/player_video.cc | 6 +++--- src/lib/player_video.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/lib') diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index 52977ad5b..7cc4d26a4 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -43,12 +43,6 @@ using boost::weak_ptr; int FFmpegFileEncoder::_video_stream_index = 0; int FFmpegFileEncoder::_audio_stream_index = 1; -static AVPixelFormat -force_pixel_format (AVPixelFormat, AVPixelFormat out) -{ - return out; -} - FFmpegFileEncoder::FFmpegFileEncoder ( dcp::Size video_frame_size, int video_frame_rate, @@ -230,7 +224,7 @@ void FFmpegFileEncoder::video (shared_ptr video, DCPTime time) { shared_ptr image = video->image ( - bind (&force_pixel_format, _1, _pixel_format), + bind (&PlayerVideo::force, _1, _pixel_format), true, false ); diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 376ace128..c9ed6a6e4 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -105,7 +105,7 @@ PlayerVideo::set_text (PositionImage image) /** Create an image for this frame. * @param pixel_format Function which is called to decide what pixel format the output image should be; * it is passed the pixel format of the input image from the ImageProxy, and should return the desired - * output pixel format. Two functions always_rgb and keep_xyz_or_rgb are provided for use here. + * output pixel format. Two functions force and keep_xyz_or_rgb are provided for use here. * @param aligned true if the output image should be aligned to 32-byte boundaries. * @param fast true to be fast at the expense of quality. */ @@ -254,9 +254,9 @@ PlayerVideo::same (shared_ptr other) const } AVPixelFormat -PlayerVideo::always_rgb (AVPixelFormat) +PlayerVideo::force (AVPixelFormat, AVPixelFormat force_to) { - return AV_PIX_FMT_RGB24; + return force_to; } AVPixelFormat diff --git a/src/lib/player_video.h b/src/lib/player_video.h index 6599eeaa0..8e41e8f23 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -65,7 +65,7 @@ public: void prepare (); boost::shared_ptr image (boost::function pixel_format, bool aligned, bool fast) const; - static AVPixelFormat always_rgb (AVPixelFormat); + static AVPixelFormat force (AVPixelFormat, AVPixelFormat); static AVPixelFormat keep_xyz_or_rgb (AVPixelFormat); void add_metadata (xmlpp::Node* node) const; -- cgit v1.2.3