+ /* First handle BluRay-specific stream types since there is some overlap
+ * between BluRay and non-BluRay streay type identifiers */
+ desc = mpegts_get_descriptor_from_program (program, DESC_REGISTRATION);
+ if (desc) {
+ if (DESC_REGISTRATION_format_identifier (desc) == DRF_ID_HDMV) {
+ switch (bstream->stream_type) {
+ case ST_BD_AUDIO_AC3:
+ {
+ guint8 *ac3_desc;
+
+ /* ATSC ac3 audio descriptor */
+ ac3_desc =
+ mpegts_get_descriptor_from_stream ((MpegTSBaseStream *) stream,
+ DESC_AC3_AUDIO_STREAM);
+ if (ac3_desc && DESC_AC_AUDIO_STREAM_bsid (ac3_desc) != 16) {
+ GST_LOG ("ac3 audio");
+ template = gst_static_pad_template_get (&audio_template);
+ name = g_strdup_printf ("audio_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("audio/x-ac3");
+
+ g_free (ac3_desc);
+ } else {
+ template = gst_static_pad_template_get (&audio_template);
+ name = g_strdup_printf ("audio_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("audio/x-eac3");
+ }
+ break;
+ }
+ case ST_BD_AUDIO_EAC3:
+ template = gst_static_pad_template_get (&audio_template);
+ name = g_strdup_printf ("audio_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("audio/x-eac3");
+ break;
+ case ST_BD_AUDIO_AC3_TRUE_HD:
+ template = gst_static_pad_template_get (&audio_template);
+ name = g_strdup_printf ("audio_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("audio/x-true-hd");
+ break;
+ case ST_BD_AUDIO_LPCM:
+ template = gst_static_pad_template_get (&audio_template);
+ name = g_strdup_printf ("audio_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("audio/x-private-ts-lpcm");
+ break;
+ case ST_BD_PGS_SUBPICTURE:
+ template = gst_static_pad_template_get (&subpicture_template);
+ name = g_strdup_printf ("subpicture_%04x", bstream->pid);
+ caps = gst_caps_new_empty_simple ("subpicture/x-pgs");
+ break;
+ }
+ }
+ g_free (desc);
+ }
+ if (template && name && caps)
+ goto done;
+
+ /* Handle non-BluRay stream types */