Changeset 229997 in webkit
- Timestamp:
- Mar 27, 2018 9:25:52 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229995 r229997 1 2018-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 1 26 2018-03-27 Eric Carlson <eric.carlson@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r229895 r229997 324 324 const gchar* contextType; 325 325 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)); 327 327 328 328 #if USE(GSTREAMER_GL) … … 341 341 return false; 342 342 } 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"); 344 344 LockHolder lock(m_protectionMutex); 345 345 std::pair<Vector<GRefPtr<GstEvent>>, Vector<String>> streamEncryptionInformation = extractEventsAndSystemsFromMessage(message); … … 361 361 } 362 362 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 363 GST_MEMDUMP("init data", reinterpret_cast<const unsigned char*>(mapInfo.data), mapInfo.size); 364 364 concatenatedInitDataChunks.append(mapInfo.data, mapInfo.size); 365 365 ++concatenatedInitDataChunksNumber; … … 382 382 return; 383 383 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()); 385 385 GST_MEMDUMP("init datas", initData.data(), initData.size()); 386 386 weakThis->m_player->initializationDataEncountered(ASCIILiteral("cenc"), ArrayBuffer::create(initData.data(), initData.size())); 387 387 }); 388 388 389 GST_INFO ("waiting for a CDM instance");389 GST_INFO_OBJECT(pipeline(), "waiting for a CDM instance"); 390 390 m_protectionCondition.waitFor(m_protectionMutex, Seconds(4), [this] { 391 391 return this->m_cdmInstance; … … 393 393 if (m_cdmInstance && !m_cdmInstance->keySystem().isEmpty()) { 394 394 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)); 396 396 397 397 GRefPtr<GstContext> context = adoptGRef(gst_context_new("drm-preferred-decryption-system-id", FALSE)); … … 448 448 #if USE(GLX) 449 449 if (is<PlatformDisplayX11>(sharedDisplay)) { 450 GST_DEBUG ("Creating X11 shared GL display");450 GST_DEBUG_OBJECT(pipeline(), "Creating X11 shared GL display"); 451 451 if (shouldAdoptRef) 452 452 m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()))); … … 456 456 #elif USE(EGL) 457 457 if (is<PlatformDisplayX11>(sharedDisplay)) { 458 GST_DEBUG ("Creating X11 shared EGL display");458 GST_DEBUG_OBJECT(pipeline(), "Creating X11 shared EGL display"); 459 459 if (shouldAdoptRef) 460 460 m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).eglDisplay()))); … … 467 467 #if PLATFORM(WAYLAND) 468 468 if (is<PlatformDisplayWayland>(sharedDisplay)) { 469 GST_DEBUG ("Creating Wayland shared display");469 GST_DEBUG_OBJECT(pipeline(), "Creating Wayland shared display"); 470 470 if (shouldAdoptRef) 471 471 m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).eglDisplay()))); … … 477 477 #if PLATFORM(WPE) 478 478 ASSERT(is<PlatformDisplayWPE>(sharedDisplay)); 479 GST_DEBUG ("Creating WPE shared EGL display");479 GST_DEBUG_OBJECT(pipeline(), "Creating WPE shared EGL display"); 480 480 if (shouldAdoptRef) 481 481 m_glDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWPE>(sharedDisplay).eglDisplay()))); … … 551 551 #endif 552 552 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); 555 555 556 556 // Calculate DAR based on PAR and video size. … … 566 566 guint64 width = 0, height = 0; 567 567 if (!(originalSize.height() % displayHeight)) { 568 GST_DEBUG ("Keeping video original height");568 GST_DEBUG_OBJECT(pipeline(), "Keeping video original height"); 569 569 width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight); 570 570 height = static_cast<guint64>(originalSize.height()); 571 571 } else if (!(originalSize.width() % displayWidth)) { 572 GST_DEBUG ("Keeping video original width");572 GST_DEBUG_OBJECT(pipeline(), "Keeping video original width"); 573 573 height = gst_util_uint64_scale_int(originalSize.width(), displayHeight, displayWidth); 574 574 width = static_cast<guint64>(originalSize.width()); 575 575 } else { 576 GST_DEBUG ("Approximating while keeping original video height");576 GST_DEBUG_OBJECT(pipeline(), "Approximating while keeping original video height"); 577 577 width = gst_util_uint64_scale_int(originalSize.height(), displayWidth, displayHeight); 578 578 height = static_cast<guint64>(originalSize.height()); 579 579 } 580 580 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); 582 582 m_videoSize = FloatSize(static_cast<int>(width), static_cast<int>(height)); 583 583 return m_videoSize; … … 589 589 return; 590 590 591 GST_DEBUG ("Setting volume: %f", volume);591 GST_DEBUG_OBJECT(pipeline(), "Setting volume: %f", volume); 592 592 gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_CUBIC, static_cast<double>(volume)); 593 593 } … … 618 618 { 619 619 // 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()); 621 621 622 622 player->m_notifier->notify(MainThreadNotification::VolumeChanged, [player] { player->notifyPlayerOfVolumeChange(); }); … … 647 647 return; 648 648 649 GST_INFO ("Set muted to %s", toString(mute).utf8().data());649 GST_INFO_OBJECT(pipeline(), "Set muted to %s", toString(mute).utf8().data()); 650 650 g_object_set(m_volumeElement.get(), "mute", mute, nullptr); 651 651 } … … 658 658 gboolean muted; 659 659 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()); 661 661 return muted; 662 662 } … … 797 797 798 798 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"); 800 800 m_notifier->notify(MainThreadNotification::SizeChanged, [this] { m_player->sizeChanged(); }); 801 801 } … … 865 865 void MediaPlayerPrivateGStreamerBase::flushCurrentBuffer() 866 866 { 867 GST_DEBUG ("Flushing video sample");867 GST_DEBUG_OBJECT(pipeline(), "Flushing video sample"); 868 868 WTF::GMutexLocker<GMutex> lock(m_sampleMutex); 869 869 m_sample.clear(); … … 1152 1152 // https://bugs.webkit.org/show_bug.cgi?id=118974 for more information. 1153 1153 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()); 1155 1155 g_object_set(m_volumeElement.get(), "volume", m_player->volume(), nullptr); 1156 1156 } 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()); 1160 1160 g_object_set(m_volumeElement.get(), "mute", m_player->muted(), nullptr); 1161 1161 … … 1209 1209 ASSERT(!m_cdmInstance); 1210 1210 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()); 1212 1212 m_protectionCondition.notifyAll(); 1213 1213 } … … 1219 1219 #endif 1220 1220 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()); 1222 1222 m_cdmInstance = nullptr; 1223 1223 m_protectionCondition.notifyAll(); … … 1238 1238 void MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey(GstBuffer* buffer) 1239 1239 { 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, 1241 1241 gst_structure_new("drm-cipher", "key", GST_TYPE_BUFFER, buffer, nullptr))); 1242 1242 m_needToResendCredentials = m_handledProtectionEvents.size() > 0; … … 1247 1247 { 1248 1248 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)); 1250 1250 m_handledProtectionEvents.remove(GST_EVENT_SEQNUM(event)); 1251 1251 if (m_needToResendCredentials) { 1252 GST_DEBUG ("resending credentials");1252 GST_DEBUG_OBJECT(pipeline(), "resending credentials"); 1253 1253 attemptToDecryptWithLocalInstance(); 1254 1254 }
Note: See TracChangeset
for help on using the changeset viewer.