After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739334 - GstGLVideoMixer input caps can not be dynamically changed
GstGLVideoMixer input caps can not be dynamically changed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-29 07:24 UTC by comicfans44
Modified: 2014-11-11 03:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description comicfans44 2014-10-29 07:24:31 UTC
construct pipeline as videotestsrc ! capsfilter ! glvideomixer ! glimagesink
then changing capsfilter width or height , trigger 

 basesrc ../../../../libs/gst/base/gstbasesrc.c:2932:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:01.122883120 15610  0x9d3e290 WARN                 basesrc ../../../../libs/gst/base/gstbasesrc.c:2932:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason not-negotiated (-4)



trace shows that when changing caps, 
GST_QUERY_CAPS
--->gl_mixer_sink_query 
---> gst_videoaggregator_sink_query 
--->gst_videoaggregator_pad_sink_getcaps (line 731)
the srccaps previously decided has GST_CAPS_FEATURE_MEMORY_GL_MEMORY 
but the filter passed in (new caps) has GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY
leads result empty


before commit f0caf04a
videoaggregator: operate on caps rather than video info
srccaps in gst_videoaggregator_pad_sink_getcaps also has GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY (maybe incorrectly)
Comment 1 Matthew Waters (ystreet00) 2014-10-29 09:51:41 UTC
Isn't this fixed by
9ac74f62267e65c58a11e7f923b9659bc9f67c49
glmixer: override the caps query in order to 'convert' capsfeatures ?

If not, a simple test program would be helpful :)
Comment 2 comicfans44 2014-10-30 01:39:56 UTC
(In reply to comment #1)
> Isn't this fixed by
> 9ac74f62267e65c58a11e7f923b9659bc9f67c49
> glmixer: override the caps query in order to 'convert' capsfeatures ?

sorry ,the version I trace didn't include this commit . but the problem still exists. 

seems gst_gl_mixer_pad_sink_getcaps use gst_pad_get_current_caps  to do 
intersection, after first negotiation, this is a fixate caps 
as  

"video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive"

but caps query passed a new filter with different height, leads empty result.



> 
> If not, a simple test program would be helpful :)


#include <gst/gst.h>


int height=240;

GstElement *capsfilter;
static gboolean
timeout_cb (gpointer user_data)
{

    height+=20;

  GstCaps *newCaps=gst_caps_new_simple("video/x-raw",
          "width",G_TYPE_INT,320,
          "height",G_TYPE_INT,height,NULL);

  g_object_set(G_OBJECT(capsfilter),"caps",newCaps,NULL);

  return TRUE;
}
    
int main(int argc, char *argv[])
{

    gst_init(NULL,NULL);

    GstElement* pipeline=gst_parse_launch("videotestsrc ! capsfilter name=capsfilter ! glvideomixer ! glimagesink ",NULL);

    capsfilter=gst_bin_get_by_name(GST_BIN(pipeline),"capsfilter");

    GMainLoop *loop=g_main_loop_new(NULL,FALSE);

    g_timeout_add(1000, timeout_cb, NULL);

    gst_element_set_state(pipeline,GST_STATE_PLAYING);

    g_main_loop_run(loop);

}

for compare, pipeline as
videotestsrc ! capsfilter ! glfilterblur ! glimagesink
videotestsrc ! capsfilter ! glimagesink 
are working as expected .
Comment 3 Matthew Waters (ystreet00) 2014-10-31 03:37:39 UTC
commit 76dfda2bcf4fe9917402b6c42ab968802bc55c5e
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Oct 31 12:52:07 2014 +1100

    glmixer: advertise support for changing input caps mid-stream
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739334
Comment 4 comicfans44 2014-11-03 02:29:35 UTC
(In reply to comment #3)
> commit 76dfda2bcf4fe9917402b6c42ab968802bc55c5e
> Author: Matthew Waters <matthew@centricular.com>
> Date:   Fri Oct 31 12:52:07 2014 +1100
> 
>     glmixer: advertise support for changing input caps mid-stream
> 
>     https://bugzilla.gnome.org/show_bug.cgi?id=739334

this fix the problem when upstream's caps is system memory based ,
but when upstream is gl element, this leads negotiated result caps 
fallback to system memory. 

gst_gl_mixer_update_caps didn't remove width/height from 
current used srccaps's GLMemory caps (but makes System Memory part accept any width/height), so new width/height GLMemory caps not work, but fallback 
to SystemMemory
Comment 5 Matthew Waters (ystreet00) 2014-11-11 03:25:14 UTC
commit 36ade75f4a618d66163ba71035048447fe2871de
Author: Matthew Waters <matthew@centricular.com>
Date:   Tue Nov 11 14:23:55 2014 +1100

    gl: remove the width/height fields from the caps to support frame resizing
    
    It was previously only occuring with sysmem caps features
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739334