How come the tee in pipeline blocks after I just unblocked the tee?

killerrats koreysjunkmail at gmail.com
Fri Oct 28 22:15:06 UTC 2016


///// -------------- PIPELINE ------------- /////////////                            
/ - -  q3 
                 - - - - q1 - - - rtph264depay - - - - h264parse - - - -
vtee - - \ 
               /                                                                                             
- - q5   
source --                                                                                                        
- - q4 
               \ - - - - q2 - - - rtpmp4gdepay - - - aacparse - - - faad - -
- atee - -/ 
                                                                                                                    
\ - - q6 
FakeSinkBin: 
q5 - - fakesink       q6  - - fakesink2 

Record bin: 
q4 - - \ 
               avimux - - appsink 
q3- - - / 

The Methods Using:

_videoD->BlockVideoPad is vtee
_videoD->BlockAudioPad is atee

I call StopRecordPipeline function then goes through each method below that.
I can't figure out is there something in the methods calling the probes I
need to do?

void PipelineClass::StopRecordPipeline(gpointer user_data)
{
	GstPad* sinkpad;
	
		std::cout << "Checked video and audio pad" << std::endl;
		//Block Audio Pad
		std::cout << std::endl << "Blocking Audio" << std::endl;
		_videoD->aID = gst_pad_add_probe (_videoD->BlockAudioPad,
GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM
			,RtspBlock1, user_data, NULL);
		std::cout << "ID: " << _videoD->aID << std::endl;	
}

GstPadProbeReturn PipelineClass::RtspBlock1 (GstPad * pad, GstPadProbeInfo *
info, gpointer user_data)
{
	

	GstPad* srcpad;
	GST_DEBUG_OBJECT (pad, "pad is blocked now");
	g_print("\nBlocked Now\n");
	/* remove the probe first */
	//gst_pad_remove_probe (pad, GST_PAD_PROBE_INFO_ID (info));
	
	_videoD->vID = gst_pad_add_probe(_videoD->BlockVideoPad,
GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
		RtspBlock2, user_data, NULL);
	std::cout << "ID: " << _videoD->vID << std::endl;
	
	return GST_PAD_PROBE_OK;
}

GstPadProbeReturn PipelineClass::RtspBlock2 (GstPad * pad, GstPadProbeInfo *
info, gpointer user_data)
{
	GstPad* sinkpad;

	GST_DEBUG_OBJECT (pad, "pad is blocked now");
	g_print("\nBlocked Now\n");
	/* remove the probe first */
	//gst_pad_remove_probe (pad, GST_PAD_PROBE_INFO_ID (info));

   //install new probe for EOS 
	sinkpad = gst_element_get_static_pad (_videoD->appsink, "sink");
	_videoD->eosID = gst_pad_add_probe (sinkpad,
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, RtspEventProbe, user_data, NULL);
  gst_object_unref (sinkpad);

  // push EOS into the element, the probe will be fired when the
   // EOS leaves the effect and it has thus drained all of its data
  gst_element_send_event(_videoD->Rec,gst_event_new_eos());

  return GST_PAD_PROBE_OK;
}

GstPadProbeReturn PipelineClass::RtspEventProbe (GstPad * pad,
GstPadProbeInfo * info, gpointer user_data)
{

	if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) != GST_EVENT_EOS)
	return GST_PAD_PROBE_PASS;

	if(!_videoD->isBlocked)
		return GST_PAD_PROBE_REMOVE;

	GstElement* valve1,* valve2;
	gst_pad_remove_probe (pad, GST_PAD_PROBE_INFO_ID (info));

	std::cout << std::endl << "Got Eos and Restarting Recording" << std::endl;

	ClosingFile(_gstVideoStruct);
	
	ResetGstVideoStruct(_gstVideoStruct);
	
	*AccessToVideoClass->UnlinkRecPipeline();*
	
	std::cout << "\nSetting up appsink signals\n";
	g_signal_connect(_videoD->appsink, "new-sample",
G_CALLBACK(appsink_ToFile),_videoD);
	g_signal_connect(_videoD->appsink, "eos",
G_CALLBACK(check_for_eos),_videoD);
	
	

	return GST_PAD_PROBE_DROP;
	  
}

void VideoRecClass::UnlinkRecPipeline()
{ 
       // remove on two pads and release on the vtee and atee.
       // Each element in the Rec bin to null and remove from pipeline
       ......

        SetupRtspRecPipeline();

	gst_pad_remove_probe(_videoData->BlockAudioPad,_videoData->aID);
	gst_pad_remove_probe(_videoData->BlockVideoPad,_videoData->vID);

	LinkRtspRecPipeline();
	
	_videoData->aID = 0;
	_videoData->vID = 0;

       ......
}



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-come-the-tee-in-pipeline-blocks-after-I-just-unblocked-the-tee-tp4680317.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list