mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
codecparsers: h264: add support for Stereo Video Information SEI message.
Add the necessary payload parsing support for stereo_video_info. https://bugzilla.gnome.org/show_bug.cgi?id=685215 Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
This commit is contained in:
parent
8911a80662
commit
51f003e469
3 changed files with 47 additions and 0 deletions
|
@ -1052,6 +1052,30 @@ error:
|
||||||
return GST_H264_PARSER_ERROR;
|
return GST_H264_PARSER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Parse SEI stereo_video_info() message */
|
||||||
|
static GstH264ParserResult
|
||||||
|
gst_h264_parser_parse_stereo_video_info (GstH264NalParser * nalparser,
|
||||||
|
GstH264StereoVideoInfo * info, NalReader * nr)
|
||||||
|
{
|
||||||
|
GST_DEBUG ("parsing \"Stereo Video info\"");
|
||||||
|
|
||||||
|
READ_UINT8 (nr, info->field_views_flag, 1);
|
||||||
|
if (info->field_views_flag) {
|
||||||
|
READ_UINT8 (nr, info->top_field_is_left_view_flag, 1);
|
||||||
|
} else {
|
||||||
|
READ_UINT8 (nr, info->current_frame_is_left_view_flag, 1);
|
||||||
|
READ_UINT8 (nr, info->next_frame_is_second_view_flag, 1);
|
||||||
|
}
|
||||||
|
READ_UINT8 (nr, info->left_view_self_contained_flag, 1);
|
||||||
|
READ_UINT8 (nr, info->right_view_self_contained_flag, 1);
|
||||||
|
|
||||||
|
return GST_H264_PARSER_OK;
|
||||||
|
|
||||||
|
error:
|
||||||
|
GST_WARNING ("error parsing \"Stereo Video info\"");
|
||||||
|
return GST_H264_PARSER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
static GstH264ParserResult
|
static GstH264ParserResult
|
||||||
gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
||||||
NalReader * nr, GstH264SEIMessage * sei)
|
NalReader * nr, GstH264SEIMessage * sei)
|
||||||
|
@ -1097,6 +1121,10 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
||||||
res = gst_h264_parser_parse_recovery_point (nalparser,
|
res = gst_h264_parser_parse_recovery_point (nalparser,
|
||||||
&sei->payload.recovery_point, nr);
|
&sei->payload.recovery_point, nr);
|
||||||
break;
|
break;
|
||||||
|
case GST_H264_SEI_STEREO_VIDEO_INFO:
|
||||||
|
res = gst_h264_parser_parse_stereo_video_info (nalparser,
|
||||||
|
&sei->payload.stereo_video_info, nr);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* Just consume payloadSize bytes, which does not account for
|
/* Just consume payloadSize bytes, which does not account for
|
||||||
emulation prevention bytes */
|
emulation prevention bytes */
|
||||||
|
|
|
@ -184,6 +184,7 @@ typedef enum
|
||||||
GST_H264_SEI_BUF_PERIOD = 0,
|
GST_H264_SEI_BUF_PERIOD = 0,
|
||||||
GST_H264_SEI_PIC_TIMING = 1,
|
GST_H264_SEI_PIC_TIMING = 1,
|
||||||
GST_H264_SEI_RECOVERY_POINT = 6,
|
GST_H264_SEI_RECOVERY_POINT = 6,
|
||||||
|
GST_H264_SEI_STEREO_VIDEO_INFO = 21
|
||||||
/* and more... */
|
/* and more... */
|
||||||
} GstH264SEIPayloadType;
|
} GstH264SEIPayloadType;
|
||||||
|
|
||||||
|
@ -261,6 +262,7 @@ typedef struct _GstH264ClockTimestamp GstH264ClockTimestamp;
|
||||||
typedef struct _GstH264PicTiming GstH264PicTiming;
|
typedef struct _GstH264PicTiming GstH264PicTiming;
|
||||||
typedef struct _GstH264BufferingPeriod GstH264BufferingPeriod;
|
typedef struct _GstH264BufferingPeriod GstH264BufferingPeriod;
|
||||||
typedef struct _GstH264RecoveryPoint GstH264RecoveryPoint;
|
typedef struct _GstH264RecoveryPoint GstH264RecoveryPoint;
|
||||||
|
typedef struct _GstH264StereoVideoInfo GstH264StereoVideoInfo;
|
||||||
typedef struct _GstH264SEIMessage GstH264SEIMessage;
|
typedef struct _GstH264SEIMessage GstH264SEIMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -842,6 +844,16 @@ struct _GstH264ClockTimestamp
|
||||||
guint32 time_offset;
|
guint32 time_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _GstH264StereoVideoInfo
|
||||||
|
{
|
||||||
|
guint8 field_views_flag;
|
||||||
|
guint8 top_field_is_left_view_flag;
|
||||||
|
guint8 current_frame_is_left_view_flag;
|
||||||
|
guint8 next_frame_is_second_view_flag;
|
||||||
|
guint8 left_view_self_contained_flag;
|
||||||
|
guint8 right_view_self_contained_flag;
|
||||||
|
};
|
||||||
|
|
||||||
struct _GstH264PicTiming
|
struct _GstH264PicTiming
|
||||||
{
|
{
|
||||||
guint32 cpb_removal_delay;
|
guint32 cpb_removal_delay;
|
||||||
|
@ -884,6 +896,7 @@ struct _GstH264SEIMessage
|
||||||
GstH264BufferingPeriod buffering_period;
|
GstH264BufferingPeriod buffering_period;
|
||||||
GstH264PicTiming pic_timing;
|
GstH264PicTiming pic_timing;
|
||||||
GstH264RecoveryPoint recovery_point;
|
GstH264RecoveryPoint recovery_point;
|
||||||
|
GstH264StereoVideoInfo stereo_video_info;
|
||||||
/* ... could implement more */
|
/* ... could implement more */
|
||||||
} payload;
|
} payload;
|
||||||
};
|
};
|
||||||
|
|
|
@ -528,6 +528,12 @@ gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu)
|
||||||
sei.payload.recovery_point.broken_link_flag,
|
sei.payload.recovery_point.broken_link_flag,
|
||||||
sei.payload.recovery_point.changing_slice_group_idc);
|
sei.payload.recovery_point.changing_slice_group_idc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Additional messages that are not innerly useful to the
|
||||||
|
* element but for debugging purposes */
|
||||||
|
case GST_H264_SEI_STEREO_VIDEO_INFO:
|
||||||
|
GST_LOG_OBJECT (h264parse, "stereo video information message");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_array_free (messages, TRUE);
|
g_array_free (messages, TRUE);
|
||||||
|
|
Loading…
Reference in a new issue