Stream information in start stream event
rasnaut
rasnaut at gmail.com
Mon May 19 05:18:40 PDT 2014
Hello,
I work with gstreamer-1.11. My programm catch iptv stream and decode it by
decodebin. In some stream I need have possibility select audio stream. I
want using stream ID information, but I don't know, how I can get it. My
function for working with stream events:
void CV_on_pad_added (GstElement *element, GstPad *pad, gpointer data)
{
//g_print("pad added start for chan === %d\n",my_channel->num );
GstCaps *caps;
GstStructure *str;
IPHead* pIpHead = (IPHead*) data;
//GstElement *decoder = (GstElement *) data;
caps = gst_pad_query_caps(pad,NULL);
//caps = gst_pad_get_current_caps(pad);
//g_assert (caps != NULL);
str = gst_caps_get_structure (caps, 0);
//g_assert (str != NULL);
const gchar *c = gst_structure_get_name(str);
g_print("on_pad_added: %s\n",c);
if (g_strrstr (c, "video") || g_strrstr (c, "image"))
{
g_debug ("Linking video pad to dec_vd");
// Link it actually
GstPad *targetsink = gst_element_get_static_pad
(pIpHead->queueV, "sink");
g_assert (targetsink != NULL);
g_print("\nVIDEO--pad source: %s\n", gst_pad_get_name(pad));
g_print("\nVIDEO--pad sink: %s\n",
gst_pad_get_name(targetsink));
gst_pad_link (pad, targetsink);
if (gst_pad_is_linked(pad)) g_print("The video pad src was
linked\n");
g_print("unref here Vid105\n");
gst_object_unref (targetsink);
//pIpHead->skipCnt = 8;
}
if (g_strrstr (c, "audio"))
{
g_debug ("Linking audio pad to dec_ad");
// Link it actually
GstPad *targetsink = gst_element_get_static_pad
(pIpHead->queueA, "sink");
g_assert (targetsink != NULL);
g_print("\nAUDIO--pad source: %s\n", gst_pad_get_name(pad));
g_print("\nAUDIO--pad sink: %s\n",
gst_pad_get_name(targetsink));
if (gst_pad_is_linked(targetsink))
{
g_print("The audio target sink was already linked\n");
}
else
{
gst_pad_link (pad, targetsink);
if (gst_pad_is_linked(pad)) g_print("The audio pad src was
linked\n");
}
gst_object_unref (targetsink);
}
gst_caps_unref (caps);
}
So, what I need add to this, that I can get stream ID (or language) info?
Thank you.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Stream-information-in-start-stream-event-tp4667025.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list