]> git.sesse.net Git - nageru/blob - input_state.h
Release Nageru 1.7.2.
[nageru] / input_state.h
1 #ifndef _INPUT_STATE_H
2 #define _INPUT_STATE_H 1
3
4 #include <movit/image_format.h>
5
6 #include "defs.h"
7 #include "ref_counted_frame.h"
8
9 struct BufferedFrame {
10         RefCountedFrame frame;
11         unsigned field_number;
12 };
13
14 // Encapsulates the state of all inputs at any given instant.
15 // In particular, this is captured by Theme::get_chain(),
16 // so that it can hold on to all the frames it needs for rendering.
17 struct InputState {
18         // For each card, the last five frames (or fields), with 0 being the
19         // most recent one. Note that we only need the actual history if we have
20         // interlaced output (for deinterlacing), so if we detect progressive input,
21         // we immediately clear out all history and all entries will point to the same
22         // frame.
23         BufferedFrame buffered_frames[MAX_VIDEO_CARDS][FRAME_HISTORY_LENGTH];
24
25         // For each card, the current Y'CbCr input settings. Ignored for BGRA inputs.
26         // If ycbcr_coefficients_auto = true for a given card, the others are ignored
27         // for that card (SD is taken to be Rec. 601, HD is taken to be Rec. 709,
28         // both limited range).
29         bool ycbcr_coefficients_auto[MAX_VIDEO_CARDS];
30         movit::YCbCrLumaCoefficients ycbcr_coefficients[MAX_VIDEO_CARDS];
31         bool full_range[MAX_VIDEO_CARDS];
32 };
33
34 #endif  // !defined(_INPUT_STATE_H)