mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
faac: Add bitrate info to the tags output.
Makes it possible for muxers to know the target bitrate as soon as encoding starts, which flvmux now uses.
This commit is contained in:
parent
cf786a9399
commit
779ad060a4
1 changed files with 18 additions and 0 deletions
|
@ -341,6 +341,22 @@ gst_faac_enc_generate_sink_caps (void)
|
|||
return caps;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_faac_set_tags (GstFaac * faac)
|
||||
{
|
||||
GstTagList *taglist;
|
||||
|
||||
/* create a taglist and add a bitrate tag to it */
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_BITRATE, faac->bitrate, NULL);
|
||||
|
||||
gst_audio_encoder_merge_tags (GST_AUDIO_ENCODER (faac), taglist,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
|
||||
gst_tag_list_unref (taglist);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_faac_set_format (GstAudioEncoder * enc, GstAudioInfo * info)
|
||||
{
|
||||
|
@ -375,6 +391,8 @@ gst_faac_set_format (GstAudioEncoder * enc, GstAudioInfo * info)
|
|||
if (!result)
|
||||
goto done;
|
||||
|
||||
gst_faac_set_tags (faac);
|
||||
|
||||
/* report needs to base class */
|
||||
gst_audio_encoder_set_frame_samples_min (enc, faac->samples);
|
||||
gst_audio_encoder_set_frame_samples_max (enc, faac->samples);
|
||||
|
|
Loading…
Reference in a new issue