From f4aeae09a072b4bbea7e25715e916f143a41d61c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 30 Oct 2023 17:17:23 +0100 Subject: [PATCH] ug_input: improved includes+using - sort includes alphabetically - system includes first - do not include config*.h (not needed) - do use-include whole namespace (std and std::chrono) --- src/video_capture/ug_input.cpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/video_capture/ug_input.cpp b/src/video_capture/ug_input.cpp index 155c1bce3..a7223e3f2 100644 --- a/src/video_capture/ug_input.cpp +++ b/src/video_capture/ug_input.cpp @@ -35,9 +35,13 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" +#include +#include +#include +#include +#include +#include +#include #include "audio/audio.h" #include "audio/types.h" @@ -52,17 +56,21 @@ #include "video_rxtx.hpp" #include "video_rxtx/ultragrid_rtp.hpp" -#include -#include -#include -#include -#include -#include - +#define MOD_NAME "[ug_input] " static constexpr int MAX_QUEUE_SIZE = 2; -using namespace std; -using namespace std::chrono; +using std::lock_guard; +using std::map; +using std::mutex; +using std::pair; +using std::queue; +using std::stoi; +using std::string; +using std::thread; +using std::unique_ptr; +using std::chrono::duration; +using std::chrono::duration_cast; +using std::chrono::steady_clock; struct ug_input_state : public frame_recv_delegate { mutex lock; @@ -86,7 +94,7 @@ void ug_input_state::frame_arrived(struct video_frame *f, struct audio_frame *a) if (frame_queue.size() < MAX_QUEUE_SIZE) { frame_queue.push({f, a}); } else { - cerr << "[ug_input] Dropping frame!" << endl; + MSG(WARNING, "Dropping frame!\n"); AUDIO_FRAME_DISPOSE(a); VIDEO_FRAME_DISPOSE(f); }