Bug 188647

Summary: [GStreamer][MSE] Generic main thread notification support
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: PlatformAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: aboya, calvaris, eocanha, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch calvaris: review+, calvaris: commit-queue-

Philippe Normand
Reported 2018-08-16 06:26:18 PDT
I did this only for the playback pipeline because reusing the player bus like this is not optimal. The same approach could be used in the append pipeline but it's less critical because a new bus is created there.
Attachments
Patch (8.00 KB, patch)
2018-08-16 06:29 PDT, Philippe Normand
calvaris: review+
calvaris: commit-queue-
Philippe Normand
Comment 1 2018-08-16 06:29:11 PDT
Xabier Rodríguez Calvar
Comment 2 2018-08-17 00:47:19 PDT
Comment on attachment 347258 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=347258&action=review > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:126 > case MediaSourceSeekToTime: { > - GstStructure* structure = gst_structure_new_empty("seek-needs-data"); > - GstMessage* message = gst_message_new_application(GST_OBJECT(appsrc), structure); > - gst_bus_post(webKitMediaSrc->priv->bus.get(), message); > - GST_TRACE("seek-needs-data message posted to the bus"); > + webKitMediaSrc->priv->notifier->notify(MSEMainThreadNotification::SeekNeedsData, [webKitMediaSrc] { > + seekNeedsDataMainThread(webKitMediaSrc); > + }); > break; > } You don't need to enclose the case in { } anymore since we don't have scoped variables. Please, remove them. > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:143 > if (appsrcStream && appsrcStream->type != WebCore::Invalid) { > - GstStructure* structure = gst_structure_new("ready-for-more-samples", "appsrc-stream", G_TYPE_POINTER, appsrcStream, nullptr); > - GstMessage* message = gst_message_new_application(GST_OBJECT(appsrc), structure); > - gst_bus_post(webKitMediaSrc->priv->bus.get(), message); > - GST_TRACE("ready-for-more-samples message posted to the bus"); > + > + webKitMediaSrc->priv->notifier->notify(MSEMainThreadNotification::ReadyForMoreSamples, [webKitMediaSrc, appsrcStream] { > + notifyReadyForMoreSamplesMainThread(webKitMediaSrc, appsrcStream); > + }); > } You don't need the if { } anymore because there is only one clause in it. Please remove them. > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:100 > +enum MSEMainThreadNotification { I guess you preprended MSE to this type because it can collide with other types defined inside other other files. In this case I would strongly encourage you to preprend the whole class and name it WebKitMediaSrcMainThreadNotification. > Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:102 > + SeekNeedsData = 1 << 0, > + ReadyForMoreSamples = 1 << 1 Longshot nit: I think it would be nicer to, at least, begin with these alphabetically sorted. It is not a requirement, but nice to have :)
Alicia Boya García
Comment 3 2018-08-20 03:40:37 PDT
LGTM too.
Philippe Normand
Comment 4 2018-08-21 02:09:00 PDT
Radar WebKit Bug Importer
Comment 5 2018-08-21 02:09:20 PDT
Note You need to log in before you can comment on or make changes to this bug.