summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecparsers
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2013-03-08 18:17:16 +0200
committerJan Schmidt <jan@centricular.com>2014-10-29 23:09:41 +1100
commit51f003e469c7b50b8e003c0169c9bcb9cc9f86d7 (patch)
tree801694c5023336bef141be653c0d53a914200304 /gst-libs/gst/codecparsers
parent8911a80662a21978cfc032c193f9e8b70874ce54 (diff)
downloadgstreamer-plugins-bad-51f003e469c7b50b8e003c0169c9bcb9cc9f86d7.tar.gz
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>
Diffstat (limited to 'gst-libs/gst/codecparsers')
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c28
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.h13
2 files changed, 41 insertions, 0 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index 0aab99430..625b6f525 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -1052,6 +1052,30 @@ 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
gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
NalReader * nr, GstH264SEIMessage * sei)
@@ -1097,6 +1121,10 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
res = gst_h264_parser_parse_recovery_point (nalparser,
&sei->payload.recovery_point, nr);
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:
/* Just consume payloadSize bytes, which does not account for
emulation prevention bytes */
diff --git a/gst-libs/gst/codecparsers/gsth264parser.h b/gst-libs/gst/codecparsers/gsth264parser.h
index 3028a8f40..4af62676a 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.h
+++ b/gst-libs/gst/codecparsers/gsth264parser.h
@@ -184,6 +184,7 @@ typedef enum
GST_H264_SEI_BUF_PERIOD = 0,
GST_H264_SEI_PIC_TIMING = 1,
GST_H264_SEI_RECOVERY_POINT = 6,
+ GST_H264_SEI_STEREO_VIDEO_INFO = 21
/* and more... */
} GstH264SEIPayloadType;
@@ -261,6 +262,7 @@ typedef struct _GstH264ClockTimestamp GstH264ClockTimestamp;
typedef struct _GstH264PicTiming GstH264PicTiming;
typedef struct _GstH264BufferingPeriod GstH264BufferingPeriod;
typedef struct _GstH264RecoveryPoint GstH264RecoveryPoint;
+typedef struct _GstH264StereoVideoInfo GstH264StereoVideoInfo;
typedef struct _GstH264SEIMessage GstH264SEIMessage;
/**
@@ -842,6 +844,16 @@ struct _GstH264ClockTimestamp
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
{
guint32 cpb_removal_delay;
@@ -884,6 +896,7 @@ struct _GstH264SEIMessage
GstH264BufferingPeriod buffering_period;
GstH264PicTiming pic_timing;
GstH264RecoveryPoint recovery_point;
+ GstH264StereoVideoInfo stereo_video_info;
/* ... could implement more */
} payload;
};