Changeset 229997 in webkit


Ignore:
Timestamp:
Mar 27, 2018 9:25:52 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Enhance debugging in the BasePlayer
https://bugs.webkit.org/show_bug.cgi?id=184035

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-03-27
Reviewed by Philippe Normand.

No behaviour changes so no test were added/enabled.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
(WebCore::MediaPlayerPrivateGStreamerBase::muted const):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r229995 r229997  
     12018-03-27  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GStreamer] Enhance debugging in the BasePlayer
     4        https://bugs.webkit.org/show_bug.cgi?id=184035
     5
     6        Reviewed by Philippe Normand.
     7
     8        No behaviour changes so no test were added/enabled.
     9
     10        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     11        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
     12        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
     13        (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
     14        (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
     15        (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
     16        (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
     17        (WebCore::MediaPlayerPrivateGStreamerBase::muted const):
     18        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
     19        (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
     20        (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
     21        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
     22        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
     23        (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
     24        (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
     25
    1262018-03-27  Eric Carlson  <eric.carlson@apple.com>
    227
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r229895 r229997  
    324324    const gchar* contextType;
    325325    gst_message_parse_context_type(message, &contextType);
    326     GST_DEBUG("Handling %s need-context message for %s", contextType, GST_MESSAGE_SRC_NAME(message));
     326    GST_DEBUG_OBJECT(pipeline(), "Handling %s need-context message for %s", contextType, GST_MESSAGE_SRC_NAME(message));
    327327
    328328#if USE(GSTREAMER_GL)
     
    341341            return false;
    342342        }
    343         GST_DEBUG("handling drm-preferred-decryption-system-id need context message");
     343        GST_DEBUG_OBJECT(pipeline(), "handling drm-preferred-decryption-system-id need context message");
    344344        LockHolder lock(m_protectionMutex);
    345345        std::pair<Vector<GRefPtr<GstEvent>>, Vector<String>> streamEncryptionInformation = extractEventsAndSystemsFromMessage(message);
     
    361361            }
    362362            GST_TRACE("appending init data for %s of size %" G_GSIZE_FORMAT, eventKeySystemId, mapInfo.size);
    363             GST_MEMDUMP("init data", reinterpret_cast<const unsigned char *>(mapInfo.data), mapInfo.size);
     363            GST_MEMDUMP("init data", reinterpret_cast<const unsigned char*>(mapInfo.data), mapInfo.size);
    364364            concatenatedInitDataChunks.append(mapInfo.data, mapInfo.size);
    365365            ++concatenatedInitDataChunksNumber;
     
    382382                return;
    383383
    384             GST_DEBUG("scheduling initializationDataEncountered event for %s with concatenated init datas size of %" G_GSIZE_FORMAT, eventKeySystemIdString.utf8().data(), initData.size());
     384            GST_DEBUG_OBJECT(weakThis->pipeline(), "scheduling initializationDataEncountered event for %s with concatenated init datas size of %" G_GSIZE_FORMAT, eventKeySystemIdString.utf8().data(), initData.size());
    385385            GST_MEMDUMP("init datas", initData.data(), initData.size());
    386386            weakThis->m_player->initializationDataEncountered(ASCIILiteral("cenc"), ArrayBuffer::create(initData.data(), initData.size()));
    387387        });
    388388
    389         GST_INFO("waiting for a CDM instance");
     389        GST_INFO_OBJECT(pipeline(), "waiting for a CDM instance");
    390390        m_protectionCondition.waitFor(m_protectionMutex, Seconds(4), [this] {
    391391            return this->m_cdmInstance;
     
    393393        if (m_cdmInstance && !m_cdmInstance->keySystem().isEmpty()) {
    394394            const char* preferredKeySystemUuid = GStreamerEMEUtilities::keySystemToUuid(m_cdmInstance->keySystem());
    395             GST_INFO("working with %s, continuing with %s on %s", m_cdmInstance->keySystem().utf8().data(), preferredKeySystemUuid, GST_MESSAGE_SRC_NAME(message));
     395            GST_INFO_OBJECT(pipeline(), "working with %s, continuing with %s on %s", m_cdmInstance->keySystem().utf8().data(), preferredKeySystemUuid, GST_MESSAGE_SRC_NAME(message));
    396396
    397397            GRefPtr<GstContext> context = adoptGRef(gst_context_new("drm-preferred-decryption-system-id", FALSE));
     
    448448#if USE(GLX)
    449449        if (is<PlatformDisplayX11>(sharedDisplay)) {
    450             GST_DEBUG("Creating X11 shared GL display");
     450            GST_DEBUG_OBJECT(pipeline(), "Creating X11 shared GL display");
    451451            if (shouldAdoptRef)
    452452                m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native())));
     
    456456#elif USE(EGL)
    457457        if (is<PlatformDisplayX11>(sharedDisplay)) {
    458             GST_DEBUG("Creating X11 shared EGL display");
     458            GST_DEBUG_OBJECT(pipeline(), "Creating X11 shared EGL display");
    459459            if (shouldAdoptRef)
    460460                m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).eglDisplay())));
     
    467467#if PLATFORM(WAYLAND)
    468468        if (is<PlatformDisplayWayland>(sharedDisplay)) {
    469             GST_DEBUG("Creating Wayland shared display");
     469            GST_DEBUG_OBJECT(pipeline(), "Creating Wayland shared display");
    470470            if (shouldAdoptRef)
    471471                m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).eglDisplay())));
     
    477477#if PLATFORM(WPE)
    478478        ASSERT(is<PlatformDisplayWPE>(sharedDisplay));
    479         GST_DEBUG("Creating WPE shared EGL display");
     479        GST_DEBUG_OBJECT(pipeline(), "Creating WPE shared EGL display");
    480480        if (shouldAdoptRef)
    481481            m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWPE>(sharedDisplay).eglDisplay())));
     
    551551#endif
    552552
    553     GST_DEBUG("Original video size: %dx%d", originalSize.width(), originalSize.height());
    554     GST_DEBUG("Pixel aspect ratio: %d/%d", pixelAspectRatioNumerator, pixelAspectRatioDenominator);
     553    GST_DEBUG_OBJECT(pipeline(), "Original video size: %dx%d", originalSize.width(), originalSize.height());
     554    GST_DEBUG_OBJECT(pipeline(), "Pixel aspect ratio: %d/%d", pixelAspectRatioNumerator, pixelAspectRatioDenominator);
    555555
    556556    // Calculate DAR based on PAR and video size.
     
    566566    guint64 width = 0, height = 0;
    567567    if (!(originalSize.height() % displayHeight)) {
    568         GST_DEBUG("Keeping video original height");
     568        GST_DEBUG_OBJECT(pipeline(), "Keeping video original height");
    569569        width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight);
    570570        height = static_cast<guint64>(originalSize.height());
    571571    } else if (!(originalSize.width() % displayWidth)) {
    572         GST_DEBUG("Keeping video original width");
     572        GST_DEBUG_OBJECT(pipeline(), "Keeping video original width");
    573573        height = gst_util_uint64_scale_int(originalSize.width(), displayHeight, displayWidth);
    574574        width = static_cast<guint64>(originalSize.width());
    575575    } else {
    576         GST_DEBUG("Approximating while keeping original video height");
     576        GST_DEBUG_OBJECT(pipeline(), "Approximating while keeping original video height");
    577577        width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight);
    578578        height = static_cast<guint64>(originalSize.height());
    579579    }
    580580
    581     GST_DEBUG("Natural size: %" G_GUINT64_FORMAT "x%" G_GUINT64_FORMAT, width, height);
     581    GST_DEBUG_OBJECT(pipeline(), "Natural size: %" G_GUINT64_FORMAT "x%" G_GUINT64_FORMAT, width, height);
    582582    m_videoSize = FloatSize(static_cast<int>(width), static_cast<int>(height));
    583583    return m_videoSize;
     
    589589        return;
    590590
    591     GST_DEBUG("Setting volume: %f", volume);
     591    GST_DEBUG_OBJECT(pipeline(), "Setting volume: %f", volume);
    592592    gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_CUBIC, static_cast<double>(volume));
    593593}
     
    618618{
    619619    // This is called when m_volumeElement receives the notify::volume signal.
    620     GST_DEBUG("Volume changed to: %f", player->volume());
     620    GST_DEBUG_OBJECT(player->pipeline(), "Volume changed to: %f", player->volume());
    621621
    622622    player->m_notifier->notify(MainThreadNotification::VolumeChanged, [player] { player->notifyPlayerOfVolumeChange(); });
     
    647647        return;
    648648
    649     GST_INFO("Set muted to %s", toString(mute).utf8().data());
     649    GST_INFO_OBJECT(pipeline(), "Set muted to %s", toString(mute).utf8().data());
    650650    g_object_set(m_volumeElement.get(), "mute", mute, nullptr);
    651651}
     
    658658    gboolean muted;
    659659    g_object_get(m_volumeElement.get(), "mute", &muted, nullptr);
    660     GST_INFO("Player is muted: %s", toString(static_cast<bool>(muted)).utf8().data());
     660    GST_INFO_OBJECT(pipeline(), "Player is muted: %s", toString(static_cast<bool>(muted)).utf8().data());
    661661    return muted;
    662662}
     
    797797
    798798    if (triggerResize) {
    799         GST_DEBUG("First sample reached the sink, triggering video dimensions update");
     799        GST_DEBUG_OBJECT(pipeline(), "First sample reached the sink, triggering video dimensions update");
    800800        m_notifier->notify(MainThreadNotification::SizeChanged, [this] { m_player->sizeChanged(); });
    801801    }
     
    865865void MediaPlayerPrivateGStreamerBase::flushCurrentBuffer()
    866866{
    867     GST_DEBUG("Flushing video sample");
     867    GST_DEBUG_OBJECT(pipeline(), "Flushing video sample");
    868868    WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
    869869    m_sample.clear();
     
    11521152    // https://bugs.webkit.org/show_bug.cgi?id=118974 for more information.
    11531153    if (!m_player->platformVolumeConfigurationRequired()) {
    1154         GST_DEBUG("Setting stream volume to %f", m_player->volume());
     1154        GST_DEBUG_OBJECT(pipeline(), "Setting stream volume to %f", m_player->volume());
    11551155        g_object_set(m_volumeElement.get(), "volume", m_player->volume(), nullptr);
    11561156    } else
    1157         GST_DEBUG("Not setting stream volume, trusting system one");
    1158 
    1159     GST_DEBUG("Setting stream muted %s", toString(m_player->muted()).utf8().data());
     1157        GST_DEBUG_OBJECT(pipeline(), "Not setting stream volume, trusting system one");
     1158
     1159    GST_DEBUG_OBJECT(pipeline(), "Setting stream muted %s", toString(m_player->muted()).utf8().data());
    11601160    g_object_set(m_volumeElement.get(), "mute", m_player->muted(), nullptr);
    11611161
     
    12091209    ASSERT(!m_cdmInstance);
    12101210    m_cdmInstance = &instance;
    1211     GST_DEBUG("CDM instance %p set", m_cdmInstance.get());
     1211    GST_DEBUG_OBJECT(pipeline(), "CDM instance %p set", m_cdmInstance.get());
    12121212    m_protectionCondition.notifyAll();
    12131213}
     
    12191219#endif
    12201220    ASSERT(m_cdmInstance.get() == &instance);
    1221     GST_DEBUG("detaching CDM instance %p", m_cdmInstance.get());
     1221    GST_DEBUG_OBJECT(pipeline(), "detaching CDM instance %p", m_cdmInstance.get());
    12221222    m_cdmInstance = nullptr;
    12231223    m_protectionCondition.notifyAll();
     
    12381238void MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey(GstBuffer* buffer)
    12391239{
    1240     bool eventHandled = gst_element_send_event(m_pipeline.get(), gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB,
     1240    bool eventHandled = gst_element_send_event(pipeline(), gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB,
    12411241        gst_structure_new("drm-cipher", "key", GST_TYPE_BUFFER, buffer, nullptr)));
    12421242    m_needToResendCredentials = m_handledProtectionEvents.size() > 0;
     
    12471247{
    12481248    if (m_handledProtectionEvents.contains(GST_EVENT_SEQNUM(event))) {
    1249         GST_DEBUG("event %u already handled", GST_EVENT_SEQNUM(event));
     1249        GST_DEBUG_OBJECT(pipeline(), "event %u already handled", GST_EVENT_SEQNUM(event));
    12501250        m_handledProtectionEvents.remove(GST_EVENT_SEQNUM(event));
    12511251        if (m_needToResendCredentials) {
    1252             GST_DEBUG("resending credentials");
     1252            GST_DEBUG_OBJECT(pipeline(), "resending credentials");
    12531253            attemptToDecryptWithLocalInstance();
    12541254        }
Note: See TracChangeset for help on using the changeset viewer.