WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
159466
[GStreamer][GL] switch to appsink
https://bugs.webkit.org/show_bug.cgi?id=159466
Summary
[GStreamer][GL] switch to appsink
Philippe Normand
Reported
2016-07-06 06:05:51 PDT
Using fakesink for rendering is a bit weird because usually that element is used in tests. Appsink should be used instead. The following patch will be a refactoring.
Attachments
patch
(6.69 KB, patch)
2016-07-06 06:08 PDT
,
Philippe Normand
cgarcia
: review-
Details
Formatted Diff
Diff
patch
(7.17 KB, patch)
2016-07-06 06:53 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
patch
(8.15 KB, patch)
2016-07-06 06:57 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
patch
(7.24 KB, patch)
2016-07-06 06:59 PDT
,
Philippe Normand
cgarcia
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2016-07-06 06:08:34 PDT
Created
attachment 282884
[details]
patch
Carlos Garcia Campos
Comment 2
2016-07-06 06:19:46 PDT
Comment on
attachment 282884
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=282884&action=review
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:592 > +static GstFlowReturn newSampleCallback(GstElement* sink, gpointer userData) > +{ > + MediaPlayerPrivateGStreamerBase* player = reinterpret_cast<MediaPlayerPrivateGStreamerBase*>(userData);
Since you are casting the callback in the g_signal_connect with G_CALLBACK, you can directly use MediaPlayerPrivateGStreamerBase* as parameter and avoid this cast.
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:595 > + GstSample* sample = gst_app_sink_pull_sample(GST_APP_SINK(sink)); > + > + player->triggerRepaint(sample);
You don't need the local variable, unless triggerRepaint doesn't adopt the sample, in which case, you need the local variable but you are leaking the sample here, since gst_app_sink_pull_sample is transfer full
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:604 > + MediaPlayerPrivateGStreamerBase* player = reinterpret_cast<MediaPlayerPrivateGStreamerBase*>(userData); > + GstSample* sample = gst_app_sink_pull_preroll(GST_APP_SINK(sink)); > + > + player->triggerRepaint(sample);
Same comments here, the sample is leaked
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:133 > + void triggerRepaint(GstSample*); > +
This shouldn't be public, make the callbacks private static members if you need to access private API instead of exposing it.
Philippe Normand
Comment 3
2016-07-06 06:40:18 PDT
Comment on
attachment 282884
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=282884&action=review
>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:133 >> + > > This shouldn't be public, make the callbacks private static members if you need to access private API instead of exposing it.
Why?
Philippe Normand
Comment 4
2016-07-06 06:53:06 PDT
Created
attachment 282886
[details]
patch
Philippe Normand
Comment 5
2016-07-06 06:57:25 PDT
Created
attachment 282887
[details]
patch
Philippe Normand
Comment 6
2016-07-06 06:59:58 PDT
Created
attachment 282889
[details]
patch
Xabier Rodríguez Calvar
Comment 7
2016-07-06 07:44:36 PDT
Comment on
attachment 282889
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=282889&action=review
I leave Carlos the r+ as he reviwed first.
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:176 > + g_signal_handlers_disconnect_matched(appsink.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
Nit that I recommend to change before landing: g_signal_handlers_disconnect_by_data is less complex to use and more readable.
Carlos Garcia Campos
Comment 8
2016-07-06 08:05:31 PDT
(In reply to
comment #3
)
> Comment on
attachment 282884
[details]
> patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=282884&action=review
> > >> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:133 > >> + > > > > This shouldn't be public, make the callbacks private static members if you need to access private API instead of exposing it. > > Why?
Because it's only used internally, you made it public to call it from static functions, not to make it really public API.
Philippe Normand
Comment 9
2016-07-06 23:59:15 PDT
Committed
r202897
: <
http://trac.webkit.org/changeset/202897
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug