sbIGstPlatformInterface.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #ifndef _SB_GSTREAMER_PLATFORM_INTERFACE_H_
28 #define _SB_GSTREAMER_PLATFORM_INTERFACE_H_
29 
30 #include <gst/gst.h>
31 
32 #include <nsIBoxObject.h>
33 #include <nsIDOMDocument.h>
34 #include <nsIDOMKeyEvent.h>
35 #include <nsIDOMMouseEvent.h>
36 #include <nsIWidget.h>
37 
38 /* Internal interface to platform-specific aspects.
39  * TODO: Currently this only handles the video windows, we'll probably need
40  * to add more bits later.
41  */
43 {
44 public:
46 
47  // Resize the available video window to the current size/location of the
48  // video box object.
49  // The actual video will often be smaller, in order to maintain the display
50  // aspect ratio.
51  virtual void ResizeToWindow () = 0;
52 
53  // Get the current fullscreen status (true for fullscreen, false for windowed)
54  virtual bool GetFullscreen () = 0;
55 
56  // Set to fullscreen mode (if fullscreen is true) or windowed mode (if it is
57  // false). If already in this mode, nothing will change.
58  virtual void SetFullscreen (bool fullscreen) = 0;
59 
60  // Set the desired Display Aspect Ratio (DAR). This interface is provided
61  // to allow overriding the aspect ratio (e.g. to display 4:3 content
62  // fullscreen on a 16:9 monitor with no black bars).
63  virtual void SetDisplayAspectRatio (int numerator, int denominator) = 0;
64 
65  // Set a GStreamer video sink element, or, if NULL, create one
66  // appropriate for this platform.
67  virtual GstElement * SetVideoSink (GstElement *aVideoSink) = 0;
68 
69  // Set a GStreamer audio sink element, or, if NULL, create one
70  // appropriate for this platform.
71  virtual GstElement * SetAudioSink (GstElement *aAudioSink) = 0;
72 
73  // Called when a video window is required by the gstreamer element, so
74  // that any necessary setup can be done.
75  virtual void PrepareVideoWindow(GstMessage *aMessage) = 0;
76 
77  /* Set the video box and the underlying video widget */
78  virtual nsresult SetVideoBox(nsIBoxObject *aVideoBox, nsIWidget *aWidget) = 0;
79 
80  /* set the owning document, useful for sending DOM events when required */
81  virtual nsresult SetDocument(nsIDOMDocument *aDocument) = 0;
82 
83 };
84 
85 #endif // _SB_GSTREAMER_PLATFORM_INTERFACE_H_
virtual void SetFullscreen(bool fullscreen)=0
virtual bool GetFullscreen()=0
virtual GstElement * SetVideoSink(GstElement *aVideoSink)=0
virtual nsresult SetVideoBox(nsIBoxObject *aVideoBox, nsIWidget *aWidget)=0
_collectFormDataForFrame aDocument
virtual void PrepareVideoWindow(GstMessage *aMessage)=0
virtual GstElement * SetAudioSink(GstElement *aAudioSink)=0
virtual void SetDisplayAspectRatio(int numerator, int denominator)=0
virtual nsresult SetDocument(nsIDOMDocument *aDocument)=0
virtual void ResizeToWindow()=0