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 681327 - [0.11] getters accessors for buffer pool and memory allocator for base classes
[0.11] getters accessors for buffer pool and memory allocator for base classes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-06 18:22 UTC by Víctor Manuel Jáquez Leal
Modified: 2012-09-24 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
getter accessors for buffer pool and allocator in video decoder (2.29 KB, patch)
2012-08-06 18:23 UTC, Víctor Manuel Jáquez Leal
needs-work Details | Review
getter accessor for buffer pool and allocator in basesr (2.03 KB, patch)
2012-08-07 16:20 UTC, Víctor Manuel Jáquez Leal
needs-work Details | Review
getter accessor for buffer pool and allocator in base transform (2.42 KB, patch)
2012-08-07 16:26 UTC, Víctor Manuel Jáquez Leal
needs-work Details | Review
getter accessor for allocator in audio decoder (1.80 KB, patch)
2012-08-07 16:27 UTC, Víctor Manuel Jáquez Leal
needs-work Details | Review
getter accessors for buffer pool and allocator in video decoder (2.98 KB, patch)
2012-08-10 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in video encoder (2.48 KB, patch)
2012-08-10 13:29 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in audio encoder (2.39 KB, patch)
2012-08-10 13:30 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in audio decoder (2.41 KB, patch)
2012-08-10 13:31 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in basesrc (2.74 KB, patch)
2012-08-10 13:32 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in base transform (3.14 KB, patch)
2012-08-10 13:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in base transform (3.09 KB, patch)
2012-08-13 10:48 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in basesrc (2.69 KB, patch)
2012-08-13 10:49 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in audio decoder (2.36 KB, patch)
2012-08-13 10:50 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in audio encoder (2.34 KB, patch)
2012-08-13 10:51 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in video encoder (2.43 KB, patch)
2012-08-13 10:52 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessors for buffer pool and allocator in video decoder (2.93 KB, patch)
2012-08-13 10:52 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessors for buffer pool and allocator in video decoder (2.98 KB, patch)
2012-08-14 09:38 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for allocator in video encoder (2.48 KB, patch)
2012-08-14 09:38 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
getter accessor for allocator in audio encoder (2.39 KB, patch)
2012-08-14 09:39 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
getter accessor for allocator in audio decoder (2.41 KB, patch)
2012-08-14 09:39 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
getter accessor for buffer pool and allocator in basesrc (2.73 KB, patch)
2012-08-14 09:40 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in base transform (3.13 KB, patch)
2012-08-14 09:40 UTC, Víctor Manuel Jáquez Leal
none Details | Review
getter accessor for buffer pool and allocator in basesrc (2.74 KB, patch)
2012-08-14 13:11 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
getter accessor for buffer pool and allocator in base transform (3.15 KB, patch)
2012-08-14 13:12 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
getter accessors for buffer pool and allocator in video decoder (2.99 KB, patch)
2012-08-14 13:13 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2012-08-06 18:22:42 UTC
Sometimes the decoder would need to use the pool or the allocator for
something else than just allocating output buffers. For example, the querying
for different parameters, such as asking for a bigger number of buffers to
allocate in the pool.

I think it would be nice to have these two getter accessors, either for the buffer pool and the allocator.
Comment 1 Víctor Manuel Jáquez Leal 2012-08-06 18:23:42 UTC
Created attachment 220483 [details] [review]
getter accessors for buffer pool and allocator in video decoder

This patch expose a two getters accessors: one for the buffer pool and the
other for the memory allocator.
Comment 2 Sebastian Dröge (slomo) 2012-08-07 08:52:43 UTC
Review of attachment 220483 [details] [review]:

Good idea in general, but for consistency the same should be done for the video encoder base class, the audio decoder/encoder base classes, basetransform, basesrc, basesink too. Could you prepare the same patches for them too? :)

::: gst-libs/gst/video/gstvideodecoder.c
@@ +3075,3 @@
+  g_return_val_if_fail (GST_IS_VIDEO_DECODER (decoder), NULL);
+
+  return decoder->priv->pool;

This should return a new reference to the pool

@@ +3089,3 @@
+  g_return_val_if_fail (GST_IS_VIDEO_DECODER (decoder), NULL);
+
+  return decoder->priv->allocator;

