mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
audioencoder: getter for allocator
Sometimes the encoder would use the allocator for something else than just allocating output buffers, for example, querying different parameters. This patch expose a getter accessor for the negotiated memory allocator.
This commit is contained in:
parent
c02dcda885
commit
936ec3eb8f
2 changed files with 31 additions and 0 deletions
|
@ -2693,3 +2693,30 @@ done:
|
|||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_audio_encoder_get_allocator:
|
||||
* @enc: a #GstAudioEncoder
|
||||
* @allocator: (out) (allow-none) (transfer full): the #GstAllocator
|
||||
* used
|
||||
* @params: (out) (allow-none) (transfer full): the
|
||||
* #GstAllocatorParams of @allocator
|
||||
*
|
||||
* Lets #GstAudioEncoder sub-classes to know the memory @allocator
|
||||
* used by the base class and its @params.
|
||||
*
|
||||
* Unref the @allocator after use it.
|
||||
*/
|
||||
void
|
||||
gst_audio_encoder_get_allocator (GstAudioEncoder * enc,
|
||||
GstAllocator ** allocator, GstAllocationParams * params)
|
||||
{
|
||||
g_return_if_fail (GST_IS_AUDIO_ENCODER (enc));
|
||||
|
||||
if (allocator)
|
||||
*allocator = enc->priv->ctx.allocator ?
|
||||
gst_object_ref (enc->priv->ctx.allocator) : NULL;
|
||||
|
||||
if (params)
|
||||
*params = enc->priv->ctx.params;
|
||||
}
|
||||
|
|
|
@ -293,6 +293,10 @@ void gst_audio_encoder_set_drainable (GstAudioEncoder * enc,
|
|||
|
||||
gboolean gst_audio_encoder_get_drainable (GstAudioEncoder * enc);
|
||||
|
||||
void gst_audio_encoder_get_allocator (GstAudioEncoder * enc,
|
||||
GstAllocator ** allocator,
|
||||
GstAllocationParams * params);
|
||||
|
||||
void gst_audio_encoder_merge_tags (GstAudioEncoder * enc,
|
||||
const GstTagList * tags, GstTagMergeMode mode);
|
||||
|
||||
|
|
Loading…
Reference in a new issue