From 62463c958d6109af87bc22f3d5ccad0421889a5e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 21 Nov 2015 21:09:55 +0100 Subject: [PATCH] Convert decode_video_format to return unsigned quantities. --- bmusb.cpp | 12 ++++++------ bmusb.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bmusb.cpp b/bmusb.cpp index 62376db..11decd9 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -256,7 +256,7 @@ void BMUSBCapture::start_new_frame(const uint8_t *start) // Update the assumed frame width. We might be one frame too late on format changes, // but it's much better than asking the user to choose manually. - int width, height, extra_lines_top, extra_lines_bottom, frame_rate_nom, frame_rate_den; + unsigned width, height, extra_lines_top, extra_lines_bottom, frame_rate_nom, frame_rate_den; bool interlaced; if (decode_video_format(format, &width, &height, &extra_lines_top, &extra_lines_bottom, &frame_rate_nom, &frame_rate_den, &interlaced)) { @@ -1113,14 +1113,14 @@ void BMUSBCapture::stop_bm_thread() struct VideoFormatEntry { uint16_t normalized_video_format; - int width, height; - int extra_lines_top, extra_lines_bottom; - int frame_rate_nom, frame_rate_den; + unsigned width, height; + unsigned extra_lines_top, extra_lines_bottom; + unsigned frame_rate_nom, frame_rate_den; bool interlaced; }; -bool decode_video_format(uint16_t video_format, int *width, int *height, int *extra_lines_top, int *extra_lines_bottom, - int *frame_rate_nom, int *frame_rate_den, bool *interlaced) +bool decode_video_format(uint16_t video_format, unsigned *width, unsigned *height, unsigned *extra_lines_top, unsigned *extra_lines_bottom, + unsigned *frame_rate_nom, unsigned *frame_rate_den, bool *interlaced) { *interlaced = false; diff --git a/bmusb.h b/bmusb.h index f643bd4..2ed7308 100644 --- a/bmusb.h +++ b/bmusb.h @@ -158,7 +158,7 @@ class BMUSBCapture { // Get details for the given video format; returns false if detection was incomplete. // Note: Frame rate is _frame_ rate, not field rate. So 1080i60 gets 30/1, _not_ 60/1. // TODO: Add another extra_lines_ parameter for interlaced. -bool decode_video_format(uint16_t video_format, int *width, int *height, int *extra_lines_top, int *extra_lines_bottom, - int *frame_rate_nom, int *frame_rate_den, bool *interlaced); +bool decode_video_format(uint16_t video_format, unsigned *width, unsigned *height, unsigned *extra_lines_top, unsigned *extra_lines_bottom, + unsigned *frame_rate_nom, unsigned *frame_rate_den, bool *interlaced); #endif -- 2.39.2