diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegdemux/gstmpegdesc.h | 17 | ||||
-rw-r--r-- | gst/mpegdemux/mpegtspacketizer.c | 41 | ||||
-rw-r--r-- | gst/shapewipe/gstshapewipe.c | 45 |
3 files changed, 82 insertions, 21 deletions
diff --git a/gst/mpegdemux/gstmpegdesc.h b/gst/mpegdemux/gstmpegdesc.h index 84b40009..71b74aa2 100644 --- a/gst/mpegdemux/gstmpegdesc.h +++ b/gst/mpegdemux/gstmpegdesc.h @@ -78,6 +78,7 @@ #define DESC_DIRAC_TC_PRIVATE 0xAC /* DVB tags */ +#define DESC_DVB_CAROUSEL_IDENTIFIER 0x13 #define DESC_DVB_NETWORK_NAME 0x40 #define DESC_DVB_SERVICE_LIST 0x41 #define DESC_DVB_STUFFING 0x42 @@ -302,6 +303,22 @@ #define DESC_DVB_CABLE_DELIVERY_SYSTEM_symbol_rate(desc) (desc + 9) #define DESC_DVB_CABLE_DELIVERY_SYSTEM_fec_inner(desc) (desc[12] & 0x0F) +/* DVB Data Broadcast Descriptor */ +#define DESC_DVB_DATA_BROADCAST_data_broadcast_id(desc) (GST_READ_UINT16_BE((desc) + 2)) +#define DESC_DVB_DATA_BROADCAST_component_tag(desc) (desc[4]) +#define DESC_DVB_DATA_BROADCAST_selector_length(desc) (desc[5]) +#define DESC_DVB_DATA_BROADCAST_selector(desc) (desc + 6) +#define DESC_DVB_DATA_BROADCAST_iso639_language_code(desc) (desc + 6 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) +#define DESC_DVB_DATA_BROADCAST_text_length(desc) (desc + 9 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) +#define DESC_DVB_DATA_BROADCAST_text(desc) (desc + 10 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) + +/* DVB Data Broadcast Id Descriptor */ +#define DESC_DVB_DATA_BROADCAST_ID_data_broadcast_id(desc) (GST_READ_UINT16_BE((desc) + 2)) +#define DESC_DVB_DATA_BROADCAST_ID_id_selector_byte(desc) (desc + 4) + +/* DVB Carousel Identifier Descriptor */ +#define DESC_DVB_CAROUSEL_IDENTIFIER_carousel_id(desc) (GST_READ_UINT32_BE((desc) + 2)) + typedef struct { guint n_desc; guint8 data_length; diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index c9fc325f..5ed71f0c 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -507,10 +507,48 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer, GstMPEGDescriptor *desc = gst_mpeg_descriptor_parse (data, stream_info_length); if (desc != NULL) { + guint8 *desc_data; if (gst_mpeg_descriptor_find (desc, DESC_DVB_AC3)) { gst_structure_set (stream_info, "has-ac3", G_TYPE_BOOLEAN, TRUE, NULL); } + desc_data = gst_mpeg_descriptor_find (desc, DESC_DVB_DATA_BROADCAST_ID); + if (desc_data) { + guint16 data_broadcast_id; + data_broadcast_id = + DESC_DVB_DATA_BROADCAST_ID_data_broadcast_id (desc_data); + gst_structure_set (stream_info, "data-broadcast-id", G_TYPE_UINT, + data_broadcast_id, NULL); + } + desc_data = gst_mpeg_descriptor_find (desc, DESC_DVB_DATA_BROADCAST); + if (desc_data) { + GstStructure *databroadcast_info; + guint16 data_broadcast_id; + guint8 component_tag; + data_broadcast_id = + DESC_DVB_DATA_BROADCAST_data_broadcast_id (desc_data); + component_tag = DESC_DVB_DATA_BROADCAST_component_tag (desc_data); + databroadcast_info = gst_structure_new ("data-broadcast", "id", + G_TYPE_UINT, data_broadcast_id, "component-tag", component_tag, + NULL); + gst_structure_set (stream_info, "data-broadcast", GST_TYPE_STRUCTURE, + databroadcast_info, NULL); + } + desc_data = + gst_mpeg_descriptor_find (desc, DESC_DVB_CAROUSEL_IDENTIFIER); + if (desc_data) { + guint32 carousel_id; + carousel_id = DESC_DVB_CAROUSEL_IDENTIFIER_carousel_id (desc_data); + gst_structure_set (stream_info, "carousel-id", G_TYPE_UINT, + carousel_id, NULL); + } + desc_data = gst_mpeg_descriptor_find (desc, DESC_DVB_STREAM_IDENTIFIER); + if (desc_data) { + guint8 component_tag; + component_tag = DESC_DVB_STREAM_IDENTIFIER_component_tag (desc_data); + gst_structure_set (stream_info, "component-tag", G_TYPE_UINT, + component_tag, NULL); + } gst_mpeg_descriptor_free (desc); } @@ -1874,9 +1912,6 @@ mpegts_packetizer_remove_stream (MpegTSPacketizer * packetizer, gint16 pid) GST_INFO ("Removing stream for PID %d", pid); g_hash_table_remove (packetizer->streams, GINT_TO_POINTER ((gint) pid)); - - g_object_unref (stream->section_adapter); - g_free (stream); } } diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c index 655cfc50..6b209d0d 100644 --- a/gst/shapewipe/gstshapewipe.c +++ b/gst/shapewipe/gstshapewipe.c @@ -96,7 +96,8 @@ static GstStaticPadTemplate video_sink_pad_template = GST_STATIC_PAD_TEMPLATE ("video_sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") " ; " GST_VIDEO_CAPS_ARGB)); + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") " ; " GST_VIDEO_CAPS_ARGB " ; " + GST_VIDEO_CAPS_BGRA)); static GstStaticPadTemplate mask_sink_pad_template = GST_STATIC_PAD_TEMPLATE ("mask_sink", @@ -113,7 +114,8 @@ static GstStaticPadTemplate mask_sink_pad_template = static GstStaticPadTemplate src_pad_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") " ; " GST_VIDEO_CAPS_ARGB)); + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") " ; " GST_VIDEO_CAPS_ARGB " ; " + GST_VIDEO_CAPS_BGRA)); GST_DEBUG_CATEGORY_STATIC (gst_shape_wipe_debug); #define GST_CAT_DEFAULT gst_shape_wipe_debug @@ -808,9 +810,9 @@ gst_shape_wipe_blend_ayuv_##depth (GstShapeWipe * self, GstBuffer * inbuf, \ CREATE_AYUV_FUNCTIONS (16, 65536.0f); CREATE_AYUV_FUNCTIONS (8, 256.0f); -#define CREATE_ARGB_FUNCTIONS(depth, scale) \ +#define CREATE_ARGB_FUNCTIONS(depth, name, scale, a, r, g, b) \ static GstFlowReturn \ -gst_shape_wipe_blend_argb_##depth (GstShapeWipe * self, GstBuffer * inbuf, \ +gst_shape_wipe_blend_##name##_##depth (GstShapeWipe * self, GstBuffer * inbuf, \ GstBuffer * maskbuf, GstBuffer * outbuf) \ { \ const guint##depth *mask = (const guint##depth *) GST_BUFFER_DATA (maskbuf); \ @@ -838,22 +840,22 @@ gst_shape_wipe_blend_argb_##depth (GstShapeWipe * self, GstBuffer * inbuf, \ gfloat in = *mask / scale; \ \ if (in < low) { \ - output[0] = 0x00; /* A */ \ - output[1] = 0x00; /* R */ \ - output[2] = 0x00; /* G */ \ - output[3] = 0x00; /* B */ \ + output[a] = 0x00; /* A */ \ + output[r] = 0x00; /* R */ \ + output[g] = 0x00; /* G */ \ + output[b] = 0x00; /* B */ \ } else if (in >= high) { \ - output[0] = 0xff; /* A */ \ - output[1] = input[1]; /* R */ \ - output[2] = input[2]; /* G */ \ - output[3] = input[3]; /* B */ \ + output[a] = 0xff; /* A */ \ + output[r] = input[r]; /* R */ \ + output[g] = input[g]; /* G */ \ + output[b] = input[b]; /* B */ \ } else { \ gfloat val = 255.0f * ((in - low) / (high - low)); \ \ - output[0] = CLAMP (val, 0, 255); /* A */ \ - output[1] = input[1]; /* R */ \ - output[2] = input[2]; /* G */ \ - output[3] = input[3]; /* B */ \ + output[a] = CLAMP (val, 0, 255); /* A */ \ + output[r] = input[r]; /* R */ \ + output[g] = input[g]; /* G */ \ + output[b] = input[b]; /* B */ \ } \ \ mask++; \ @@ -866,8 +868,11 @@ gst_shape_wipe_blend_argb_##depth (GstShapeWipe * self, GstBuffer * inbuf, \ return GST_FLOW_OK; \ } -CREATE_ARGB_FUNCTIONS (16, 65536.0f); -CREATE_ARGB_FUNCTIONS (8, 256.0f); +CREATE_ARGB_FUNCTIONS (16, argb, 65536.0f, 0, 1, 2, 3); +CREATE_ARGB_FUNCTIONS (8, argb, 256.0f, 0, 1, 2, 3); + +CREATE_ARGB_FUNCTIONS (16, bgra, 65536.0f, 3, 2, 1, 0); +CREATE_ARGB_FUNCTIONS (8, bgra, 256.0f, 3, 2, 1, 0); static GstFlowReturn gst_shape_wipe_video_sink_chain (GstPad * pad, GstBuffer * buffer) @@ -937,6 +942,10 @@ gst_shape_wipe_video_sink_chain (GstPad * pad, GstBuffer * buffer) ret = gst_shape_wipe_blend_argb_16 (self, buffer, mask, outbuf); else if (self->fmt == GST_VIDEO_FORMAT_ARGB) ret = gst_shape_wipe_blend_argb_8 (self, buffer, mask, outbuf); + else if (self->fmt == GST_VIDEO_FORMAT_BGRA && self->mask_bpp == 16) + ret = gst_shape_wipe_blend_bgra_16 (self, buffer, mask, outbuf); + else if (self->fmt == GST_VIDEO_FORMAT_BGRA) + ret = gst_shape_wipe_blend_bgra_8 (self, buffer, mask, outbuf); else g_assert_not_reached (); |