Changeset 246730 in webkit
- Timestamp:
- Jun 24, 2019 4:27:05 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246729 r246730 1 2019-06-24 Charlie Turner <cturner@igalia.com> 2 3 [GStreamer] Volume level sometimes changes inappropriately 4 https://bugs.webkit.org/show_bug.cgi?id=197358 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Be consistent with our application of volume scaling. We were 9 setting volumes using cubic interpolation in setVolume() and using 10 the inverse in volume(); however setting initial volumes was done 11 linearly in setStreamVolumeElement, which was causing strange 12 jumps in the volume level at non-deterministic times. The fix 13 looks to be that we should use linear interpolation consistently, 14 since PulseAudio already applies cubic scaling to software 15 volumes. 16 17 Covered by existing tests. 18 19 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 20 (WebCore::MediaPlayerPrivateGStreamer::paused const): Bump the 21 logging here to LOG level, it's very spammy at DEBUG. 22 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 23 (WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Switch to 24 linear interpolation. 25 (WebCore::MediaPlayerPrivateGStreamerBase::volume const): Ditto. 26 (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfVolumeChange): 27 Ditto. 28 (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): 29 Ditto, and be consistent here with the API, do not set the raw 30 volume managed by MediaElement. 31 1 32 2019-06-24 Antoine Quint <graouts@apple.com> 2 33 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r246677 r246730 657 657 gst_element_get_state(m_pipeline.get(), &state, nullptr, 0); 658 658 bool paused = state <= GST_STATE_PAUSED; 659 GST_ DEBUG_OBJECT(pipeline(), "Paused: %s", toString(paused).utf8().data());659 GST_LOG_OBJECT(pipeline(), "Paused: %s", toString(paused).utf8().data()); 660 660 return paused; 661 661 } -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r246710 r246730 556 556 557 557 GST_DEBUG_OBJECT(pipeline(), "Setting volume: %f", volume); 558 gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_ CUBIC, static_cast<double>(volume));558 gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_LINEAR, static_cast<double>(volume)); 559 559 } 560 560 … … 564 564 return 0; 565 565 566 return gst_stream_volume_get_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_ CUBIC);566 return gst_stream_volume_get_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_LINEAR); 567 567 } 568 568 … … 573 573 return; 574 574 double volume; 575 volume = gst_stream_volume_get_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_ CUBIC);575 volume = gst_stream_volume_get_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_LINEAR); 576 576 // get_volume() can return values superior to 1.0 if the user 577 577 // applies software user gain via third party application (GNOME … … 1209 1209 if (!m_player->platformVolumeConfigurationRequired()) { 1210 1210 GST_DEBUG_OBJECT(pipeline(), "Setting stream volume to %f", m_player->volume()); 1211 g _object_set(m_volumeElement.get(), "volume", m_player->volume(), nullptr);1211 gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_LINEAR, static_cast<double>(m_player->volume())); 1212 1212 } else 1213 1213 GST_DEBUG_OBJECT(pipeline(), "Not setting stream volume, trusting system one");
Note: See TracChangeset
for help on using the changeset viewer.