3 Video buffers have a number of states identifiable through a combination
4 of caps and buffer flags.
12 - Three fields - this should be a progressive buffer with a repeated 'first'
13 field that can be used for telecine pulldown
18 - Interlaced (a.k.a. 'mixed'; the fields are from different frames)
19 - Three fields - this should be a progressive buffer with a repeated 'first'
20 field that can be used for telecine pulldown
22 Note: It can be seen that the difference between the plain interlaced
23 and telecine states is that in the latter, buffers containing
24 two fields may be progressive.
26 Tools for identification:
28 - `GstVideoInterlaceMode` - enum `GST_VIDEO_INTERLACE_MODE_...`
32 - Buffers flags - `GST_VIDEO_BUFFER_FLAG_...`
38 ## Identification of Buffer States
40 Note that flags are not necessarily interpreted in the same way for all
41 different states nor are they necessarily required nor make sense in all
46 If the interlace mode in the video info corresponding to a buffer is
47 **"progressive"**, then the buffer is progressive.
51 If the video info interlace mode is **"interleaved"**, then the buffer is
54 `GST_VIDEO_BUFFER_FLAG_TFF` indicates whether the top or bottom field
55 is to be displayed first. The timestamp on the buffer corresponds to the
58 `GST_VIDEO_BUFFER_FLAG_RFF` indicates that the first field (indicated
59 by the TFF flag) should be repeated. This is generally only used for
60 telecine purposes but as the telecine state was added long after the
61 interlaced state was added and defined, this flag remains valid for
62 plain interlaced buffers.
64 `GST_VIDEO_BUFFER_FLAG_ONEFIELD` means that only the field indicated
65 through the TFF flag is to be used. The other field should be ignored.
69 If video info interlace mode is **"mixed"** then the buffers are in some
70 form of telecine state.
72 The `TFF` and `ONEFIELD` flags have the same semantics as for the plain
75 `GST_VIDEO_BUFFER_FLAG_RFF` in the telecine state indicates that the
76 buffer contains only repeated fields that are present in other buffers
77 and are as such unneeded. For example, in a sequence of three telecined
78 frames, we might have:
82 In this situation, we only need the first and third buffers as the
83 second buffer contains fields present in the first and third.
85 Note that the following state can have its second buffer identified
86 using the `ONEFIELD` flag (and `TFF` not set):
90 The telecine state requires one additional flag to be able to identify
93 The presence of the `GST_VIDEO_BUFFER_FLAG_INTERLACED` means that the
94 buffer is an 'interlaced' or 'mixed' buffer that contains two fields
95 that, when combined with fields from adjacent buffers, allow
96 reconstruction of progressive frames. The absence of the flag implies
97 the buffer containing two fields is a progressive frame.
99 For example in the following sequence, the third buffer would be mixed
100 (yes, it is a strange pattern, but it can happen):
102 AtAb AtBb BtCb CtDb DtDb
108 If the video info interlace mode is **"alternate"**, then each buffer
109 carries a single field of interlaced video.
111 `GST_VIDEO_BUFFER_FLAG_TOP_FIELD` and `GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD`
112 indicate whether the buffer carries a top or bottom field. The order of
113 buffers/fields in the stream and the timestamps on the buffers indicate the
114 temporal order of the fields.
116 Top and bottom fields are expected to alternate in this mode.
118 Caps for this interlace mode must also carry a `format:Interlaced` caps feature
119 (`GST_CAPS_FEATURE_FORMAT_INTERLACED`) to ensure backwards compatibility for
122 The frame rate in the caps still signals the frame rate, so the notional field
123 rate will be twice the frame rate from the caps (see `GST_VIDEO_INFO_FIELD_RATE_N`).