I would like to play a ts file, which has one or two videos.
I created a pipeline, and dynamically linked the elements with demux, whenever a pad arises in callback of demux function.
As shown below.
if(g_str_has_prefix(pad_name, "video"))
{
UU_PRINT("Player :: In dynamic ADDING DL PAD %s DLLinkFlag %d, LinkFlag %d", pad_name, pObjPlayer->mDlLinkFlag, linkFlag);
if(!linkFlag)
{
GstPad *dlsink = gst_element_get_static_pad(pObjPlayer->mpDlQueue, "sink");
}
else
{
GstPad *dlsink = gst_element_get_static_pad(pObjPlayer->mpIrQueue, "sink");
}
if(GST_IS_PAD(DeMuxPad) && GST_IS_PAD(dlsink))
{
if(gst_pad_link(DeMuxPad, dlsink) != GST_PAD_LINK_OK)
{
UU_PRINT( "Player :: Failed to Link Demux with DL Video Queue !!");
}
else
{
linkFlag = 1;
}
}
Initially, i added two videosinks to Pipeline BIN, if the ts file has two videos then it is working fine.
But if the ts file has only one video, then in ximagesink window gets paused. In order to play that ts file, i have to remove another sink element, which is not receiving data should be removed from bin.
And in that case i am not able to receive the END OF THE STREAM MESSAGE.
Why is is happening? Is there any other way to play those two ts files, by using same pipeline, without removing the sink element.??