how to release the GstBuffer memory

trinadh Pala me_wavelet at yahoo.co.uk
Tue Jun 25 07:42:41 PDT 2013


Hello,

I am writing an application using QtGstreamer library.

I am implemeting a media player application. i am using Appsource for linking the source. The data is available in a char *buffer.

I created  a buffer using  QGst::Buffer::create(size).
// pBuf has the Transport stream data char *pBuf
// This piece of code is in a loop. 


  QGst::BufferPtr m_buffer;
   m_buffer=QGst::Buffer::create(buf_size);

   quint8 *m_data_ptr=m_buffer->data();

   memcpy(m_data_ptr,pBuf,buf_size);

   if(this->m_player->m_pipeline);

          ret = this->m_player->m_appsrc.pushBuffer(m_buffer);

        if (!m_buffer.isNull())
            {
        if (ret != QGst::FlowOk)
                {
        /* some error, stop sending data */
                qDebug("some error");
                }
            else
                {
                qDebug("pushed a buffer successfully");

                }
            }



The method works, i am able to display the video. However, I did not know how to release the buffer created. so the application leaks memory. How to release the Buffer, after pushBuffer. Please help.

Thanks and regards
Trinadh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130625/54447857/attachment.html>


More information about the gstreamer-devel mailing list