RESOLVED FIXED Bug 44508
[EFL] Add PlatformVideoWindowEfl.cpp for WebKit EFL
https://bugs.webkit.org/show_bug.cgi?id=44508
Summary [EFL] Add PlatformVideoWindowEfl.cpp for WebKit EFL
Gyuyoung Kim
Reported 2010-08-24 02:48:20 PDT
It seems to me that WebKit EFL also needs to have PlatformVideoWindowEfl.cpp in order to use gstreamer as it's video framework.
Attachments
Patch (3.16 KB, patch)
2010-08-24 03:05 PDT, Gyuyoung Kim
no flags
Patch (2.74 KB, patch)
2010-08-25 00:45 PDT, Gyuyoung Kim
no flags
Patch (3.30 KB, patch)
2010-08-25 02:43 PDT, Gyuyoung Kim
mrobinson: review-
Patch (4.08 KB, patch)
2010-08-26 23:58 PDT, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2010-08-24 03:05:55 PDT
Created attachment 65250 [details] Patch I modify PlatformVideoWindow.h and create PlatformVideoWindowEfl.cpp.
Philippe Normand
Comment 2 2010-08-24 03:14:24 PDT
This is needed only for fullscreen video display. You should already be able to use the gst webkitvideo sink. For painting Cairo is used, see ImageGStreamerCairo.cpp ... For EFL you might need a new ImageGStreamer implementation, dunno.
Philippe Normand
Comment 3 2010-08-24 04:28:33 PDT
Comment on attachment 65250 [details] Patch >+#if PLATFORM(EFL) >+#if ENABLE(GLIB_SUPPORT) >+#include <glib.h> >+#endif >+#endif >+ I think the guards can be removed because glib.h is required for the use of gulong below anyway. The only reason why it works currently is that gtk.h includes glib.h > namespace WebCore { > > class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { >@@ -39,12 +45,16 @@ class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { > PlatformVideoWindow(); > ~PlatformVideoWindow(); > >+#if PLATFORM(GTK) > PlatformWindowType* window() const { return m_window; } >+#endif > gulong videoWindowId() const { return m_videoWindowId; } > > private: > gulong m_videoWindowId; >+#if PLATFORM(GTK) > PlatformWindowType* m_videoWindow; >+#endif This is wrong. You need to add a typedef for your platform so PlatformWindowType is valid.
Gyuyoung Kim
Comment 4 2010-08-24 05:15:58 PDT
(In reply to comment #3) > (From update of attachment 65250 [details]) > > >+#if PLATFORM(EFL) > >+#if ENABLE(GLIB_SUPPORT) > >+#include <glib.h> > >+#endif > >+#endif > >+ > > I think the guards can be removed because glib.h is required for the use of gulong below anyway. > The only reason why it works currently is that gtk.h includes glib.h > > > namespace WebCore { > > > > class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { > >@@ -39,12 +45,16 @@ class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { > > PlatformVideoWindow(); > > ~PlatformVideoWindow(); > > > >+#if PLATFORM(GTK) > > PlatformWindowType* window() const { return m_window; } > >+#endif > > > gulong videoWindowId() const { return m_videoWindowId; } > > > > private: > > gulong m_videoWindowId; > >+#if PLATFORM(GTK) > > PlatformWindowType* m_videoWindow; > >+#endif > > This is wrong. You need to add a typedef for your platform so PlatformWindowType is valid. I agree with your opinion. I am going to consider your guidance. Thank you.
Philippe Normand
Comment 5 2010-08-24 08:40:44 PDT
BTW fullscreen video display shouldn't be blocker for an initial HTML5 video support in WebKit EFL. You just need to avoid painting the fullscreen button in your media controls and make the webkitSupportsFullscreen method of the gst player return false in your case.
Gyuyoung Kim
Comment 6 2010-08-24 22:00:55 PDT
(In reply to comment #3) > (From update of attachment 65250 [details]) > > >+#if PLATFORM(EFL) > >+#if ENABLE(GLIB_SUPPORT) > >+#include <glib.h> > >+#endif > >+#endif > >+ > > I think the guards can be removed because glib.h is required for the use of gulong below anyway. > The only reason why it works currently is that gtk.h includes glib.h WebKit EFL doesn't use gtk. So, I include glib.h for EFL. Is this wrong ?
Philippe Normand
Comment 7 2010-08-24 23:13:07 PDT
(In reply to comment #6) > (In reply to comment #3) > > (From update of attachment 65250 [details] [details]) > > > > >+#if PLATFORM(EFL) > > >+#if ENABLE(GLIB_SUPPORT) > > >+#include <glib.h> > > >+#endif > > >+#endif > > >+ > > > > I think the guards can be removed because glib.h is required for the use of gulong below anyway. > > The only reason why it works currently is that gtk.h includes glib.h > > WebKit EFL doesn't use gtk. So, I include glib.h for EFL. Is this wrong ? It is totally right, I was just asking to remove the #ifs
Gyuyoung Kim
Comment 8 2010-08-25 00:45:09 PDT
Created attachment 65381 [details] Patch I define PlatformWindowType for EFL. Thank you.
Philippe Normand
Comment 9 2010-08-25 00:55:49 PDT
Comment on attachment 65381 [details] Patch >--- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h >+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h >@@ -28,6 +28,15 @@ > #if PLATFORM(GTK) > #include <gtk/gtk.h> > typedef GtkWidget PlatformWindowType; >+#elif PLATFORM(EFL) >+#include "Widget.h" >+typedef PlatformWidget PlatformWindowType; >+#endif >+ Oh nice I didn't know about Widget.h So we duplicated efforts here. I think it'd make sense to remove PlatformWindowType and use PlatformWidget directly. >+#if PLATFORM(EFL) >+#if ENABLE(GLIB_SUPPORT) >+#include <glib.h> >+#endif > #endif > I said in previous comment that the #ifs are not necessary. The rest of the patch looks ok to me!
Gyuyoung Kim
Comment 10 2010-08-25 01:03:31 PDT
(In reply to comment #9) > (From update of attachment 65381 [details]) > >--- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h > >+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h > >@@ -28,6 +28,15 @@ > > #if PLATFORM(GTK) > > #include <gtk/gtk.h> > > typedef GtkWidget PlatformWindowType; > >+#elif PLATFORM(EFL) > >+#include "Widget.h" > >+typedef PlatformWidget PlatformWindowType; > >+#endif > >+ > > Oh nice I didn't know about Widget.h > So we duplicated efforts here. I think it'd make sense to remove PlatformWindowType and use PlatformWidget directly. > I wonder how to use PlatformWidget directly. In order to use the PlatformformWidget directly, I think we need to modify code as below, 48 #if PLATFORM(GTK) 49 PlatformWindowType* window() const { return m_window; } 50 #elif PLATFORM(EFL) 51 PlatformWidget* window() const { return m_window; } 52 #endif > >+#if PLATFORM(EFL) > >+#if ENABLE(GLIB_SUPPORT) > >+#include <glib.h> > >+#endif > > #endif > > > > I said in previous comment that the #ifs are not necessary. > > The rest of the patch looks ok to me! I modify above code as below, 31 #elif PLATFORM(EFL) 32 #if ENABLE(GLIB_SUPPORT) 33 #include <glib.h> 34 #endif 35 #include "Widget.h" 36 typedef PlatformWidget PlatformWindowType; 37 #endif Is this ok ?
Philippe Normand
Comment 11 2010-08-25 01:13:27 PDT
(In reply to comment #10) > I wonder how to use PlatformWidget directly. In order to use the PlatformformWidget directly, I think we need to modify code as below, > > 48 #if PLATFORM(GTK) > 49 PlatformWindowType* window() const { return m_window; } > 50 #elif PLATFORM(EFL) > 51 PlatformWidget* window() const { return m_window; } > 52 #endif > > No, it would be best to make the GTK port use PlatformWidget as well, it will all be more coherent and readable. > I modify above code as below, > > 31 #elif PLATFORM(EFL) > 32 #if ENABLE(GLIB_SUPPORT) > 33 #include <glib.h> > 34 #endif > 35 #include "Widget.h" > 36 typedef PlatformWidget PlatformWindowType; > 37 #endif > > Is this ok ? No. I thought I was clear, but it seems not :) glib.h can safely be included *outside* any #ifs like this: #include <glib.h> If you make use of PlatformWidget no #if at all should be needed in this file.
Philippe Normand
Comment 12 2010-08-25 01:27:24 PDT
(In reply to comment #11) > > > I modify above code as below, > > > > 31 #elif PLATFORM(EFL) > > 32 #if ENABLE(GLIB_SUPPORT) > > 33 #include <glib.h> > > 34 #endif > > 35 #include "Widget.h" > > 36 typedef PlatformWidget PlatformWindowType; > > 37 #endif > > > > Is this ok ? > Well I understand your port doesn't have a hard dependency on GLib, so yeah you need guards, maybe like: #if PLATFORM(GTK) || ENABLE(GLIB_SUPPORT) #include <glib.h> #endif ?
Philippe Normand
Comment 13 2010-08-25 01:43:52 PDT
Or even: #if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) #include <glib.h> #endif
Gyuyoung Kim
Comment 14 2010-08-25 02:01:32 PDT
Yes, WebKit EFL doesn't have hard dependency with glib. WebKit EFL should enable ENABLE_GLIB_SUPPORT macro to use glib. If you are ok, I will upload new patch again. +#include "Widget.h" + #if PLATFORM(GTK) #include <gtk/gtk.h> typedef GtkWidget PlatformWindowType; +#elif PLATFORM(EFL) +#include "Widget.h" +typedef PlatformWidget PlatformWindowType; +#endif + +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) +#include <glib.h> #endif
Gyuyoung Kim
Comment 15 2010-08-25 02:02:43 PDT
(In reply to comment #14) > Yes, WebKit EFL doesn't have hard dependency with glib. WebKit EFL should enable ENABLE_GLIB_SUPPORT macro to use glib. If you are ok, I will upload new patch again. > > +#include "Widget.h" > + > #if PLATFORM(GTK) > #include <gtk/gtk.h> > typedef GtkWidget PlatformWindowType; > +#elif PLATFORM(EFL) > +#include "Widget.h" > +typedef PlatformWidget PlatformWindowType; > +#endif > + > +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) > +#include <glib.h> > #endif Sorry, please remove "#include "Widget.h" > +#include "Widget.h" > +
Philippe Normand
Comment 16 2010-08-25 02:17:48 PDT
(In reply to comment #15) > > #if PLATFORM(GTK) > > #include <gtk/gtk.h> > > typedef GtkWidget PlatformWindowType; > > +#elif PLATFORM(EFL) > > +#include "Widget.h" > > +typedef PlatformWidget PlatformWindowType; > > +#endif > > + > > +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) > > +#include <glib.h> > > #endif > Ok much better, what about PlatformWidget use for the GTK port too? I would be willing to test such patch :) Also PlatformWidget is a pointer already. So you need to update the declarations of ::window(), m_videoWindow and m_window accordingly.
Gyuyoung Kim
Comment 17 2010-08-25 02:43:54 PDT
Created attachment 65388 [details] Patch I modify this patch according to your guidance. I built WebKit GTK based on this patch as well. There was no build breaks.
Philippe Normand
Comment 18 2010-08-25 02:58:32 PDT
Comment on attachment 65388 [details] Patch Nice, thanks :) One last thing (from my side, at least): > #if PLATFORM(GTK) > #include <gtk/gtk.h> >-typedef GtkWidget PlatformWindowType; >+#endif That #if can be removed all together. We no longer require to include gtk.h there but then we should move it to PlatformVideoWindowGtk.cpp I think. But as this patch is EFL-specific I can make that change myself in a separate patch.
Gyuyoung Kim
Comment 19 2010-08-25 03:04:19 PDT
(In reply to comment #18) > (From update of attachment 65388 [details]) > Nice, thanks :) > One last thing (from my side, at least): > > > #if PLATFORM(GTK) > > #include <gtk/gtk.h> > >-typedef GtkWidget PlatformWindowType; > >+#endif > > That #if can be removed all together. We no longer require to include gtk.h there but then we should move it to PlatformVideoWindowGtk.cpp I think. But as this patch is EFL-specific I can make that change myself in a separate patch. I couldn't remove "#include <gtk/gtk.h>" because of build error in PlatformVideoWindowGtk.cpp. If you want to move "#include <gtk/gtk.h>" to PlatformVideoWindowGtk.cpp, I can do it new patch. Do you want ?
Philippe Normand
Comment 20 2010-08-25 03:13:42 PDT
(In reply to comment #19) > (In reply to comment #18) > > (From update of attachment 65388 [details] [details]) > > Nice, thanks :) > > One last thing (from my side, at least): > > > > > #if PLATFORM(GTK) > > > #include <gtk/gtk.h> > > >-typedef GtkWidget PlatformWindowType; > > >+#endif > > > > That #if can be removed all together. We no longer require to include gtk.h there but then we should move it to PlatformVideoWindowGtk.cpp I think. But as this patch is EFL-specific I can make that change myself in a separate patch. > > I couldn't remove "#include <gtk/gtk.h>" because of build error in PlatformVideoWindowGtk.cpp. If you want to move "#include <gtk/gtk.h>" to PlatformVideoWindowGtk.cpp, I can do it new patch. Do you want ? In comment 19 I was thinking about yes. Sure, if you want file a new bug and patch after this one lands :)
Gyuyoung Kim
Comment 21 2010-08-25 03:15:39 PDT
(In reply to comment #20) > (In reply to comment #19) > > (In reply to comment #18) > > > (From update of attachment 65388 [details] [details] [details]) > > > Nice, thanks :) > > > One last thing (from my side, at least): > > > > > > > #if PLATFORM(GTK) > > > > #include <gtk/gtk.h> > > > >-typedef GtkWidget PlatformWindowType; > > > >+#endif > > > > > > That #if can be removed all together. We no longer require to include gtk.h there but then we should move it to PlatformVideoWindowGtk.cpp I think. But as this patch is EFL-specific I can make that change myself in a separate patch. > > > > I couldn't remove "#include <gtk/gtk.h>" because of build error in PlatformVideoWindowGtk.cpp. If you want to move "#include <gtk/gtk.h>" to PlatformVideoWindowGtk.cpp, I can do it new patch. Do you want ? > > In comment 19 I was thinking about yes. Sure, if you want file a new bug and patch after this one lands :) Sure, I will do that after landing this patch. :) Thanks.
Rafael Antognolli
Comment 22 2010-08-25 07:24:22 PDT
(In reply to comment #12) > (In reply to comment #11) > > > > > I modify above code as below, > > > > > > 31 #elif PLATFORM(EFL) > > > 32 #if ENABLE(GLIB_SUPPORT) > > > 33 #include <glib.h> > > > 34 #endif > > > 35 #include "Widget.h" > > > 36 typedef PlatformWidget PlatformWindowType; > > > 37 #endif > > > > > > Is this ok ? > > > > Well I understand your port doesn't have a hard dependency on GLib, so yeah you need guards, maybe like: > > #if PLATFORM(GTK) || ENABLE(GLIB_SUPPORT) > #include <glib.h> > #endif > > ? Actually, no guards are needed since Gyuyoung's patch is for gstreamer video backend, and gstreamer needs glib anyway. We even force ENABLE_GLIB_SUPPORT if ENABLE_VIDEO_SUPPORT is true. Maybe if later another video implementation that doesn't use gstreamer is available, the yes, we could make this optional. And I think the following line (unless changed to something else with ifdefs too) wouldn't compile without #include <glib.h>: gulong videoWindowId() const { return m_videoWindowId; }
Gyuyoung Kim
Comment 23 2010-08-26 18:07:02 PDT
Hello Philippe Normand, Who can review this patch ?
Philippe Normand
Comment 24 2010-08-26 22:58:26 PDT
(In reply to comment #23) > Hello Philippe Normand, > > Who can review this patch ? Well Rafael is right about including glib.h without guards. Then either Xan, Martin or Gustavo could review it maybe
Martin Robinson
Comment 25 2010-08-26 23:14:05 PDT
Comment on attachment 65388 [details] Patch > +#include "Widget.h" > + > #include <wtf/PassRefPtr.h> Please remove this extra line. There is no need to separate the include styles. > #if PLATFORM(GTK) > #include <gtk/gtk.h> > -typedef GtkWidget PlatformWindowType; > +#endif > + > +#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) > +#include <glib.h> > #endif Is the only reason for these #ifdefs and #includes gulong? Having GLib and/or GTK+ includes in a header files can increase the compilation time unecessarily. If possible, please just use unsigned long instead of gulong and remove all the #ifdefs and #includes. Thanks! > diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp Should this also be added to the CMake build scripts?
Gyuyoung Kim
Comment 26 2010-08-26 23:58:49 PDT
Created attachment 65682 [details] Patch Thanks, I fix this patch according to your comment. I move the "#include <gtk/gtk.h>" to PlatformVideoWindowGtk.cpp. BTW, I add the PlatformVideoWindowEfl.cpp to CMakeListEfl.txt in Bug 44098. (Bug 44098 is blocked by this bug.) Because, I want to add this file together with other files regarding gstreamer. So, the PlatformVideoWindowEfl.cpp will be added after landing this patch.
Gyuyoung Kim
Comment 27 2010-08-29 19:27:31 PDT
Hello Martin Robinson, Please review again. :)
Gyuyoung Kim
Comment 28 2010-08-31 19:30:56 PDT
Hello Martin Robinson, I am looking forward to land this patch in mainline. I'd like to get your opinion regarding your patch.
Gyuyoung Kim
Comment 29 2010-08-31 22:01:40 PDT
wrong expression : "your patch" => "my patch"
Martin Robinson
Comment 30 2010-08-31 22:23:42 PDT
Comment on attachment 65682 [details] Patch LGTM.
WebKit Commit Bot
Comment 31 2010-08-31 23:05:14 PDT
Comment on attachment 65682 [details] Patch Clearing flags on attachment: 65682 Committed r66578: <http://trac.webkit.org/changeset/66578>
WebKit Commit Bot
Comment 32 2010-08-31 23:05:20 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.