<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Hello List</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
I have a problem with seek.
<div class="ContentPasted0">Occasionally it happens that I have a deadlock when I try to reverse. Happens every 5-20 times.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">I have had this problem for several years now.</div>
<div class="ContentPasted0">It is a mobile app on Android and iOS. So far the problem is only known to occur on Android, but that doesn't mean it can't occur on iOS.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">The structure of my pipeline</div>
<div class="ContentPasted0">httpsoupsrc -> src-queue -> typefind -> demux -> audioqueue -> aacparse -> capsfilter -> appsink</div>
<div class="ContentPasted0">                                                     (so from demux) -> videoqueue -> h264parse -> capsfilter -> appsink</div>
<div><br>
</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">For the implementation of the Seek function I tried different approaches. My current implementation looks like this:</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">static void</div>
<div class="ContentPasted0">seek_to_time(CustomData *customData,</div>
<div class="ContentPasted0">             gint64 seekToPos)</div>
<div class="ContentPasted0">{</div>
<div class="ContentPasted0">    if (!GST_CLOCK_TIME_IS_VALID (customData->duration)) {</div>
<div class="ContentPasted0">        LOGW ("Seek failed! Invalid duration\n");</div>
<div class="ContentPasted0">    }</div>
<div class="ContentPasted0">    LOGI ("seek_to_time to %" G_GINT64_FORMAT "\n", seekToPos);</div>
<div class="ContentPasted0">    if(!gst_element_seek_simple(customData->pipeline, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),seekToPos))</div>
<div class="ContentPasted0">    {</div>
<div class="ContentPasted0">        LOGW ("Seek failed!\n");</div>
<div class="ContentPasted0">    }</div>
<div class="ContentPasted0">    g_usleep(500); // just to test, no change with or without<br>
</div>
<div class="ContentPasted0">    LOGI ("seek_to_time to %" G_GINT64_FORMAT " done\n", seekToPos);</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">    GstState current, pending;</div>
<div class="ContentPasted0">    GstStateChangeReturn stateChange = gst_element_get_state(customData->pipeline, &current, &pending, 0*GST_SECOND);</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">    gst_element_set_state (GST_ELEMENT (customData->pipeline), GST_STATE_PLAYING);</div>
<div class="ContentPasted0">}</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">With the debugger I can see that it hangs at gst_element_get_state.</div>
<div class="ContentPasted0">There it never comes back. I also did it with a timeout it didn't change anything unfortunately.</div>
<div><br class="ContentPasted0">
</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">When I look into the logfile, I see that I often get the following log output:</div>
<div class="ContentPasted0">16:49:22.216 W ../gst/gstpad.c:4677:gst_pad_push_data:<ts-demuxer:audio_0_04da> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.216 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<AACqueue1:sink> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.216 W ../gst/gstpad.c:4677:gst_pad_push_data:<AACqueue1:src> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.216 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<AACparse1:sink> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.258 W ../gst/gstpad.c:4677:gst_pad_push_data:<ts-demuxer:video_0_04d9> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.258 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<H264queue0:sink> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.258 W ../gst/gstpad.c:4677:gst_pad_push_data:<H264queue0:src> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.258 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<H264parse0:sink> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.261 W ../gst/gstpad.c:4677:gst_pad_push_data:<H264parse0:src> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.261 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<H264capsfilter0:sink> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.261 W ../gst/gstpad.c:4677:gst_pad_push_data:<H264capsfilter0:src> Got data flow before segment event</div>
<div class="ContentPasted0">16:49:22.261 W ../gst/gstpad.c:4416:gst_pad_chain_data_unchecked:<H264appsink0:sink> Got data flow before segment event</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0 elementToProof">This one worries me, but it also sometimes occurs when there is no deadlock.</div>
<div class="ContentPasted0">Could the "Got data flow before segment event" problem have something to do with the hang?</div>
<div class="ContentPasted0">I just can't figure out the problem.</div>
<div class="ContentPasted0">Does anyone have any ideas what I can investigate further?</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Regards</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Patrick<br>
</div>
<div dir="ltr" style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;font-size:1px;direction:ltr;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:1px;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="background-color:#FFFFFF;padding:11px 0 0;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="center" style="padding:0 10px 0 0;border-top:none;border-right:solid 2px #19368B;border-bottom:none;border-left:none;vertical-align:middle;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="center" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="center" style="padding:0 0 25px;vertical-align:top;"><a href="https://www.vitec.com/" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="https://www.vitec.com/fileadmin/_permanent/signature/VITEC_RGB_logo@160px.jpg" border="0" alt="" style="font-size:0;" /></a></td></tr></table></td></tr><tr style="font-size:0;"><td align="center" style="vertical-align:bottom;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="vertical-align:bottom;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:4px;vertical-align:bottom;"><a href="https://www.linkedin.com/company/vitec-multimedia" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="https://www.vitec.com/fileadmin/_permanent/signature/icons/Linkedin-v3_40.png" border="0" alt="" style="font-size:0;" /></a></td></tr></table></td><td align="left" style="vertical-align:bottom;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:4px;vertical-align:bottom;"><a href="https://www.youtube.com/vitecmm" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="https://www.vitec.com/fileadmin/_permanent/signature/icons/Youtube-v3_40.png" border="0" alt="" style="font-size:0;" /></a></td></tr></table></td><td align="left" style="vertical-align:bottom;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:4px;vertical-align:bottom;"><a href="https://www.twitter.com/vitec_mm" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="https://www.vitec.com/fileadmin/_permanent/signature/icons/Twitter-v3_40.png" border="0" alt="" style="font-size:0;" /></a></td></tr></table></td></tr></table></td></tr></table></td><td align="left" style="padding:0 10px;vertical-align:middle;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:0;"><tr style="font-size:18.67px;color:#26358C;font-style:normal;font-weight:700;white-space:nowrap;"><td align="left" style="vertical-align:top;font-family:Calibri,Arial,sans-serif;">Patrick Fischer</td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;color:#000001;font-style:normal;font-weight:400;white-space:nowrap;"><tr style="font-size:14.67px;"><td align="left" style="vertical-align:top;font-family:Calibri,Arial,sans-serif;">Software Developer</td></tr></table></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:14.67px;color:#000001;font-style:normal;font-weight:400;white-space:nowrap;"><td align="left" style="padding:0;vertical-align:top;font-family:Calibri,Arial,sans-serif;">o: <br /></td><td align="left" style="padding:0;vertical-align:top;font-family:Calibri,Arial,sans-serif;"><a href="tel:+49%204307%208358%200" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#000001;"><strong style="font-weight:400;">+49 4307 8358 0</strong></a></td></tr><tr style="font-size:0;"><td align="left" style="padding:0;vertical-align:top;"></td><td align="left" style="padding:0;vertical-align:top;"></td></tr><tr style="font-size:0;"><td align="left" style="padding:0;vertical-align:top;"></td><td align="left" style="padding:0;vertical-align:top;"></td></tr></table></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;color:#1F419A;font-style:normal;font-weight:400;white-space:nowrap;"><tr style="font-size:14.67px;"><td align="left" style="vertical-align:top;font-family:Calibri,Arial,sans-serif;"><a href="mailto:patrick.fischer@vitec.com" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#1F419A;"><strong style="font-weight:400;">patrick.fischer@vitec.com</strong></a></td></tr></table></td></tr><tr style="font-size:14.67px;color:#26358C;font-style:normal;font-weight:400;white-space:nowrap;"><td align="left" style="vertical-align:top;font-family:Calibri,Arial,sans-serif;"><a href="https://www.vitec.com/" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#26358C;"><strong style="font-weight:400;">www.vitec.com</strong></a></td></tr></table></td></tr></table></td></tr></table></td></tr></table></div><div dir="ltr" style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;font-size:1px;direction:ltr;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:1px;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:10px 0;vertical-align:top;"><a href="https://www.vitec.com/" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image653352.png@816CC5C5.B29FA6A1" border="0" title="www.vitec.com" alt="www.vitec.com" style="font-size:12px;" /></a></td></tr></table></td></tr></table></div><div dir="ltr" style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;font-size:1px;direction:ltr;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:1px;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="white-space:normal;color:#767171;font-size:14.67px;font-family:Calibri,Arial,sans-serif;font-weight:400;font-style:normal;text-align:justify;width:100%;"><tr style="font-size:9px;"><td style="font-family:Calibri,sans-serif;">Legal Notice<span style="font-family:remialcxesans;font-size:1px;color:#FFFFFF;line-height:1px;">​</span><br /> Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this e-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this e-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. Neither VITEC S.A. (66 Avenue des Champs Elysées – 75008 Paris - France) nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. VITEC GmbH, Lise-Meitner-Str. 15, 24223 Schwentinental<br /> Geschäftsführer/Managing Director: Philippe Wetzel<br /> HRB Plön 1584 / Steuernummer: 2029706365 / VATnumber: DE134878603</td></tr></table></td></tr></table></div></body>
</html>