[Bug 788025] vaapih264enc leaks 1-4 frames of memory

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Sep 25 02:51:11 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=788025

--- Comment #8 from Harvey <hchapman-gnomebugzilla at 3gfp.com> ---
(In reply to Hyunjun Ko from comment #7)
> (In reply to Harvey from comment #6)
> > (In reply to Víctor Manuel Jáquez Leal from comment #5)
> > > (In reply to Harvey from comment #4)
> > > > 5. The leak is not a true "leak". If I stop the entire pipeline, all of the
> > > > "leaked" memory is released.
> > > 
> > > Thus I'm setting it as an enhancement request.
> > 
> > The weird thing is that after we stop encoding, we turn off the valve,
> > remove the encoding bin from the pipeline, and unref it. But the memory
> > remains allocated.
> 
> Okay. 
> So, "stop the entire pipeline" means call of gst_element_set_state
> (pipeline, GST_STATE_NULL), doesn't it? And all of the leaked memory is
> released after this call.

Yes, setting state of the entire pipeline to NULL releases all of the leaked
memory.

> If then in "Every time we start and stop a recording (encoding of captured
> video), we lose 1-4 frames of memory" What does "start and stop a recording"
> mean?

- Start of app
    - create pipeline: v4l2src -> caps -> valve (drop = true)
    - start recording:
        - create encoder bin: 
             bin[queue, videorate, videoconvert, vaapih264enc, mp4mux, fdsink ]
             - set videorate: skip-to-first=true
             - set queue:
                 max-size-buffers = 10
                 max-size-bytes = 4k*1.5*10
                 max-size-time = 0
                 leaky = GST_QUEUE_LEAK_UPSTREAM
        - add encoder bin to pipeline
        - link valve to encoder bin
        - gst_element_sync_state_to_parent(encoder bin)
        - set valve: drop = false
        - wait for fdsink to receive data
    - stop recording:
        - set valve: drop = true
        - gst_element_send_event(encoder bin, gst_event_new_eos())
        - wait for fdsink to receive EOS
        - gst_element_set_state(encoder bin, GST_STATE_NULL)
        - unlink valve from encoder bin
        - remove encoder bin from pipeline
        - unref encoder bin

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list