X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bmusb.h;fp=bmusb.h;h=04d867b009e49cabc4fdcd6cf63a3f3b46b88b1e;hb=bb575c1ac8b1496394732800898c27a3a812f0a9;hp=6fdddedeb6e1d5781d8a9128cf67b5525fd5ef33;hpb=92b5c7ee2c994efcff467df370fe61ff05dcfe04;p=bmusb diff --git a/bmusb.h b/bmusb.h index 6fddded..04d867b 100644 --- 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 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