GNOME Bugzilla – Bug 412710
[replaygain] Add playback elements
Last modified: 2007-05-19 10:07:59 UTC
Attaching patches to add two new elements to the replaygain plugin: rgvolume and rglimiter. The first patch moves the plugin stuff and a common constant to its own files, makes the rganalysis element use better logging levels, tunes the documentation and fixes some formatting issues (minor cleanups, uncapitalize debug messages, re-indent comments to use correct wrap width (ouch!)). Furthermore, support for the new GST_TAG_REFERENCE_LEVEL is added (a rather trivial addition). The second patch finally adds the new elements with their tests and doc setup. Since this adds documentation, please perform a doc update after applying this. Furthermore, this seems to provide the last piece for bug #127574, so that can be closed when this gets applied.
Created attachment 83481 [details] [review] Prepare the replaygain plugin for addition of playback elements Changes: * gst/replaygain/Makefile.am: Add new files replaygain.c, replaygain.h. * gst/replaygain/gstrganalysis.c: No longer include string.h. Move property-related documentation from the main description section to the property definitions. Mention new reference level tag. Refine documentation. Use correct wrap width this time. (gst_rg_analysis_class_init): Lower the upper limit of the reference-level property way below G_MAXDOUBLE. Trim property descriptions a little. (gst_rg_analysis_start): Use a more conservative log level. Uncapitalize log message. (gst_rg_analysis_set_caps): Replace usage of strcmp with g_str_equal. Rename local variable. (gst_rg_analysis_transform_ip): Use better flow return values for g_return_val_if_fail sanity checks. Use a more conservative log level. Uncapitalize log message. (gst_rg_analysis_event), (gst_rg_analysis_stop), (gst_rg_analysis_handle_tags): Use a more conservative log level. Uncapitalize log messages. (gst_rg_analysis_handle_eos): Attach used reference level to the result tag list by using the new GST_TAG_REFERENCE_LEVEL. Use a more conservative log level. Uncapitalize log messages. (gst_rg_analysis_track_result), (gst_rg_analysis_album_result): Uncapitalize log messages. (plugin_init), (GST_PLUGIN_DEFINE): Move plugin stuff to replaygain.c. * gst/replaygain/gstrganalysis.h: (gst_rg_analysis_get_type): Add declaration. * gst/replaygain/replaygain.c: (plugin_init), (GST_PLUGIN_DEFINE): Move plugin stuff to this new file. * gst/replaygain/replaygain.h: * gst/replaygain/rganalysis.h: (RG_REFERENCE_LEVEL): Move constant from rganalysis.h to replaygain.h. * tests/check/elements/rganalysis.c: Re-indent comments to correct wrap width. (test_reference_level): Test for correct emission of new GST_TAG_REFERENCE_LEVEL.
Created attachment 83483 [details] [review] Add playback elements to replaygain plugin Changes: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: Documentation setup for new elements rgvolume and rglimiter. * gst/replaygain/Makefile.am: Add files of new elements. Link against gstbaseutils. * gst/replaygain/gstrganalysis.c: Add a @see_also docs directive which points to the new rgvolume element. * gst/replaygain/gstrglimiter.c: (gst_rg_limiter_base_init), (gst_rg_limiter_class_init), (gst_rg_limiter_init), (gst_rg_limiter_set_property), (gst_rg_limiter_get_property), (gst_rg_limiter_transform_ip): * gst/replaygain/gstrglimiter.h: Add rglimiter element (ReplayGain limiter), which implements -6 dB hard limiting with soft-knee characteristics. * gst/replaygain/gstrgvolume.c: (gst_rg_volume_base_init), (gst_rg_volume_class_init), (gst_rg_volume_init), (gst_rg_volume_set_property), (gst_rg_volume_get_property), (gst_rg_volume_dispose), (gst_rg_volume_change_state), (gst_rg_volume_sink_event), (gst_rg_volume_tag_event), (gst_rg_volume_reset), (gst_rg_volume_update_gain), (gst_rg_volume_determine_gain): * gst/replaygain/gstrgvolume.h: Add rgvolume element (ReplayGain volume), which implements the ReplayGain volume adjustment/synthesis. * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rglimiter.c: (setup_rglimiter), (cleanup_rglimiter), (set_playing_state), (create_test_buffer), (verify_test_buffer), (test_no_buffer), (test_disabled), (test_limiting), (rglimiter_suite), (main): * tests/check/elements/rgvolume.c: (event_func), (setup_rgvolume), (cleanup_rgvolume), (set_playing_state), (set_null_state), (send_eos_event), (send_tag_event), (test_buffer_new), (MATCH_GAIN), (fail_unless_target_gain), (fail_unless_result_gain), (fail_unless_gain), (test_no_buffer), (test_events), (test_simple), (test_fallback_gain), (test_fallback_track), (test_fallback_album), (test_headroom), (test_reference_level), (rgvolume_suite), (main): Add unit tests for new elements rgvolume and rglimiter.
I merged and tested this patch on my local copy. Merged cleanly and things seemed to keep working fine afterwards. Due to the intrusive nature of this patch I will leave it to someone who can actually review the chagnes to merge though.
Created attachment 88422 [details] [review] Add playback elements to replaygain plugin (2) Like previous patch, but apply the rename of baseutils -> pbutils. Also adds missing gtk-doc stanzas for the new structures.
Sorry, this one seems to have slipped off the radar somehow. You should have pinged us on IRC :) 2007-05-19 Tim-Philipp Müller <tim at centricular dot net> Patch by: René Stadler <mail at renestadler de> * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/inspect/plugin-replaygain.xml: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_class_init), (gst_rg_analysis_start), (gst_rg_analysis_set_caps), (gst_rg_analysis_transform_ip), (gst_rg_analysis_event), (gst_rg_analysis_stop), (gst_rg_analysis_handle_tags), (gst_rg_analysis_handle_eos), (gst_rg_analysis_track_result), (gst_rg_analysis_album_result): * gst/replaygain/gstrganalysis.h: * gst/replaygain/gstrglimiter.c: (gst_rg_limiter_base_init), (gst_rg_limiter_class_init), (gst_rg_limiter_init), (gst_rg_limiter_set_property), (gst_rg_limiter_get_property), (gst_rg_limiter_transform_ip): * gst/replaygain/gstrglimiter.h: * gst/replaygain/gstrgvolume.c: (gst_rg_volume_base_init), (gst_rg_volume_class_init), (gst_rg_volume_init), (gst_rg_volume_set_property), (gst_rg_volume_get_property), (gst_rg_volume_dispose), (gst_rg_volume_change_state), (gst_rg_volume_sink_event), (gst_rg_volume_tag_event), (gst_rg_volume_reset), (gst_rg_volume_update_gain), (gst_rg_volume_determine_gain): * gst/replaygain/gstrgvolume.h: * gst/replaygain/replaygain.c: (plugin_init): * gst/replaygain/replaygain.h: * gst/replaygain/rganalysis.h: * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (send_eos_event), (GST_START_TEST): * tests/check/elements/rglimiter.c: (setup_rglimiter), (cleanup_rglimiter), (set_playing_state), (create_test_buffer), (verify_test_buffer), (GST_START_TEST), (rglimiter_suite), (main): * tests/check/elements/rgvolume.c: (event_func), (setup_rgvolume), (cleanup_rgvolume), (set_playing_state), (set_null_state), (send_eos_event), (send_tag_event), (test_buffer_new), (fail_unless_target_gain), (fail_unless_result_gain), (fail_unless_gain), (GST_START_TEST), (rgvolume_suite), (main): Add replaygain playback elements (#412710).