Bug 89314 - [GStreamer] optimize ::naturalSize()
Summary: [GStreamer] optimize ::naturalSize()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-17 12:28 PDT by Philippe Normand
Modified: 2012-06-17 19:43 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.13 KB, patch)
2012-06-17 12:39 PDT, Philippe Normand
mrobinson: 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 2012-06-17 12:28:53 PDT
Above method is called very often. It calls webkitGstElementGetPadCaps() which gets the video sink sinkpad every time. Instead we should simply keep track of that sinkpad in the player and change webkitGstElementGetPadCaps() to webkitGstGetPadCaps(GstPad* pad).
Comment 1 Philippe Normand 2012-06-17 12:39:12 PDT
Created attachment 148020 [details]
Patch
Comment 2 Martin Robinson 2012-06-17 19:19:38 PDT
Comment on attachment 148020 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp:24
>  #include "GStreamerVersioning.h"
>  
> +#include <gst/gst.h>

No space necessary here.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1679
> +    m_videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink, "sink"));

Are there any situations where the sink can change?
Comment 3 Philippe Normand 2012-06-17 19:23:21 PDT
(In reply to comment #2)
> 
> > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1679
> > +    m_videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink, "sink"));
> 
> Are there any situations where the sink can change?

Not in this pipeline configuration. The video-sink is configured using a property of playbin2, which is set only once, in the ::createGSTPlayBin() method.

Thanks for the review!
Comment 4 Philippe Normand 2012-06-17 19:41:18 PDT
(In reply to comment #2)
> (From update of attachment 148020 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=148020&action=review
> 
> > Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp:24
> >  #include "GStreamerVersioning.h"
> >  
> > +#include <gst/gst.h>
> 
> No space necessary here.
>

Actually it is necessary. Otherwise the style bot complains:


Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp:22:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 1 files
Comment 5 Philippe Normand 2012-06-17 19:43:48 PDT
Committed r120563: <http://trac.webkit.org/changeset/120563>