Bug 191189 - [GStreamer] Move elements registration to GStreamerCommon
Summary: [GStreamer] Move elements registration to GStreamerCommon
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks: 191191
  Show dependency treegraph
 
Reported: 2018-11-02 06:09 PDT by Philippe Normand
Modified: 2018-11-05 02:01 PST (History)
2 users (show)

See Also:


Attachments
Patch (11.70 KB, patch)
2018-11-02 06:16 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (12.26 KB, patch)
2018-11-02 10:40 PDT, Philippe Normand
calvaris: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2018-11-02 06:09:20 PDT
This is only a refactoring.
Comment 1 Philippe Normand 2018-11-02 06:16:14 PDT
Created attachment 353690 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2018-11-02 08:14:56 PDT
Comment on attachment 353690 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353690&action=review

> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:53
> +#if ENABLE(VIDEO)

Shouldn't this enclose more of the includes above?

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:-152
> -GST_DEBUG_CATEGORY(webkit_media_player_debug);
> +GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug);
>  #define GST_CAT_DEFAULT webkit_media_player_debug
>  
>  
>  namespace WebCore {
>  using namespace std;
>  
> -bool MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements()
> -{
> -    if (!initializeGStreamer())
> -        return false;
> -
> -    static std::once_flag onceFlag;
> -    std::call_once(onceFlag, [] {
> -        GST_DEBUG_CATEGORY_INIT(webkit_media_player_debug, "webkitmediaplayer", 0, "WebKit media player");

This is conceptually weird for me. The category variable should "live" in Base.cpp and be initialized here since it's the superclass. I understand you really want to get rid of this method but IMHO, I think we should keep a very small version of it because of the initialization of this variable, keep the _CATEGORY( here and have the _CATEGORY_EXTERN( in the subclass.
Comment 3 Philippe Normand 2018-11-02 10:03:39 PDT
Comment on attachment 353690 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353690&action=review

>> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:53
>> +#if ENABLE(VIDEO)
> 
> Shouldn't this enclose more of the includes above?

I don't think it's necessary because MSE, MediaStream and EME are already declared as depending on VIDEO in WebKitFeatures.cmake.

>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:-152
>> -        GST_DEBUG_CATEGORY_INIT(webkit_media_player_debug, "webkitmediaplayer", 0, "WebKit media player");
> 
> This is conceptually weird for me. The category variable should "live" in Base.cpp and be initialized here since it's the superclass. I understand you really want to get rid of this method but IMHO, I think we should keep a very small version of it because of the initialization of this variable, keep the _CATEGORY( here and have the _CATEGORY_EXTERN( in the subclass.

The MSE player already uses its own debug category. Maybe we could have a separate category for the base player after all :) Anyway, for the time being i'll keep a small init function then.
Comment 4 Philippe Normand 2018-11-02 10:40:46 PDT
Created attachment 353712 [details]
Patch
Comment 5 Philippe Normand 2018-11-05 02:00:37 PST
Committed r237794: <https://trac.webkit.org/changeset/237794>
Comment 6 Radar WebKit Bug Importer 2018-11-05 02:01:36 PST
<rdar://problem/45802528>