]> git.sesse.net Git - bmusb/blobdiff - bmusb.h
Send the video format in directly to the video frame callback, so that we do not...
[bmusb] / bmusb.h
diff --git a/bmusb.h b/bmusb.h
index 6fdddedeb6e1d5781d8a9128cf67b5525fd5ef33..04d867b009e49cabc4fdcd6cf63a3f3b46b88b1e 100644 (file)
--- a/bmusb.h
+++ b/bmusb.h
@@ -57,8 +57,16 @@ class FrameAllocator {
        virtual void release_frame(Frame frame) = 0;
 };
 
+struct VideoFormat {
+       uint16_t id = 0;  // For debugging/logging only.
+       unsigned width = 0, height = 0, second_field_start = 0;
+       unsigned extra_lines_top = 0, extra_lines_bottom = 0;
+       unsigned frame_rate_nom = 0, frame_rate_den = 0;
+       bool interlaced = false;
+};
+
 typedef std::function<void(uint16_t timecode,
-                           FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format,
+                           FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format,
                            FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format)>
        frame_callback_t;
 
@@ -168,8 +176,6 @@ class BMUSBCapture {
 // "second_field_start" is only valid for interlaced modes; it signifies
 // how many lines from the very top of the frame there are before the second field
 // starts (so it will always be >= height/2 + extra_lines_top).
-bool decode_video_format(uint16_t video_format, unsigned *width, unsigned *height, unsigned *second_field_start,
-                         unsigned *extra_lines_top, unsigned *extra_lines_bottom,
-                         unsigned *frame_rate_nom, unsigned *frame_rate_den, bool *interlaced);
+bool decode_video_format(uint16_t video_format, VideoFormat *decoded_video_format);
 
 #endif