sbGStreamerPipeline.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef _SB_GSTREAMER_PIPELINE_H_
26 #define _SB_GSTREAMER_PIPELINE_H_
27 
28 #include <nsAutoPtr.h>
29 #include <nsCOMPtr.h>
30 #include <nsCOMArray.h>
31 #include <nsStringGlue.h>
32 #include <nsIDOMEventListener.h>
33 #include <nsIDOMWindow.h>
34 #include <nsITimer.h>
35 #include <nsComponentManagerUtils.h>
36 #include <nsIStringBundle.h>
37 #include <nsAutoLock.h>
38 #include <nsIClassInfo.h>
39 
41 
42 #include <sbIGStreamerPipeline.h>
43 #include <sbIMediacoreEventTarget.h>
44 
46 
47 #include <gst/gst.h>
48 
51  public sbIGStreamerPipeline,
53  public nsIClassInfo
54 
55 {
56 public:
58  NS_DECL_NSICLASSINFO
59  NS_DECL_SBIMEDIACOREEVENTTARGET
60  NS_DECL_SBIGSTREAMERPIPELINE
61 
63  virtual ~sbGStreamerPipeline();
64 
65  virtual void HandleMessage(GstMessage *message);
66  virtual PRBool HandleSynchronousMessage(GstMessage *message);
67 
68  nsresult InitGStreamer();
69 
70 protected:
71  virtual void HandleEOSMessage(GstMessage *message);
72  virtual void HandleErrorMessage(GstMessage *message);
73  virtual void HandleWarningMessage(GstMessage *message);
74  virtual void HandleStateChangeMessage(GstMessage *message);
75  virtual void HandleTagMessage(GstMessage *message);
76  virtual void HandleBufferingMessage(GstMessage *message);
77 
78  virtual nsresult OnDestroyPipeline(GstElement *pipeline) { return NS_OK; }
79 
80  virtual nsresult BuildPipeline();
81  virtual nsresult SetupPipeline();
82  virtual nsresult DestroyPipeline();
83 
84  void SetPipelineOp(GStreamer::pipelineOp_t aPipelineOp);
86 
87  void DispatchMediacoreEvent (unsigned long type,
88  nsIVariant *aData = NULL, sbIMediacoreError *aError = NULL);
89 
90  // Get the amount of time the pipeline has been running for.
91  GstClockTime GetRunningTime();
92 
93  // The pipeline we're managing
94  GstElement* mPipeline;
95 
96  // A string describing the resource (filename, URI, etc) being processed
97  // by the pipeline. Only used for informational purposes (error messages, etc)
99 
100  // The total time the pipeline has been running (not including the time from
101  // mTimeStarted to now, if mTimeStarted != -1)
102  GstClockTime mTimeRunning;
103 
104  // The last time that the pipeline was started
105  PRIntervalTime mTimeStarted;
106 
107  // Protect access to the pipeline
108  PRMonitor *mMonitor;
109 
110  // Pipeline Primary Operation
112 
113  nsAutoPtr<sbBaseMediacoreEventTarget> mBaseEventTarget;
114 };
115 
116 #endif // _SB_GSTREAMER_PIPELINE_H_
117 
NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_SBIMEDIACOREEVENTTARGET NS_DECL_SBIGSTREAMERPIPELINE sbGStreamerPipeline()
return NS_OK
GStreamer::pipelineOp_t GetPipelineOp()
nsAutoPtr< sbBaseMediacoreEventTarget > mBaseEventTarget
virtual void HandleBufferingMessage(GstMessage *message)
virtual void HandleErrorMessage(GstMessage *message)
virtual void HandleWarningMessage(GstMessage *message)
virtual nsresult BuildPipeline()
void DispatchMediacoreEvent(unsigned long type, nsIVariant *aData=NULL, sbIMediacoreError *aError=NULL)
virtual void HandleEOSMessage(GstMessage *message)
virtual void HandleStateChangeMessage(GstMessage *message)
GstMessage * message
GStreamer::pipelineOp_t mPipelineOp
virtual void HandleMessage(GstMessage *message)
virtual nsresult SetupPipeline()
void SetPipelineOp(GStreamer::pipelineOp_t aPipelineOp)
PRIntervalTime mTimeStarted
virtual nsresult OnDestroyPipeline(GstElement *pipeline)
virtual nsresult DestroyPipeline()
virtual PRBool HandleSynchronousMessage(GstMessage *message)
_updateTextAndScrollDataForFrame aData
virtual void HandleTagMessage(GstMessage *message)