mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gst: implement renegotiation
If the stream format changes, set the basesrc caps again before pushing a new buffer. See #3147
This commit is contained in:
		
							parent
							
								
									b84083a1bb
								
							
						
					
					
						commit
						0962555291
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
					@ -1134,6 +1134,7 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
 | 
				
			||||||
  const char *error = NULL;
 | 
					  const char *error = NULL;
 | 
				
			||||||
  GstBuffer *buf;
 | 
					  GstBuffer *buf;
 | 
				
			||||||
  gboolean update_time = FALSE, timeout = FALSE;
 | 
					  gboolean update_time = FALSE, timeout = FALSE;
 | 
				
			||||||
 | 
					  GstCaps *caps = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pwsrc = GST_PIPEWIRE_SRC (psrc);
 | 
					  pwsrc = GST_PIPEWIRE_SRC (psrc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1157,6 +1158,18 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
 | 
				
			||||||
    if (state != PW_STREAM_STATE_STREAMING)
 | 
					    if (state != PW_STREAM_STATE_STREAMING)
 | 
				
			||||||
      goto streaming_stopped;
 | 
					      goto streaming_stopped;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ((caps = pwsrc->caps) != NULL) {
 | 
				
			||||||
 | 
					      pwsrc->caps = NULL;
 | 
				
			||||||
 | 
					      pw_thread_loop_unlock (pwsrc->core->loop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      GST_DEBUG_OBJECT (pwsrc, "set format %" GST_PTR_FORMAT, caps);
 | 
				
			||||||
 | 
					      gst_base_src_set_caps (GST_BASE_SRC (pwsrc), caps);
 | 
				
			||||||
 | 
					      gst_caps_unref (caps);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      pw_thread_loop_lock (pwsrc->core->loop);
 | 
				
			||||||
 | 
					      continue;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pwsrc->eos) {
 | 
					    if (pwsrc->eos) {
 | 
				
			||||||
      if (pwsrc->last_buffer == NULL)
 | 
					      if (pwsrc->last_buffer == NULL)
 | 
				
			||||||
        goto streaming_eos;
 | 
					        goto streaming_eos;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue