mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
mpeg2dec: Correctly flag output buffer interlaced state
If the sequence is not flagged as progressive its buffers are marked interlace mode mixed. There is an individual picture flag indicating whether picture in the sequence are interlaced or not. This is used along with the new GST_VIDEO_BUFFER_FLAG_INTERLACED to correctly and completely indicate the buffer's interlaced state. Also, TFF and RFF should only be set if the sequence is not progressive.
This commit is contained in:
parent
a20ba81f9a
commit
870fe4e7ec
1 changed files with 13 additions and 7 deletions
|
@ -813,15 +813,21 @@ handle_picture (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info,
|
|||
GST_DEBUG_OBJECT (mpeg2dec, "picture %s, frame %i",
|
||||
key_frame ? ", kf," : " ", frame->system_frame_number);
|
||||
|
||||
if (picture->flags & PIC_FLAG_TOP_FIELD_FIRST) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF);
|
||||
}
|
||||
if (GST_VIDEO_INFO_IS_INTERLACED (&frame->info)) {
|
||||
// This implies SEQ_FLAG_PROGRESSIVE_SEQUENCE is not set
|
||||
if (picture->flags & PIC_FLAG_TOP_FIELD_FIRST) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF);
|
||||
}
|
||||
if (!(picture->flags & PIC_FLAG_PROGRESSIVE_FRAME)) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED);
|
||||
}
|
||||
#if MPEG2_RELEASE >= MPEG2_VERSION(0,5,0)
|
||||
/* repeat field introduced in 0.5.0 */
|
||||
if (picture->flags & PIC_FLAG_REPEAT_FIRST_FIELD) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF);
|
||||
}
|
||||
/* repeat field introduced in 0.5.0 */
|
||||
if (picture->flags & PIC_FLAG_REPEAT_FIRST_FIELD) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mpeg2dec->discont_state == MPEG2DEC_DISC_NEW_PICTURE && key_frame) {
|
||||
mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_KEYFRAME;
|
||||
|
|
Loading…
Reference in a new issue