当前位置: 首页>>代码示例>>C++>>正文


C++ MediaStreamTrackVector::append方法代码示例

本文整理汇总了C++中MediaStreamTrackVector::append方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaStreamTrackVector::append方法的具体用法?C++ MediaStreamTrackVector::append怎么用?C++ MediaStreamTrackVector::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaStreamTrackVector的用法示例。


在下文中一共展示了MediaStreamTrackVector::append方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: captureStream

MediaStream* HTMLCanvasElementCapture::captureStream(HTMLCanvasElement& element, bool givenFrameRate, double frameRate, ExceptionState& exceptionState)
{
    if (!element.originClean()) {
        exceptionState.throwSecurityError("Canvas is not origin-clean.");
        return nullptr;
    }

    WebMediaStreamTrack track;
    WebSize size(element.width(), element.height());
    OwnPtr<WebCanvasCaptureHandler> handler;
    if (givenFrameRate)
        handler = adoptPtr(Platform::current()->createCanvasCaptureHandler(size, frameRate, &track));
    else
        handler = adoptPtr(Platform::current()->createCanvasCaptureHandler(size, kDefaultFrameRate, &track));
    ASSERT(handler);
    if (!handler) {
        exceptionState.throwDOMException(NotSupportedError, "No CanvasCapture handler can be created.");
        return nullptr;
    }

    MediaStreamTrackVector tracks;
    if (givenFrameRate)
        tracks.append(CanvasCaptureMediaStreamTrack::create(track, &element, handler.release(), frameRate));
    else
        tracks.append(CanvasCaptureMediaStreamTrack::create(track, &element, handler.release()));
    // We want to capture one frame in the beginning.
    element.notifyListenersCanvasChanged();
    return MediaStream::create(element.executionContext(), tracks);
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:29,代码来源:HTMLCanvasElementCapture.cpp

示例2: clone

MediaStream* MediaStream::clone(ExecutionContext* context)
{
    MediaStreamTrackVector tracks;
    for (MediaStreamTrackVector::iterator iter = m_audioTracks.begin(); iter != m_audioTracks.end(); ++iter)
        tracks.append((*iter)->clone(context));
    for (MediaStreamTrackVector::iterator iter = m_videoTracks.begin(); iter != m_videoTracks.end(); ++iter)
        tracks.append((*iter)->clone(context));
    return MediaStream::create(context, tracks);
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:9,代码来源:MediaStream.cpp

示例3: getTracks

MediaStreamTrackVector MediaStream::getTracks()
{
    MediaStreamTrackVector tracks;
    for (MediaStreamTrackVector::iterator iter = m_audioTracks.begin(); iter != m_audioTracks.end(); ++iter)
        tracks.append(iter->get());
    for (MediaStreamTrackVector::iterator iter = m_videoTracks.begin(); iter != m_videoTracks.end(); ++iter)
        tracks.append(iter->get());
    return tracks;
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:9,代码来源:MediaStream.cpp

示例4: trackVectorForType

MediaStreamTrackVector MediaStream::trackVectorForType(RealtimeMediaSource::Type filterType) const
{
    MediaStreamTrackVector tracks;
    for (auto& track : m_trackSet.values()) {
        if (track->source().type() == filterType)
            tracks.append(track);
    }

    return tracks;
}
开发者ID:srinivas-kakarla,项目名称:WebKitForWayland,代码行数:10,代码来源:MediaStream.cpp

示例5: create

RefPtr<MediaStream> MediaStream::clone()
{
    MediaStreamTrackVector clonedTracks;
    clonedTracks.reserveCapacity(m_trackSet.size());

    for (auto& track : m_trackSet.values())
        clonedTracks.append(track->clone());

    return MediaStream::create(*scriptExecutionContext(), clonedTracks);
}
开发者ID:srinivas-kakarla,项目名称:WebKitForWayland,代码行数:10,代码来源:MediaStream.cpp

示例6: captureStream

MediaStream* HTMLCanvasElementCapture::captureStream(
    HTMLCanvasElement& element,
    bool givenFrameRate,
    double frameRate,
    ExceptionState& exceptionState) {
    if (!element.originClean()) {
        exceptionState.throwSecurityError("Canvas is not origin-clean.");
        return nullptr;
    }

    WebMediaStreamTrack track;
    const WebSize size(element.width(), element.height());
    std::unique_ptr<WebCanvasCaptureHandler> handler;
    if (givenFrameRate)
        handler = wrapUnique(Platform::current()->createCanvasCaptureHandler(
                                 size, frameRate, &track));
    else
        handler = wrapUnique(Platform::current()->createCanvasCaptureHandler(
                                 size, kDefaultFrameRate, &track));

    if (!handler) {
        exceptionState.throwDOMException(
            NotSupportedError, "No CanvasCapture handler can be created.");
        return nullptr;
    }

    CanvasCaptureMediaStreamTrack* canvasTrack;
    if (givenFrameRate)
        canvasTrack = CanvasCaptureMediaStreamTrack::create(
                          track, &element, std::move(handler), frameRate);
    else
        canvasTrack = CanvasCaptureMediaStreamTrack::create(track, &element,
                      std::move(handler));
    // We want to capture a frame in the beginning.
    canvasTrack->requestFrame();

    MediaStreamTrackVector tracks;
    tracks.append(canvasTrack);
    return MediaStream::create(element.getExecutionContext(), tracks);
}
开发者ID:mirror,项目名称:chromium,代码行数:40,代码来源:HTMLCanvasElementCapture.cpp


注:本文中的MediaStreamTrackVector::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。