Sending EOS through element?
killerrats
koreysjunkmail at gmail.com
Mon Oct 2 18:15:43 UTC 2017
///// -------------- PIPELINE ------------- /////////////
- - - - q1 - - - rtph264depay - - - - h264parse - - - - vtee - - - -
- - - - - - - - - - - - -\
/
______
rtspsrc
|Rec(NotABin)| & |Fakesink(NotABin)|
\ - - - - q2 - - - rtpjitterbuffer - - - rtpmp4gdepay - - - aacparse
- - - faad - - - atee - - /
Fakesink(NotABin)
queue5 - - - - - fakesink
queue6 - - - - - fakesink
________
|Rec(NotABin)|
q3- - - - \
avimux - - appsink
q4 - - - -/
above is the pipeline. all elements are in the main pipeline there is no
bins for branches. there is no ghost pads to each queue for rec and
fakesink. request pad from each tee and get sink pad from each queue to the
appropriate element.
figured out that if I put a sleep(300) in the unblocking each tee in the
CheckBlocking method will eventually let the data go through instead of just
unblock immediately. I tried putting the videoblocked = false above and
immediate but still froze so I let the method wait til the variable was
false. But of course i would assign the variable to false after i ran the
checkblocked method. Don't know if this helps anybody.
It seems to work without flaws. ran for 9 hours and works nicely.
GstPadProbeReturn PipelineClass::CheckBlocked (GstPad * pad, GstPadProbeInfo
* info, gpointer user_data)
{
PipelineClass* pipe = (PipelineClass*)user_data;
do{
Sleep(300);
}while(pipe->VideoBlocked);
return GST_PAD_PROBE_REMOVE;
}
unsigned int __stdcall PipelineClass::TheStopVideoThread(void*p_this)
{
PipelineClass* pipe = static_cast<PipelineClass*>(p_this);
// block each pad
// setup call back grabbing eos in appsink sinkpad
// send eos through queue3 and queue4
return 0;
}
GstPadProbeReturn PipelineClass::RtspEventProbe (GstPad * pad,
GstPadProbeInfo * info, gpointer pipelineclass)
{
if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) !=
GST_EVENT_EOS)
{
return GST_PAD_PROBE_PASS;
}
HANDLE handle =
(HANDLE)_beginthreadex(0, 0,
&PipelineClass::TheRelinkVideoRecThread, pipe, 0, 0);
CloseHandle(handle);
return GST_PAD_PROBE_DROP;
}
unsigned int __stdcall PipelineClass::TheRelinkVideoRecThread(void*p_this)
{
// unlink the elements
// setup the elements again
// remove probe by id
// unblock each src pad on the tee's
// set variable videoblock to false to unblock each tee
pipe->VideoBlocked = false;
// put elements into play mode
// setup appsink callback
}
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list