[webkit-reviews] review denied: [Bug 123443] Simplifying MediaStream and MediStreamDescriptor creation : [Attachment 215437] Updated patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 30 10:30:22 PDT 2013
Eric Carlson <eric.carlson at apple.com> has denied Thiago de Barros Lacerda
<thiago.lacerda at openbossa.org>'s request for review:
Bug 123443: Simplifying MediaStream and MediStreamDescriptor creation
https://bugs.webkit.org/show_bug.cgi?id=123443
Attachment 215437: Updated patch
https://bugs.webkit.org/attachment.cgi?id=215437&action=review
------- Additional Comments from Eric Carlson <eric.carlson at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=215437&action=review
This is close, but I think it is worth one more round.
> Source/WebCore/ChangeLog:34
> + * Modules/mediastream/MediaStream.cpp:
> + (WebCore::MediaStream::create):
> + * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
> +
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
> + * platform/mediastream/MediaStreamDescriptor.cpp:
> + (WebCore::MediaStreamDescriptor::create):
> + (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
> + (WebCore::MediaStreamDescriptor::addTrackAndSource):
> + (WebCore::MediaStreamDescriptor::haveSourceWithId):
> + (WebCore::MediaStreamDescriptor::addTrack):
> + (WebCore::MediaStreamDescriptor::removeTrack):
> + * platform/mediastream/MediaStreamDescriptor.h:
> + (WebCore::MediaStreamDescriptor::numberOfAudioTracks):
> + (WebCore::MediaStreamDescriptor::audioTracks):
> + (WebCore::MediaStreamDescriptor::numberOfVideoTracks):
> + (WebCore::MediaStreamDescriptor::videoTracks):
> + * platform/mediastream/MediaStreamTrackPrivate.h:
> + * platform/mock/MockMediaStreamCenter.cpp:
> + (WebCore::MockMediaStreamCenter::createMediaStream):
Nit: comments please.
> Source/WebCore/Modules/mediastream/MediaStream.cpp:57
> +
audioTracks.append(MediaStreamTrackPrivate::create(stream->m_audioTracks[i]->so
urce()));
Why are you adding the track's *source* to the array of *tracks*? Does this
even compile?
> Source/WebCore/Modules/mediastream/MediaStream.cpp:60
> +
videoTracks.append(MediaStreamTrackPrivate::create(stream->m_videoTracks[i]->so
urce()));
Ditto.
> Source/WebCore/Modules/mediastream/MediaStream.cpp:77
> + return MediaStream::create(context,
MediaStreamDescriptor::create(audioTracks, videoTracks));
Ditto.
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp:45
> +PassRefPtr<MediaStreamDescriptor> MediaStreamDescriptor::create(const
MediaStreamSourceVector& audioSources, const MediaStreamSourceVector&
videoSources)
Nit: You can return RefPtr here. PassRefPtrs aren't needed since Anders added
move-semantics to the RefPtr class.
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp:50
> +PassRefPtr<MediaStreamDescriptor> MediaStreamDescriptor::create(const
MediaStreamTrackPrivateVector& audioPrivateTracks, const
MediaStreamTrackPrivateVector& videoPrivateTracks)
Ditto.
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp:121
> + for (size_t i = 0; i < audioSources.size(); i++)
> + addTrackAndSource(MediaStreamTrackPrivate::create(audioSources[i]));
> +
> + for (size_t i = 0; i < videoSources.size(); i++)
> + addTrackAndSource(MediaStreamTrackPrivate::create(videoSources[i]));
> +}
Does m_ended need to be set if all sources have ended (readyState == Ended)?
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp:136
> + unsigned providedTracksSize = audioPrivateTracks.size() +
videoPrivateTracks.size();
> + unsigned tracksSize = m_audioPrivateTracks.size() +
m_videoPrivateTracks.size();
I don't think these local variables are necessary.
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp:163
> + for (size_t i = 0; i < sourceVector.size(); ++i) {
> + if (id == sourceVector[i]->id())
> + return true;
> }
> +
> + return false;
Can you use sourceVector.find() here?
> Source/WebCore/platform/mediastream/MediaStreamDescriptor.h:59
> + static PassRefPtr<MediaStreamDescriptor> create(const
MediaStreamSourceVector& audioSources, const MediaStreamSourceVector&
videoSources);
> + static PassRefPtr<MediaStreamDescriptor> create(const
MediaStreamTrackPrivateVector& audioPrivateTracks, const
MediaStreamTrackPrivateVector& videoPrivateTracks);
Nit: You can return RefPtr here. PassRefPtrs aren't needed since Anders added
move-semantics to the RefPtr class.
> Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h:119
> +typedef Vector<RefPtr<MediaStreamTrackPrivate>>
MediaStreamTrackPrivateVector;
This is unnecessary.
More information about the webkit-reviews
mailing list