]> git.sesse.net Git - bmusb/commitdiff
Convert decode_video_format to return unsigned quantities.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Nov 2015 20:09:55 +0000 (21:09 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Nov 2015 20:09:55 +0000 (21:09 +0100)
bmusb.cpp
bmusb.h

index 62376db795743a93079a745f32f70458ea092ed1..11decd9b430b78729cf723dd1976c643a1cb0c9f 100644 (file)
--- 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 f643bd471738600615cf4dbafaef3e5564e03405..2ed7308648f3df399b7fca778a22d42015461af9 100644 (file)
--- 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