This should return a new reference to the allocator and the allocation parameters, e.g.

void gst_video_decoder_get_allocator (GstVideoDecoder * decoder, GstAllocator ** allocator, GstAllocationParams * params)
Comment 3 Víctor Manuel Jáquez Leal 2012-08-07 09:08:09 UTC
(In reply to comment #2)
> Review of attachment 220483 [details] [review]:
> 
> Good idea in general, but for consistency the same should be done for the video
> encoder base class, the audio decoder/encoder base classes, basetransform,
> basesrc, basesink too. Could you prepare the same patches for them too? :)

Sure! Let me grab some coffee and I'll cook those patches...
Comment 4 Víctor Manuel Jáquez Leal 2012-08-07 16:20:28 UTC
Created attachment 220581 [details] [review]
getter accessor for buffer pool and allocator in basesr
Comment 5 Sebastian Dröge (slomo) 2012-08-07 16:25:31 UTC
Review of attachment 220581 [details] [review]:

::: libs/gst/base/gstbasesrc.c
@@ +3632,3 @@
+  g_return_val_if_fail (GST_IS_BASE_SRC (src), NULL);
+
+  return src->priv->pool;

You need to return a new reference to the pool here

@@ +3646,3 @@
+  g_return_val_if_fail (GST_IS_BASE_SRC (src), NULL);
+
+  return src->priv->allocator;

