const gchar *caps_mview_mode = NULL;
GstVideoMultiviewMode mview_mode = h264parse->multiview_mode;
GstVideoMultiviewFlags mview_flags = h264parse->multiview_flags;
+ const gchar *chroma_format = NULL;
+ guint bit_depth_chroma;
fps_num = h264parse->fps_num;
fps_den = h264parse->fps_den;
if (s && !gst_structure_has_field (s, "interlace-mode"))
gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING,
gst_video_interlace_mode_to_string (imode), NULL);
+
+ bit_depth_chroma = sps->bit_depth_chroma_minus8 + 8;
+
+ switch (sps->chroma_format_idc) {
+ case 0:
+ chroma_format = "4:0:0";
+ bit_depth_chroma = 0;
+ break;
+ case 1:
+ chroma_format = "4:2:0";
+ break;
+ case 2:
+ chroma_format = "4:2:2";
+ break;
+ case 3:
+ chroma_format = "4:4:4";
+ break;
+ default:
+ break;
+ }
+
+ if (chroma_format)
+ gst_caps_set_simple (caps,
+ "chroma-format", G_TYPE_STRING, chroma_format,
+ "bit-depth-luma", G_TYPE_UINT, sps->bit_depth_luma_minus8 + 8,
+ "bit-depth-chroma", G_TYPE_UINT, bit_depth_chroma, NULL);
}
}
caps = gst_caps_copy (sink_caps);
} else {
gint crop_width, crop_height;
+ const gchar *chroma_format = NULL;
+ guint bit_depth_chroma;
if (sps->conformance_window_flag) {
crop_width = sps->crop_rect_width;
gst_base_parse_set_latency (GST_BASE_PARSE (h265parse), latency,
latency);
}
+
+ bit_depth_chroma = sps->bit_depth_chroma_minus8 + 8;
+
+ switch (sps->chroma_format_idc) {
+ case 0:
+ chroma_format = "4:0:0";
+ bit_depth_chroma = 0;
+ break;
+ case 1:
+ chroma_format = "4:2:0";
+ break;
+ case 2:
+ chroma_format = "4:2:2";
+ break;
+ case 3:
+ chroma_format = "4:4:4";
+ break;
+ default:
+ break;
+ }
+
+ if (chroma_format)
+ gst_caps_set_simple (caps, "chroma-format", G_TYPE_STRING,
+ chroma_format, "bit-depth-luma", G_TYPE_UINT,
+ sps->bit_depth_luma_minus8 + 8, "bit-depth-chroma", G_TYPE_UINT,
+ bit_depth_chroma, NULL);
}
}