WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
2009-11-25 Philippe Normand <pnormand@igalia.com>
2009-11-25-Philippe-Normand-pnormandigaliacom.patch (text/plain), 5.86 KB, created by
Philippe Normand
on 2009-12-17 09:27:56 PST
(
hide
)
Description:
2009-11-25 Philippe Normand <pnormand@igalia.com>
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2009-12-17 09:27:56 PST
Size:
5.86 KB
patch
obsolete
>From a495967964f854b72623c9fe662850c3ee6c8e9c Mon Sep 17 00:00:00 2001 >From: Philippe Normand <pnormand@igalia.com> >Date: Thu, 19 Nov 2009 14:27:21 +0100 >Subject: [PATCH] 2009-11-25 Philippe Normand <pnormand@igalia.com> > > Reviewed by NOBODY (OOPS!). > > [GTK] set playbin mute property depending on volume value > https://bugs.webkit.org/show_bug.cgi?id=31586 > > Support for notify::mute playbin2 signal, easing integration with > PulseAudio. > > * platform/graphics/MediaPlayer.h: > (WebCore::MediaPlayerClient::setMuted): > * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: > (WebCore::notifyMuteIdleCallback): > (WebCore::mediaPlayerPrivateMuteCallback): > (WebCore::MediaPlayerPrivate::setVolume): > (WebCore::MediaPlayerPrivate::muteChanged): > (WebCore::MediaPlayerPrivate::createGSTPlayBin): > * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h: >--- > WebCore/ChangeLog | 20 ++++++++++++ > WebCore/platform/graphics/MediaPlayer.h | 2 + > .../graphics/gtk/MediaPlayerPrivateGStreamer.cpp | 33 ++++++++++++++++++-- > .../graphics/gtk/MediaPlayerPrivateGStreamer.h | 1 + > 4 files changed, 53 insertions(+), 3 deletions(-) > >diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index 975bc96..e71a670 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2009-11-25 Philippe Normand <pnormand@igalia.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [GTK] set playbin mute property depending on volume value >+ https://bugs.webkit.org/show_bug.cgi?id=31586 >+ >+ Support for notify::mute playbin2 signal, easing integration with >+ PulseAudio. >+ >+ * platform/graphics/MediaPlayer.h: >+ (WebCore::MediaPlayerClient::setMuted): >+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::notifyMuteIdleCallback): >+ (WebCore::mediaPlayerPrivateMuteCallback): >+ (WebCore::MediaPlayerPrivate::setVolume): >+ (WebCore::MediaPlayerPrivate::muteChanged): >+ (WebCore::MediaPlayerPrivate::createGSTPlayBin): >+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h: >+ > 2009-12-17 Mikhail Naganov <mnaganov@chromium.org> > > Reviewed by Pavel Feldman. >diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h >index ec8ac33..2eb834d 100644 >--- a/WebCore/platform/graphics/MediaPlayer.h >+++ b/WebCore/platform/graphics/MediaPlayer.h >@@ -98,6 +98,8 @@ public: > // element to an <embed> in standalone documents > virtual void mediaPlayerSawUnsupportedTracks(MediaPlayer*) { } > >+ virtual void setMuted(bool) { } >+ > // Presentation-related methods > // a new frame of video is available > virtual void mediaPlayerRepaint(MediaPlayer*) { } >diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp >index 49f6c86..3c94858 100644 >--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp >+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp >@@ -115,6 +115,18 @@ gboolean notifyVolumeIdleCallback(MediaPlayer* mp) > return FALSE; > } > >+gboolean notifyMuteIdleCallback(gpointer data) >+{ >+ MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data); >+ mp->muteChanged(); >+ return FALSE; >+} >+ >+void mediaPlayerPrivateMuteCallback(GObject *element, GParamSpec *pspec, MediaPlayerPrivate* mp) >+{ >+ g_idle_add((GSourceFunc) notifyMuteIdleCallback, mp); >+} >+ > static float playbackPosition(GstElement* playbin) > { > >@@ -429,7 +441,12 @@ void MediaPlayerPrivate::setVolume(float volume) > if (!m_playBin) > return; > >- g_object_set(G_OBJECT(m_playBin), "volume", static_cast<double>(volume), NULL); >+ // Set playbin's mute property depending on volume value. This is >+ // done like this to remain coherent with HTMLMediaElement >+ // behavior. >+ bool mute = volume <= 0; >+ g_object_set(G_OBJECT(m_playBin), "volume", static_cast<double>(volume), >+ "mute", mute, NULL); > } > > void MediaPlayerPrivate::volumeChanged() >@@ -711,6 +728,16 @@ void MediaPlayerPrivate::durationChanged() > m_player->durationChanged(); > } > >+void MediaPlayerPrivate::muteChanged() >+{ >+ // Some application (PulseAudio for instance) changed the mute >+ // playbin property. Propagate the change to the player's client, >+ // the HTMLMediaElement. >+ gboolean mute; >+ g_object_get(m_playBin, "mute", &mute, NULL); >+ m_player->mediaPlayerClient()->setMuted(static_cast<bool>(mute)); >+} >+ > void MediaPlayerPrivate::loadingFailed(MediaPlayer::NetworkState error) > { > m_errorOccured = true; >@@ -925,10 +952,10 @@ void MediaPlayerPrivate::createGSTPlayBin(String url) > g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this); > gst_object_unref(bus); > >- g_object_set(G_OBJECT(m_playBin), "uri", url.utf8().data(), >- NULL); >+ g_object_set(G_OBJECT(m_playBin), "uri", url.utf8().data(), NULL); > > g_signal_connect(G_OBJECT(m_playBin), "notify::volume", G_CALLBACK(mediaPlayerPrivateVolumeChangedCallback), this); >+ g_signal_connect(m_playBin, "notify::mute", G_CALLBACK(mediaPlayerPrivateMuteCallback), this); > > m_videoSink = webkit_video_sink_new(); > >diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h >index 4717999..060e4ba 100644 >--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h >+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h >@@ -96,6 +96,7 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface { > void timeChanged(); > void didEnd(); > void durationChanged(); >+ void muteChanged(); > void loadingFailed(MediaPlayer::NetworkState); > > void repaint(); >-- >1.6.3.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 31586
:
43852
|
45053
|
45077
|
45270
|
45274
|
47522
|
47524
|
47527
|
47533
|
47688
|
47819