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 706478 - GstAppSrc: new gst_app_src_push_sample() API for appsrc
GstAppSrc: new gst_app_src_push_sample() API for appsrc
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-21 10:40 UTC by Kishore Arepalli
Modified: 2013-08-21 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kishore Arepalli 2013-08-21 10:40:36 UTC
Would be better if both GstAppSrc and GstAppSink operate on GstSample. 

Use case: If a pipeline bridge is created between appsink of a pipeline to appsrc of another pipeline then, always buffer copy has to be made before pushing the buffer to GstAppSrc, because there is no API on appsrc which can accept GstSample of GstSample of the GstAppSink (gst_app_sink_pull_sample API).

There is an overhead of gst_buffer_copy of every buffer in the following code (Present API)
  GstSample *sample = gst_app_sink_pull_sample(appsink);
  gst_app_src_push_buffer(appsrc,
     gst_buffer_copy(gst_sample_get_buffer(sample)));
  gst_sample_unref(sample);
  // push_buffer api takes owner ship of the GstBuffer, so we can't just pass the buffer of the sample instead we have to copy the buffer and push to appsrc

With the proposed API for GstAppSrc (gst_app_src_push_sample())

  GstSample *sample = gst_app_sink_pull_sample(appsink);
  gst_app_src_push_sample(appsrc, sample); // which will take owner ship of the sample
Comment 1 Wim Taymans 2013-08-21 10:50:24 UTC
No need to copy, just ref the buffer, then free the sample, then push the buffer in appsrc.
Comment 2 Kishore Arepalli 2013-08-21 10:58:33 UTC
(In reply to comment #1)
> No need to copy, just ref the buffer, then free the sample, then push the
> buffer in appsrc.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#gst-sample-get-buffer

Here documentation says, The buffer remains valid as long as sample is valid. So , I thought 'ref the buffer' might not help here. If ref does the job then this bug can be closed. Thanks.
Comment 3 Tim-Philipp Müller 2013-08-21 11:23:16 UTC
commit aa1890a4b461f4b1b353f2583977cff74f98159f
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Wed Aug 21 12:21:43 2013 +0100

    docs: flesh out gst_sample_get_buffer() a little
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706478