gstreamer/gst/replaygain/gstrganalysis.c

712 lines
24 KiB
C
Raw Normal View History

Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
/* GStreamer ReplayGain analysis
*
* Copyright (C) 2006 Rene Stadler <mail@renestadler.de>
*
* gstrganalysis.c: Element that performs the ReplayGain analysis
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
/**
* SECTION:element-rganalysis
* @see_also: #GstRgVolume
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
*
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* This element analyzes raw audio sample data in accordance with the proposed
* <ulink url="http://replaygain.org">ReplayGain standard</ulink> for
* calculating the ideal replay gain for music tracks and albums. The element
* is designed as a pass-through filter that never modifies any data. As it
* receives an EOS event, it finalizes the ongoing analysis and generates a tag
* list containing the results. It is sent downstream with a tag event and
* posted on the message bus with a tag message. The EOS event is forwarded as
* normal afterwards. Result tag lists at least contain the tags
* #GST_TAG_TRACK_GAIN, #GST_TAG_TRACK_PEAK and #GST_TAG_REFERENCE_LEVEL.
*
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* Because the generated metadata tags become available at the end of streams,
* downstream muxer and encoder elements are normally unable to save them in
* their output since they generally save metadata in the file header.
* Therefore, it is often necessary that applications read the results in a bus
* event handler for the tag message. Obtaining the values this way is always
* needed for <link linkend="GstRgAnalysis--num-tracks">album processing</link>
* since the album gain and peak values need to be associated with all tracks of
* an album, not just the last one.
*
* <refsect2>
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
* <title>Example launch lines</title>
* |[
* gst-launch-1.0 -t audiotestsrc wave=sine num-buffers=512 ! rganalysis ! fakesink
* ]| Analyze a simple test waveform
* |[
* gst-launch-1.0 -t filesrc location=filename.ext ! decodebin \
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* ! audioconvert ! audioresample ! rganalysis ! fakesink
* ]| Analyze a given file
* |[
* gst-launch-1.0 -t gnomevfssrc location=http://replaygain.hydrogenaudio.org/ref_pink.wav \
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* ! wavparse ! rganalysis ! fakesink
* ]| Analyze the pink noise reference file
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* <para>
* The above launch line yields a result gain of +6 dB (instead of the expected
* +0 dB). This is not in error, refer to the #GstRgAnalysis:reference-level
* property documentation for more information.
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* </para>
* </refsect2>
* <refsect2>
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
* <title>Acknowledgements</title>
* <para>
* This element is based on code used in the <ulink
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
* url="http://sjeng.org/vorbisgain.html">vorbisgain</ulink> program and many
* others. The relevant parts are copyrighted by David Robinson, Glen Sawyer
* and Frank Klemm.
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
* </para>
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
2011-08-19 14:09:48 +00:00
#include <gst/audio/audio.h>
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
#include "gstrganalysis.h"
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
#include "replaygain.h"
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
GST_DEBUG_CATEGORY_STATIC (gst_rg_analysis_debug);
#define GST_CAT_DEFAULT gst_rg_analysis_debug
/* Default property value. */
#define FORCED_DEFAULT TRUE
#define DEFAULT_MESSAGE FALSE
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
enum
{
PROP_0,
PROP_NUM_TRACKS,
PROP_FORCED,
PROP_REFERENCE_LEVEL,
PROP_MESSAGE
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
};
/* The ReplayGain algorithm is intended for use with mono and stereo
* audio. The used implementation has filter coefficients for the
* "usual" sample rates in the 8000 to 48000 Hz range. */
2011-08-19 14:27:20 +00:00
#define REPLAY_GAIN_CAPS "audio/x-raw," \
2011-08-19 14:09:48 +00:00
"format = (string) { "GST_AUDIO_NE(F32)","GST_AUDIO_NE(S16)" }, " \
"layout = (string) interleaved, " \
"channels = (int) 1, " \
"rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, " \
"44100, 48000 }; " \
"audio/x-raw," \
"format = (string) { "GST_AUDIO_NE(F32)","GST_AUDIO_NE(S16)" }, " \
"layout = (string) interleaved, " \
"channels = (int) 2, " \
"channel-mask = (bitmask) 0x3, " \
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
"rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, " \
"44100, 48000 }"
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
2011-08-19 14:09:48 +00:00
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (REPLAY_GAIN_CAPS));
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
2011-08-19 14:09:48 +00:00
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (REPLAY_GAIN_CAPS));
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
#define gst_rg_analysis_parent_class parent_class
G_DEFINE_TYPE (GstRgAnalysis, gst_rg_analysis, GST_TYPE_BASE_TRANSFORM);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
static void gst_rg_analysis_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_rg_analysis_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean gst_rg_analysis_start (GstBaseTransform * base);
static gboolean gst_rg_analysis_set_caps (GstBaseTransform * base,
GstCaps * incaps, GstCaps * outcaps);
static GstFlowReturn gst_rg_analysis_transform_ip (GstBaseTransform * base,
GstBuffer * buf);
2011-07-22 19:26:32 +00:00
static gboolean gst_rg_analysis_sink_event (GstBaseTransform * base,
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
GstEvent * event);
static gboolean gst_rg_analysis_stop (GstBaseTransform * base);
static void gst_rg_analysis_handle_tags (GstRgAnalysis * filter,
const GstTagList * tag_list);
static void gst_rg_analysis_handle_eos (GstRgAnalysis * filter);
static gboolean gst_rg_analysis_track_result (GstRgAnalysis * filter,
GstTagList ** tag_list);
static gboolean gst_rg_analysis_album_result (GstRgAnalysis * filter,
GstTagList ** tag_list);
static void
gst_rg_analysis_class_init (GstRgAnalysisClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *element_class;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
GstBaseTransformClass *trans_class;
gobject_class = (GObjectClass *) klass;
element_class = (GstElementClass *) klass;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
gobject_class->set_property = gst_rg_analysis_set_property;
gobject_class->get_property = gst_rg_analysis_get_property;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
/**
* GstRgAnalysis:num-tracks:
*
* Number of remaining album tracks.
*
* Analyzing several streams sequentially and assigning them a common result
* gain is known as "album processing". If this gain is used during playback
* (by switching to "album mode"), all tracks of an album receive the same
* amplification. This keeps the relative volume levels between the tracks
* intact. To enable this, set this property to the number of streams that
* will be processed as album tracks.
*
* Every time an EOS event is received, the value of this property is
* decremented by one. As it reaches zero, it is assumed that the last track
* of the album finished. The tag list for the final stream will contain the
* additional tags #GST_TAG_ALBUM_GAIN and #GST_TAG_ALBUM_PEAK. All other
* streams just get the two track tags posted because the values for the album
* tags are not known before all tracks are analyzed. Applications need to
* ensure that the album gain and peak values are also associated with the
* other tracks when storing the results.
*
* If the total number of album tracks is unknown beforehand, just ensure that
* the value is greater than 1 before each track starts. Then before the end
* of the last track, set it to the value 1.
*
* To perform album processing, the element has to preserve data between
* streams. This cannot survive a state change to the NULL or READY state.
* If you change your pipeline's state to NULL or READY between tracks, lock
* the element's state using gst_element_set_locked_state() when it is in
* PAUSED or PLAYING.
*/
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_object_class_install_property (gobject_class, PROP_NUM_TRACKS,
g_param_spec_int ("num-tracks", "Number of album tracks",
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
"Number of remaining album tracks", 0, G_MAXINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
/**
* GstRgAnalysis:forced:
*
* Whether to analyze streams even when ReplayGain tags exist.
*
* For assisting transcoder/converter applications, the element can silently
* skip the processing of streams that already contain the necessary tags.
* Data will flow as usual but the element will not consume CPU time and will
* not generate result tags. To enable possible skipping, set this property
* to #FALSE.
*
* If used in conjunction with <link linkend="GstRgAnalysis--num-tracks">album
* processing</link>, the element will skip the number of remaining album
* tracks if a full set of tags is found for the first track. If a subsequent
* track of the album is missing tags, processing cannot start again. If this
* is undesired, the application has to scan all files beforehand and enable
* forcing of processing if needed.
*/
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_object_class_install_property (gobject_class, PROP_FORCED,
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
g_param_spec_boolean ("forced", "Forced",
"Analyze even if ReplayGain tags exist",
FORCED_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
/**
* GstRgAnalysis:reference-level:
*
* Reference level [dB].
*
* Analyzing the ReplayGain pink noise reference waveform computes a result of
* +6 dB instead of the expected 0 dB. This is because the default reference
* level is 89 dB. To obtain values as lined out in the original proposal of
* ReplayGain, set this property to 83.
*
* Almost all software uses 89 dB as a reference however, and this value has
* become the new official value. That is to say, while the change has been
* acclaimed by the author of the ReplayGain proposal, the <ulink
* url="http://replaygain.org">webpage</ulink> is still outdated at the time
* of this writing.
*
* The value was changed because the original proposal recommends a default
* pre-amp value of +6 dB for playback. This seemed a bit odd, as it means
* that the algorithm has the general tendency to produce adjustment values
* that are 6 dB too low. Bumping the reference level by 6 dB compensated for
* this.
*
* The problem of the reference level being ambiguous for lack of concise
* standardization is to be solved by adopting the #GST_TAG_REFERENCE_LEVEL
* tag, which allows to store the used value alongside the gain values.
*/
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_object_class_install_property (gobject_class, PROP_REFERENCE_LEVEL,
g_param_spec_double ("reference-level", "Reference level",
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
"Reference level [dB]", 0.0, 150., RG_REFERENCE_LEVEL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MESSAGE,
g_param_spec_boolean ("message", "Message",
"Post statics messages",
DEFAULT_MESSAGE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
trans_class = (GstBaseTransformClass *) klass;
trans_class->start = GST_DEBUG_FUNCPTR (gst_rg_analysis_start);
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_rg_analysis_set_caps);
trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_rg_analysis_transform_ip);
2011-07-22 19:26:32 +00:00
trans_class->sink_event = GST_DEBUG_FUNCPTR (gst_rg_analysis_sink_event);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
trans_class->stop = GST_DEBUG_FUNCPTR (gst_rg_analysis_stop);
trans_class->passthrough_on_same_caps = TRUE;
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_set_static_metadata (element_class, "ReplayGain analysis",
"Filter/Analyzer/Audio",
"Perform the ReplayGain analysis",
"Ren\xc3\xa9 Stadler <mail@renestadler.de>");
GST_DEBUG_CATEGORY_INIT (gst_rg_analysis_debug, "rganalysis", 0,
"ReplayGain analysis element");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
static void
gst_rg_analysis_init (GstRgAnalysis * filter)
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
{
GstBaseTransform *base = GST_BASE_TRANSFORM (filter);
gst_base_transform_set_gap_aware (base, TRUE);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
filter->num_tracks = 0;
filter->forced = FORCED_DEFAULT;
filter->message = DEFAULT_MESSAGE;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
filter->reference_level = RG_REFERENCE_LEVEL;
filter->ctx = NULL;
filter->analyze = NULL;
}
static void
gst_rg_analysis_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (object);
GST_OBJECT_LOCK (filter);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
switch (prop_id) {
case PROP_NUM_TRACKS:
filter->num_tracks = g_value_get_int (value);
break;
case PROP_FORCED:
filter->forced = g_value_get_boolean (value);
break;
case PROP_REFERENCE_LEVEL:
filter->reference_level = g_value_get_double (value);
break;
case PROP_MESSAGE:
filter->message = g_value_get_boolean (value);
break;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
GST_OBJECT_UNLOCK (filter);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
static void
gst_rg_analysis_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (object);
GST_OBJECT_LOCK (filter);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
switch (prop_id) {
case PROP_NUM_TRACKS:
g_value_set_int (value, filter->num_tracks);
break;
case PROP_FORCED:
g_value_set_boolean (value, filter->forced);
break;
case PROP_REFERENCE_LEVEL:
g_value_set_double (value, filter->reference_level);
break;
case PROP_MESSAGE:
g_value_set_boolean (value, filter->message);
break;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
GST_OBJECT_UNLOCK (filter);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
static void
gst_rg_analysis_post_message (gpointer rganalysis, GstClockTime timestamp,
GstClockTime duration, gdouble rglevel)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (rganalysis);
if (filter->message) {
GstMessage *m;
m = gst_message_new_element (GST_OBJECT_CAST (rganalysis),
gst_structure_new ("rganalysis",
"timestamp", G_TYPE_UINT64, timestamp,
"duration", G_TYPE_UINT64, duration,
"rglevel", G_TYPE_DOUBLE, rglevel, NULL));
gst_element_post_message (GST_ELEMENT_CAST (rganalysis), m);
}
}
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
static gboolean
gst_rg_analysis_start (GstBaseTransform * base)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
filter->ignore_tags = FALSE;
filter->skip = FALSE;
filter->has_track_gain = FALSE;
filter->has_track_peak = FALSE;
filter->has_album_gain = FALSE;
filter->has_album_peak = FALSE;
filter->ctx = rg_analysis_new ();
GST_OBJECT_LOCK (filter);
rg_analysis_init_silence_detection (filter->ctx, gst_rg_analysis_post_message,
filter);
GST_OBJECT_UNLOCK (filter);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
filter->analyze = NULL;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_LOG_OBJECT (filter, "started");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return TRUE;
}
static gboolean
gst_rg_analysis_set_caps (GstBaseTransform * base, GstCaps * in_caps,
GstCaps * out_caps)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
2011-08-19 14:09:48 +00:00
GstAudioInfo info;
gint rate, channels;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_return_val_if_fail (filter->ctx != NULL, FALSE);
GST_DEBUG_OBJECT (filter,
"set_caps in %" GST_PTR_FORMAT " out %" GST_PTR_FORMAT,
in_caps, out_caps);
2011-08-19 14:09:48 +00:00
if (!gst_audio_info_from_caps (&info, in_caps))
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
goto invalid_format;
2011-08-19 14:09:48 +00:00
rate = GST_AUDIO_INFO_RATE (&info);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
if (!rg_analysis_set_sample_rate (filter->ctx, rate))
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
goto invalid_format;
2011-08-19 14:09:48 +00:00
channels = GST_AUDIO_INFO_CHANNELS (&info);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
if (channels < 1 || channels > 2)
goto invalid_format;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
switch (GST_AUDIO_INFO_FORMAT (&info)) {
case GST_AUDIO_FORMAT_F32:
/* The depth is not variable for float formats of course. It just
* makes the transform function nice and simple if the
* rg_analysis_analyze_* functions have a common signature. */
filter->depth = sizeof (gfloat) * 8;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
if (channels == 1)
filter->analyze = rg_analysis_analyze_mono_float;
else
filter->analyze = rg_analysis_analyze_stereo_float;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
break;
case GST_AUDIO_FORMAT_S16:
filter->depth = sizeof (gint16) * 8;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
2011-08-19 14:09:48 +00:00
if (channels == 1)
filter->analyze = rg_analysis_analyze_mono_int16;
else
filter->analyze = rg_analysis_analyze_stereo_int16;
break;
default:
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
goto invalid_format;
}
return TRUE;
/* Errors. */
invalid_format:
{
filter->analyze = NULL;
GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION,
("Invalid incoming caps: %" GST_PTR_FORMAT, in_caps), (NULL));
return FALSE;
}
}
static GstFlowReturn
gst_rg_analysis_transform_ip (GstBaseTransform * base, GstBuffer * buf)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
2012-01-23 16:25:37 +00:00
GstMapInfo map;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
g_return_val_if_fail (filter->ctx != NULL, GST_FLOW_FLUSHING);
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
g_return_val_if_fail (filter->analyze != NULL, GST_FLOW_NOT_NEGOTIATED);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
if (filter->skip)
return GST_FLOW_OK;
2012-01-23 16:25:37 +00:00
gst_buffer_map (buf, &map, GST_MAP_READ);
GST_LOG_OBJECT (filter, "processing buffer of size %" G_GSIZE_FORMAT,
map.size);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
rg_analysis_start_buffer (filter->ctx, GST_BUFFER_TIMESTAMP (buf));
2012-01-23 16:25:37 +00:00
filter->analyze (filter->ctx, map.data, map.size, filter->depth);
2012-01-23 16:25:37 +00:00
gst_buffer_unmap (buf, &map);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return GST_FLOW_OK;
}
static gboolean
2011-07-22 19:26:32 +00:00
gst_rg_analysis_sink_event (GstBaseTransform * base, GstEvent * event)
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
g_return_val_if_fail (filter->ctx != NULL, TRUE);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
{
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_LOG_OBJECT (filter, "received EOS event");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
gst_rg_analysis_handle_eos (filter);
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_LOG_OBJECT (filter, "passing on EOS event");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
break;
}
case GST_EVENT_TAG:
{
GstTagList *tag_list;
/* The reference to the tag list is borrowed. */
gst_event_parse_tag (event, &tag_list);
gst_rg_analysis_handle_tags (filter, tag_list);
break;
}
default:
break;
}
2011-07-22 19:26:32 +00:00
return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (base, event);
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
static gboolean
gst_rg_analysis_stop (GstBaseTransform * base)
{
GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
g_return_val_if_fail (filter->ctx != NULL, FALSE);
rg_analysis_destroy (filter->ctx);
filter->ctx = NULL;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_LOG_OBJECT (filter, "stopped");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return TRUE;
}
/* FIXME: handle global vs. stream-tags? */
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
static void
gst_rg_analysis_handle_tags (GstRgAnalysis * filter,
const GstTagList * tag_list)
{
gboolean album_processing = (filter->num_tracks > 0);
gdouble dummy;
if (!album_processing)
filter->ignore_tags = FALSE;
if (filter->skip && album_processing) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter, "ignoring tag event: skipping album");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
} else if (filter->skip) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter, "ignoring tag event: skipping track");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
} else if (filter->ignore_tags) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter, "ignoring tag event: cannot skip anyways");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
}
filter->has_track_gain |= gst_tag_list_get_double (tag_list,
GST_TAG_TRACK_GAIN, &dummy);
filter->has_track_peak |= gst_tag_list_get_double (tag_list,
GST_TAG_TRACK_PEAK, &dummy);
filter->has_album_gain |= gst_tag_list_get_double (tag_list,
GST_TAG_ALBUM_GAIN, &dummy);
filter->has_album_peak |= gst_tag_list_get_double (tag_list,
GST_TAG_ALBUM_PEAK, &dummy);
if (!(filter->has_track_gain && filter->has_track_peak)) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter, "track tags not complete yet");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
}
if (album_processing && !(filter->has_album_gain && filter->has_album_peak)) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter, "album tags not complete yet");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
}
if (filter->forced) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_DEBUG_OBJECT (filter,
"existing tags are sufficient, but processing anyway (forced)");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
return;
}
filter->skip = TRUE;
rg_analysis_reset (filter->ctx);
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
if (!album_processing) {
GST_DEBUG_OBJECT (filter,
"existing tags are sufficient, will not process this track");
} else {
GST_DEBUG_OBJECT (filter,
"existing tags are sufficient, will not process this album");
}
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
static void
gst_rg_analysis_handle_eos (GstRgAnalysis * filter)
{
gboolean album_processing = (filter->num_tracks > 0);
gboolean album_finished = (filter->num_tracks == 1);
gboolean album_skipping = album_processing && filter->skip;
filter->has_track_gain = FALSE;
filter->has_track_peak = FALSE;
if (album_finished) {
filter->ignore_tags = FALSE;
filter->skip = FALSE;
filter->has_album_gain = FALSE;
filter->has_album_peak = FALSE;
} else if (!album_skipping) {
filter->skip = FALSE;
}
/* We might have just fully processed a track because it has
* incomplete tags. If we do album processing and allow skipping
* (not forced), prevent switching to skipping if a later track with
* full tags comes along: */
if (!filter->forced && album_processing && !album_finished)
filter->ignore_tags = TRUE;
if (!filter->skip) {
GstTagList *tag_list = NULL;
gboolean track_success;
gboolean album_success = FALSE;
track_success = gst_rg_analysis_track_result (filter, &tag_list);
if (album_finished)
album_success = gst_rg_analysis_album_result (filter, &tag_list);
else if (!album_processing)
rg_analysis_reset_album (filter->ctx);
if (track_success || album_success) {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_LOG_OBJECT (filter, "posting tag list with results");
gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_REFERENCE_LEVEL, filter->reference_level, NULL);
/* This takes ownership of our reference to the list */
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (filter),
gst_event_new_tag (tag_list));
tag_list = NULL;
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
}
if (album_processing) {
filter->num_tracks--;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
if (!album_finished) {
GST_DEBUG_OBJECT (filter, "album not finished yet (num-tracks is now %u)",
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
filter->num_tracks);
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
} else {
GST_DEBUG_OBJECT (filter, "album finished (num-tracks is now 0)");
}
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
if (album_processing)
g_object_notify (G_OBJECT (filter), "num-tracks");
}
/* FIXME: return tag list (lists?) based on input tags.. */
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
static gboolean
gst_rg_analysis_track_result (GstRgAnalysis * filter, GstTagList ** tag_list)
{
gboolean track_success;
gdouble track_gain, track_peak;
track_success = rg_analysis_track_result (filter->ctx, &track_gain,
&track_peak);
if (track_success) {
track_gain += filter->reference_level - RG_REFERENCE_LEVEL;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_INFO_OBJECT (filter, "track gain is %+.2f dB, peak %.6f", track_gain,
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
track_peak);
} else {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_INFO_OBJECT (filter, "track was too short to analyze");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
if (track_success) {
if (*tag_list == NULL)
*tag_list = gst_tag_list_new_empty ();
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_TRACK_PEAK, track_peak, GST_TAG_TRACK_GAIN, track_gain, NULL);
}
return track_success;
}
static gboolean
gst_rg_analysis_album_result (GstRgAnalysis * filter, GstTagList ** tag_list)
{
gboolean album_success;
gdouble album_gain, album_peak;
album_success = rg_analysis_album_result (filter->ctx, &album_gain,
&album_peak);
if (album_success) {
album_gain += filter->reference_level - RG_REFERENCE_LEVEL;
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_INFO_OBJECT (filter, "album gain is %+.2f dB, peak %.6f", album_gain,
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
album_peak);
} else {
Add replaygain playback elements (#412710). Original commit message from CVS: 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).
2007-05-19 10:01:45 +00:00
GST_INFO_OBJECT (filter, "album was too short to analyze");
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
}
if (album_success) {
if (*tag_list == NULL)
*tag_list = gst_tag_list_new_empty ();
Add ReplayGain analysis element (#357069). Original commit message from CVS: Patch by: René Stadler <mail at renestadler de> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/replaygain/Makefile.am: * gst/replaygain/gstrganalysis.c: (gst_rg_analysis_base_init), (gst_rg_analysis_class_init), (gst_rg_analysis_init), (gst_rg_analysis_set_property), (gst_rg_analysis_get_property), (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), (plugin_init): * gst/replaygain/gstrganalysis.h: * gst/replaygain/rganalysis.c: (yule_filter), (butter_filter), (apply_filters), (reset_filters), (accumulator_add), (accumulator_clear), (accumulator_result), (rg_analysis_new), (rg_analysis_set_sample_rate), (rg_analysis_destroy), (rg_analysis_analyze_mono_float), (rg_analysis_analyze_stereo_float), (rg_analysis_analyze_mono_int16), (rg_analysis_analyze_stereo_int16), (rg_analysis_analyze), (rg_analysis_track_result), (rg_analysis_album_result), (rg_analysis_reset_album), (rg_analysis_reset): * gst/replaygain/rganalysis.h: Add ReplayGain analysis element (#357069). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/rganalysis.c: (get_expected_gain), (setup_rganalysis), (cleanup_rganalysis), (set_playing_state), (send_eos_event), (send_tag_event), (poll_eos), (poll_tags), (fail_unless_track_gain), (fail_unless_track_peak), (fail_unless_album_gain), (fail_unless_album_peak), (fail_if_track_tags), (fail_if_album_tags), (fail_unless_num_tracks), (test_buffer_const_float_mono), (test_buffer_const_float_stereo), (test_buffer_const_int16_mono), (test_buffer_const_int16_stereo), (test_buffer_square_float_mono), (test_buffer_square_float_stereo), (test_buffer_square_int16_mono), (test_buffer_square_int16_stereo), (push_buffer), (GST_START_TEST), (rganalysis_suite), (main): Unit tests for the new replaygain element.
2006-10-06 15:56:01 +00:00
gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_ALBUM_PEAK, album_peak, GST_TAG_ALBUM_GAIN, album_gain, NULL);
}
return album_success;
}