[Webkit-unassigned] [Bug 34631] [Qt] Switching from Phonon to QtMultimedia Backend for Qt 4.7

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 23 06:57:01 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34631





--- Comment #36 from Eric Carlson <eric.carlson at apple.com>  2010-02-23 06:57:01 PST ---
(In reply to comment #34)
> (From update of attachment 49180 [details])
> We have a winner!

A few late comments:


155     // Grab the client media element
156     HTMLMediaElement* element =
static_cast<HTMLMediaElement*>(m_player->mediaPlayerClient());
 ... 
197     // Set the current volume and mute status
198     // We get these from the element, rather than the player, in case we
have
199     // transitioned from a media engine which doesn't support muting, to a
media
200     // engine which does.
201     m_mediaPlayer->setMuted(element->muted());
202     m_mediaPlayer->setVolume(static_cast<int>(element->volume() * 100.0));

I cry foul - no fair casting the "client" pointer to the element so you can use
it! If there is a problem here you should file a bug and fix it so all ports
benefit from the change. Is there any reason that MediaPlayer needs to cache
these values?


315 unsigned MediaPlayerPrivate::bytesLoaded() const
316 {
317     unsigned percentage = m_mediaPlayer->bufferStatus();
318
319     if (percentage == 100) {
320         if (m_networkState != MediaPlayer::Idle) {
321             m_networkState = MediaPlayer::Idle;
322             m_player->networkStateChanged();
323         }
324         if (m_readyState != MediaPlayer::HaveEnoughData) {
325             m_readyState = MediaPlayer::HaveEnoughData;
326             m_player->readyStateChanged();
327         }
328     }
329

Is it possible for bufferStatus() to return 100 when mediaStatus() does not
also return QMediaPlayer::BufferedMedia or QMediaPlayer::EndOfMedia? If so,
why? If not, why do this check here when the condition will be detected in
updateStates()?


34 class MediaPlayerPrivate : public QObject, public
MediaPlayerPrivateInterface {
35
36     Q_OBJECT
37
38 public:
39     static MediaPlayerPrivateInterface* create(MediaPlayer* player);
40     ~MediaPlayerPrivate();
41
42     static void registerMediaEngine(MediaEngineRegistrar);
43     static void getSupportedTypes(HashSet<String>&);
44     static MediaPlayer::SupportsType supportsType(const String&, const
String&);
45     static bool isAvailable() { return true; }
46

Only registerMediaEngine should be public, everything else can be private.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list