From 33929966f03efc11d23d4ec5fdf492ff09c2ab9e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 10 Nov 2017 18:05:11 +0100 Subject: [PATCH] Cut a few more allocations. --- mixer.cpp | 6 +++--- mixer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mixer.cpp b/mixer.cpp index f502eb0..dc178db 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -1390,7 +1390,7 @@ void Mixer::render_one_frame(int64_t duration) live_frame.ready_fence = fence; live_frame.input_frames = {}; live_frame.temp_textures = { y_display_tex, cbcr_display_tex }; - output_channel[OUTPUT_LIVE].output_frame(live_frame); + output_channel[OUTPUT_LIVE].output_frame(move(live_frame)); // Set up preview and any additional channels. for (int i = 1; i < theme->get_num_channels() + 2; ++i) { @@ -1401,7 +1401,7 @@ void Mixer::render_one_frame(int64_t duration) display_frame.ready_fence = fence; display_frame.input_frames = move(chain.input_frames); display_frame.temp_textures = {}; - output_channel[i].output_frame(display_frame); + output_channel[i].output_frame(move(display_frame)); } } @@ -1521,7 +1521,7 @@ Mixer::OutputChannel::~OutputChannel() } } -void Mixer::OutputChannel::output_frame(DisplayFrame frame) +void Mixer::OutputChannel::output_frame(DisplayFrame &&frame) { // Store this frame for display. Remove the ready frame if any // (it was seemingly never used). diff --git a/mixer.h b/mixer.h index 89676bd..1d2e200 100644 --- a/mixer.h +++ b/mixer.h @@ -548,7 +548,7 @@ private: class OutputChannel { public: ~OutputChannel(); - void output_frame(DisplayFrame frame); + void output_frame(DisplayFrame &&frame); bool get_display_frame(DisplayFrame *frame); void add_frame_ready_callback(void *key, new_frame_ready_callback_t callback); void remove_frame_ready_callback(void *key); -- 2.39.2