Bug 53896 - playback does not resume after pausing
Summary: playback does not resume after pausing
Status: NEEDINFO
Alias: None
Product: GStreamer SDK
Classification: Unclassified
Component: Windows SDK Distribution (show other bugs)
Version: 2012.7
Hardware: Other All
: medium normal
Assignee: bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 21:45 UTC by testsdk123
Modified: 2013-02-19 12:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description testsdk123 2012-08-21 21:45:06 UTC
The following elements are linked together

  gst_bin_add_many ( GST_BIN (app->pipeline), app->appsrcVideo, videoFilter,
	  	pOutputSelectGstElement,
		//video_queue,
		viewport[0].queueV, viewport[1].queueV, viewport[2].queueV, viewport[3].queueV, viewport[4].queueV,
		viewport[0].ffmpeg, viewport[1].ffmpeg, viewport[2].ffmpeg, viewport[3].ffmpeg, viewport[4].ffmpeg,
		viewport[0].videoScale, viewport[1].videoScale, viewport[2].videoScale, viewport[3].videoScale, viewport[4].videoScale,
		viewport[0].sink, viewport[1].sink, viewport[2].sink, viewport[3].sink, viewport[4].sink,
		
		app->appsrcAudio, audio_queue, audioFilter, audio_convert, audio_resample, audio_sink, NULL );

   // Linking Video Elements
    if (!gst_element_link_many ( app->appsrcVideo, videoFilter, pOutputSelectGstElement, NULL)) {
    g_print ("linking failed\n");
    return -1;
  }
  
  // 5 additional output selector links
  
  	if (!gst_element_link_many ( viewport[i].queueV, viewport[i].ffmpeg,  viewport[i].videoScale, viewport[i].sink, NULL )) {
			g_print ("linking output 1 failed\n");
			throw -1;
		}

    // Linking Audio Elements

   if (!gst_element_link_many ( app->appsrcAudio, audio_queue, audioFilter, audio_convert, audio_resample, audio_sink,  NULL )) {
    g_print ("linking output 1 failed\n");
    return -1;
  }
  
 The following is used to toggle  between PAUSED and PLAYING
  
  
  static boolean sb = false;
int CGstreamerPlayback::PostMessage()
{
	if ( sb == true ) {
    gst_element_set_state ( app->pipeline, GST_STATE_PAUSED );
		g_print ("State Paused\n" );
	}
	else {
		gst_element_set_state ( app->pipeline, GST_STATE_PLAYING );	
		g_print ("State Playing\n" );
	}
		
	sb = !sb;
		
	return 0;
		
}

It is possible to PAUSE, GST_STATE_PAUSED,  the playback after initially setting GST_STATE_PLAYING and starting the main_loop_thread() BUT when the state is changed back to GST_STATE_PLAYING, there is no AUDIO.

If another state change to GST_STATE_PAUSED followed by a change to GST_STATE_PLAYING  both the video and audio STOP updating.

Data is feed to the pipeline using these routines

	g_signal_connect (s_app.appsrcVideo, "need-data", G_CALLBACK (start_feed), &s_app );
	g_signal_connect ( s_app.appsrcVideo, "enough-data", G_CALLBACK (stop_feed), &s_app );
	
Both routines are not active when PLAYING is resumed. If they are reconnected, play does
not resume. 

I also tried pausing and playing on the sink elements, audio and video .  This does fix the issue either. 

Any ideas would be appreciated?
Comment 1 Sebastian Dröge (slomo) 2013-02-19 12:54:02 UTC
Could you provide a small testcase for this problem? Also from where (which thread) are you changing the state?

This is supposed to work just fine, see tutorial 5 for example:
http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+5%3A+GUI+toolkit+integration


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.