void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstSample* sample)
{
    {
        WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
        m_sample = sample;
    }

#if USE(GSTREAMER_GL)
    {
        ASSERT(!isMainThread());

        WTF::GMutexLocker<GMutex> lock(m_drawMutex);

        m_drawTimerHandler.schedule("[WebKit] video render", [this] {
            // Rendering should be done from the main thread
            // because this is where the GL APIs were initialized.
            WTF::GMutexLocker<GMutex> lock(m_drawMutex);
#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
            if (supportsAcceleratedRendering() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player) && client())
                client()->setPlatformLayerNeedsDisplay();
            g_cond_signal(&m_drawCondition);
#endif
        });
        g_cond_wait(&m_drawCondition, &m_drawMutex);
    }

#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
    if (supportsAcceleratedRendering() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player) && client()) {
        client()->setPlatformLayerNeedsDisplay();
        return;
    }
#endif

    m_player->repaint();
}
Exemple #2
0
void WebMediaPlayerClientImpl::readyStateChanged()
{
    ASSERT(m_mediaPlayer);
    m_mediaPlayer->readyStateChanged();
    if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer.get())
        m_videoLayer = VideoLayerChromium::create(0, this);
}
Exemple #3
0
void WebMediaPlayerClientImpl::repaint()
{
    ASSERT(m_mediaPlayer);
#if USE(ACCELERATED_COMPOSITING)
    if (m_videoLayer.get() && supportsAcceleratedRendering())
        m_videoLayer->setNeedsDisplay(FloatRect(0, 0, m_videoLayer->bounds().width(), m_videoLayer->bounds().height()));
#endif
    m_mediaPlayer->repaint();
}
Exemple #4
0
void WebMediaPlayerClientImpl::readyStateChanged()
{
    ASSERT(m_mediaPlayer);
    m_mediaPlayer->readyStateChanged();
#if USE(ACCELERATED_COMPOSITING)
    if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer.get())
        m_videoLayer = VideoLayerChromium::create(0, this);
#endif
}
MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::preferredRenderingMode() const
{
    if (!m_player->visible() || assetStatus() == MediaPlayerAVAssetStatusUnknown)
        return MediaRenderingNone;

    if (supportsAcceleratedRendering() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player))
        return MediaRenderingToLayer;

    return MediaRenderingToContext;
}
MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::preferredRenderingMode() const
{
    if (!m_player->visible() || !m_player->frameView() || assetStatus() == MediaPlayerAVAssetStatusUnknown)
        return MediaRenderingNone;

#if USE(ACCELERATED_COMPOSITING)
    if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player))
        return MediaRenderingToLayer;
#endif

    return MediaRenderingToContext;
}
void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstBuffer* buffer)
{
    g_return_if_fail(GST_IS_BUFFER(buffer));

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
    if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player))
        updateTexture(buffer);
    else
#endif
    {
        g_mutex_lock(m_bufferMutex);
        gst_buffer_replace(&m_buffer, buffer);
        g_mutex_unlock(m_bufferMutex);
        m_player->repaint();
    }
}
void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstBuffer* buffer)
{
    g_return_if_fail(GST_IS_BUFFER(buffer));

    {
        GMutexLocker lock(m_bufferMutex);
        gst_buffer_replace(&m_buffer, buffer);
    }

#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
    if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player) && client()) {
        client()->setPlatformLayerNeedsDisplay();
        return;
    }
#endif

    m_player->repaint();
}
void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstSample* sample)
{
    g_return_if_fail(GST_IS_SAMPLE(sample));

    {
        GMutexLocker<GMutex> lock(m_sampleMutex);
        if (m_sample)
            gst_sample_unref(m_sample);
        m_sample = gst_sample_ref(sample);
    }

#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
    if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player) && client()) {
        client()->setPlatformLayerNeedsDisplay();
        return;
    }
#endif

    m_player->repaint();
}