You need to return a new reference to the allocator here. And also the GstAllocationParams, i.e.
gst_base_src_get_allocator (GstBaseSrc *src, GstAllocator **allocator, GstAllocationParams *params)
Comment 6 Víctor Manuel Jáquez Leal 2012-08-07 16:26:22 UTC
Created attachment 220582 [details] [review]
getter accessor for buffer pool and allocator in base transform
Comment 7 Víctor Manuel Jáquez Leal 2012-08-07 16:27:49 UTC
Created attachment 220583 [details] [review]
getter accessor for allocator in audio decoder
Comment 8 Víctor Manuel Jáquez Leal 2012-08-07 16:29:14 UTC
(In reply to comment #5)
> Review of attachment 220581 [details] [review]:
> 
> ::: libs/gst/base/gstbasesrc.c
> @@ +3632,3 @@
> +  g_return_val_if_fail (GST_IS_BASE_SRC (src), NULL);
> +
> +  return src->priv->pool;
> 
> You need to return a new reference to the pool here
> 
> @@ +3646,3 @@
> +  g_return_val_if_fail (GST_IS_BASE_SRC (src), NULL);
> +
> +  return src->priv->allocator;
> 
> You need to return a new reference to the allocator here. And also the
> GstAllocationParams, i.e.
> gst_base_src_get_allocator (GstBaseSrc *src, GstAllocator **allocator,
> GstAllocationParams *params)

mmmhh... 

That would be needed in all of my patches then...
Comment 9 Sebastian Dröge (slomo) 2012-08-08 08:45:40 UTC
Sorry for that :( That's why I mentioned it in comment #2 already
Comment 10 Víctor Manuel Jáquez Leal 2012-08-08 09:52:28 UTC
(In reply to comment #9)
> Sorry for that :( That's why I mentioned it in comment #2 already

Sorry!! I didn't see it!!! My mistake... This afternoon I'll work on this..

Thanks!
Comment 11 Víctor Manuel Jáquez Leal 2012-08-09 17:30:54 UTC
Please, be patient with these patches: my testing work bench went bananas and I'm rebuilding it from scratch :)
Comment 12 Víctor Manuel Jáquez Leal 2012-08-10 13:28:09 UTC
Created attachment 220875 [details] [review]
getter accessors for buffer pool and allocator in video decoder
Comment 13 Víctor Manuel Jáquez Leal 2012-08-10 13:29:22 UTC
Created attachment 220876 [details] [review]
getter accessor for allocator in video encoder
Comment 14 Víctor Manuel Jáquez Leal 2012-08-10 13:30:19 UTC
Created attachment 220878 [details] [review]
getter accessor for allocator in audio encoder
Comment 15 Víctor Manuel Jáquez Leal 2012-08-10 13:31:36 UTC
Created attachment 220880 [details] [review]
getter accessor for allocator in audio decoder
Comment 16 Víctor Manuel Jáquez Leal 2012-08-10 13:32:33 UTC
Created attachment 220881 [details] [review]
getter accessor for buffer pool and allocator in basesrc
Comment 17 Víctor Manuel Jáquez Leal 2012-08-10 13:34:13 UTC
Created attachment 220882 [details] [review]
getter accessor for buffer pool and allocator in base transform
Comment 18 Víctor Manuel Jáquez Leal 2012-08-13 10:48:37 UTC
Created attachment 221002 [details] [review]
getter accessor for buffer pool and allocator in base transform

if param is NULL there's no need to initialize it
Comment 19 Víctor Manuel Jáquez Leal 2012-08-13 10:49:45 UTC
Created attachment 221003 [details] [review]
getter accessor for buffer pool and allocator in basesrc

if param is NULL, don't initialize it
Comment 20 Víctor Manuel Jáquez Leal 2012-08-13 10:50:49 UTC
Created attachment 221004 [details] [review]
getter accessor for allocator in audio decoder

if param is null, don't initialize it
Comment 21 Víctor Manuel Jáquez Leal 2012-08-13 10:51:34 UTC
Created attachment 221006 [details] [review]
getter accessor for allocator in audio encoder

if param is null don't initialize it
Comment 22 Víctor Manuel Jáquez Leal 2012-08-13 10:52:16 UTC
Created attachment 221007 [details] [review]
getter accessor for allocator in video encoder

if param is null, don't initialize it
Comment 23 Víctor Manuel Jáquez Leal 2012-08-13 10:52:48 UTC
Created attachment 221008 [details] [review]
getter accessors for buffer pool and allocator in video decoder

if param is null don't init it
Comment 24 Víctor Manuel Jáquez Leal 2012-08-14 09:38:17 UTC
Created attachment 221110 [details] [review]
getter accessors for buffer pool and allocator in video decoder
Comment 25 Víctor Manuel Jáquez Leal 2012-08-14 09:38:50 UTC
Created attachment 221111 [details] [review]
getter accessor for allocator in video encoder
Comment 26 Víctor Manuel Jáquez Leal 2012-08-14 09:39:20 UTC
Created attachment 221113 [details] [review]
getter accessor for allocator in audio encoder
Comment 27 Víctor Manuel Jáquez Leal 2012-08-14 09:39:58 UTC
Created attachment 221114 [details] [review]
getter accessor for allocator in audio decoder
Comment 28 Víctor Manuel Jáquez Leal 2012-08-14 09:40:27 UTC
Created attachment 221115 [details] [review]
getter accessor for buffer pool and allocator in basesrc
Comment 29 Víctor Manuel Jáquez Leal 2012-08-14 09:40:54 UTC
Created attachment 221116 [details] [review]
getter accessor for buffer pool and allocator in base transform
Comment 30 Sebastian Dröge (slomo) 2012-08-14 10:12:39 UTC
Looks good, except that it should be _get_buffer_pool() instead of _get_pool(). Do you want to change it? Otherwise I'll do it before pushing the patches.
Comment 31 Víctor Manuel Jáquez Leal 2012-08-14 12:58:29 UTC
I can do it right now :)
Comment 32 Víctor Manuel Jáquez Leal 2012-08-14 13:11:31 UTC
Created attachment 221134 [details] [review]
getter accessor for buffer pool and allocator in basesrc

renamed _get_pool() to _get_buffer_pool()
Comment 33 Víctor Manuel Jáquez Leal 2012-08-14 13:12:36 UTC
Created attachment 221135 [details] [review]
getter accessor for buffer pool and allocator in base transform

renamed _get_pool() to _get_buffer_pool()
Comment 34 Víctor Manuel Jáquez Leal 2012-08-14 13:13:28 UTC
Created attachment 221136 [details] [review]
getter accessors for buffer pool and allocator in video decoder

renamed _get_pool() to _get_buffer_pool()
Comment 35 Víctor Manuel Jáquez Leal 2012-08-14 13:14:26 UTC
(In reply to comment #30)
> Looks good, except that it should be _get_buffer_pool() instead of _get_pool().
> Do you want to change it? Otherwise I'll do it before pushing the patches.

Updated!