- if (h265parse->sei_pic_struct != GST_H265_SEI_PIC_STRUCT_FRAME) {
- if (h265parse->parsed_framerate) {
- /* If the frame rate doesn't come from upstream (e.g. a muxer), it means
- * we must double it, because it's now fields per second */
- gint new_fps_n, new_fps_d;
-
- gst_util_fraction_multiply (h265parse->fps_num, h265parse->fps_den, 2, 1,
- &new_fps_n, &new_fps_d);
- h265parse->fps_num = new_fps_n;
- h265parse->fps_den = new_fps_d;
- h265parse->parsed_framerate = FALSE;
- /* We need to fix the duration of the first frame */
- GST_BUFFER_DURATION (parse_buffer) /= 2;
- }
- GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED);
- /* h265 doesn't support interleaved */
- switch (h265parse->sei_pic_struct) {
- case GST_H265_SEI_PIC_STRUCT_TOP_FIELD:
- case GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM:
- case GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM:
- GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_TOP_FIELD);
- break;
- case GST_H265_SEI_PIC_STRUCT_BOTTOM_FIELD:
- case GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP:
- case GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP:
- GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD);
- break;
- default:
- break;
- }
+ /* see section D.3.3 of the spec */
+ switch (h265parse->sei_pic_struct) {
+ case GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM:
+ case GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP:
+ case GST_H265_SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
+ case GST_H265_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
+ GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED);
+ break;
+ case GST_H265_SEI_PIC_STRUCT_TOP_FIELD:
+ case GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM:
+ case GST_H265_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM:
+ GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED);
+ GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_TOP_FIELD);
+ break;
+ case GST_H265_SEI_PIC_STRUCT_BOTTOM_FIELD:
+ case GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP:
+ case GST_H265_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP:
+ GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED);
+ GST_BUFFER_FLAG_SET (parse_buffer, GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD);
+ break;
+ default:
+ break;