Changeset 247347 in webkit


Ignore:
Timestamp:
Jul 11, 2019 3:57:54 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new buffers
https://bugs.webkit.org/show_bug.cgi?id=199689

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-07-11
Reviewed by Philippe Normand.

We already have tests for this.

  • platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:

(WebCore::GStreamerVideoCaptureSource::processNewFrame):
(WebCore::GStreamerVideoCaptureSource::newSampleCallback):

  • platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247344 r247347  
     12019-07-11  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new buffers
     4        https://bugs.webkit.org/show_bug.cgi?id=199689
     5
     6        Reviewed by Philippe Normand.
     7
     8        We already have tests for this.
     9
     10        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
     11        (WebCore::GStreamerVideoCaptureSource::processNewFrame):
     12        (WebCore::GStreamerVideoCaptureSource::newSampleCallback):
     13        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
     14
    1152019-07-10  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp

    r246644 r247347  
    161161}
    162162
     163void GStreamerVideoCaptureSource::processNewFrame(Ref<MediaSample>&& sample)
     164{
     165    if (!isProducingData() || muted())
     166        return;
     167
     168    dispatchMediaSampleToObservers(WTFMove(sample));
     169}
     170
    163171GstFlowReturn GStreamerVideoCaptureSource::newSampleCallback(GstElement* sink, GStreamerVideoCaptureSource* source)
    164172{
     
    166174    auto mediaSample = MediaSampleGStreamer::create(WTFMove(gstSample), WebCore::FloatSize(), String());
    167175
    168     // FIXME - Check how presentationSize is supposed to be used here.
    169     callOnMainThread([protectedThis = makeRef(*source), mediaSample = WTFMove(mediaSample)] {
    170         protectedThis->videoSampleAvailable(mediaSample.get());
     176    source->scheduleDeferredTask([source, sample = WTFMove(mediaSample)] () mutable {
     177        source->processNewFrame(WTFMove(sample));
    171178    });
    172179
  • trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h

    r246644 r247347  
    4141    GstElement* pipeline() { return m_capturer->pipeline(); }
    4242    GStreamerCapturer* capturer() { return m_capturer.get(); }
     43    void processNewFrame(Ref<MediaSample>&&);
    4344
    4445protected:
Note: See TracChangeset for help on using the changeset viewer.