[webkit-reviews] review granted: [Bug 123374] [MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextTrack. : [Attachment 215513] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 5 13:45:34 PST 2013


Eric Carlson <eric.carlson at apple.com> has granted Jer Noble
<jer.noble at apple.com>'s request for review:
Bug 123374: [MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and
TextTrack.
https://bugs.webkit.org/show_bug.cgi?id=123374

Attachment 215513: Patch
https://bugs.webkit.org/attachment.cgi?id=215513&action=review

------- Additional Comments from Eric Carlson <eric.carlson at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=215513&action=review


> Source/WebCore/Modules/mediasource/MediaSource.cpp:373
> +	   return m_duration - endTime < 1;

Nit: this confused me, how about "return endTime >= m_duration"?

Isn't this is more conservative than it needs to be, won't it delay
'canplaythrough' until the entire file has been buffered?

> Source/WebCore/Modules/mediasource/MediaSource.cpp:390
> +	   return endTime - m_time > 1;

Nit: this confused me, how about "return endTime > m_time"?

> Source/WebCore/html/HTMLMediaElement.cpp:1124
> +	   if (m_mediaSource->attachToElement(this))

m_mediaSource is created externally and is ref'd by the media source registry,
so shouldn't you also call m_mediaSource->attachToElement(nullptr) at some
point?

> Source/WebCore/html/HTMLMediaElement.cpp:2906
> +    textTrack->setMediaElement(this);

Is this necessary, it is already done in TextTrackList::append?

> Source/WebCore/html/track/AudioTrackList.cpp:91
> +bool AudioTrackList::isAnyTrackEnabled() const
> +{
> +    for (size_t i = 0; i < m_inbandTracks.size(); ++i) {
> +	   AudioTrack* track = toAudioTrack(m_inbandTracks[i].get());
> +	   if (track->enabled())
> +	       return true;
> +    }
> +    return false;
> +}

Instead of overriding isAnyTrackEnabled, can you add a virtual method that
different track types override for their definition of "enabled" (eg.
willRenderData() or some such) and put this in TrackListBase?

> Source/WebCore/html/track/TextTrack.cpp:178
> -    TrackBase::setKind(newKind);
> +#if ENABLE(MEDIA_SOURCE)

What happens when MEDIA_SOURCE_ENABLED is not defined?

> Source/WebCore/html/track/VideoTrack.cpp:197
> +    // FIXME: Validate the BCP47-ness of langague.

Nit: a bug number would be good.

> Source/WebCore/html/track/VideoTrack.cpp:199
> +    if (!language.isNull() && !language.isEmpty())
> +	   return;

1) there is no need to check both because isEmpty() returns true for a NULL
string. 2) do you really want to return early when the language is NOT empty?


More information about the webkit-reviews mailing list