[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp s...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp s... |
Date: |
Fri, 18 May 2007 16:23:28 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/05/18 16:23:28
Modified files:
. : ChangeLog
server/asobj : NetStreamGst.cpp NetStreamGst.h
Log message:
* server/asobj/NetStreamGst.cpp: provide a buildFLVPipeline()
calling
the video/audio versions internally and locking the
pipelineMutex.
Lock the pipelineMutex from buildPipeline() too. Document
locking
in header.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3275&r2=1.3276
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.h?cvsroot=gnash&r1=1.22&r2=1.23
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3275
retrieving revision 1.3276
diff -u -b -r1.3275 -r1.3276
--- ChangeLog 18 May 2007 16:05:31 -0000 1.3275
+++ ChangeLog 18 May 2007 16:23:27 -0000 1.3276
@@ -1,5 +1,9 @@
2007-05-18 Sandro Santilli <address@hidden>
+ * server/asobj/NetStreamGst.cpp: provide a buildFLVPipeline() calling
+ the video/audio versions internally and locking the pipelineMutex.
+ Lock the pipelineMutex from buildPipeline() too. Document locking
+ in header.
* testsuite/misc-ming.all/: loop_test-Runner.cpp, loop_test.c:
Make loop_test.swf self-contained. Use the runner for checking
invalidated bounds and rendering.
Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/asobj/NetStreamGst.cpp 17 May 2007 13:38:17 -0000 1.46
+++ server/asobj/NetStreamGst.cpp 18 May 2007 16:23:28 -0000 1.47
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: NetStreamGst.cpp,v 1.46 2007/05/17 13:38:17 strk Exp $ */
+/* $Id: NetStreamGst.cpp,v 1.47 2007/05/18 16:23:28 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -355,7 +355,9 @@
void
NetStreamGst::unrefElements()
{
-log_debug("unreffing elements");
+ log_debug("unreffing elements");
+
+ boost::mutex::scoped_lock lock(_pipelineMutex);
// TODO: Define an GstElement class for storing all these elements,
// and have it's destructor take care of unreffing...
@@ -481,11 +483,26 @@
}
}
+bool
+NetStreamGst::buildFLVPipeline(bool& video, bool& audio)
+{
+ boost::mutex::scoped_lock lock(_pipelineMutex);
+
+ if ( ! buildFLVVideoPipeline(video) ) return false;
+ if ( audio )
+ {
+ if ( ! buildFLVSoundPipeline(audio) ) return false;
+ }
+
+ return true;
+
+}
bool
NetStreamGst::buildFLVVideoPipeline(bool &video)
{
- log_debug("Building FLV decoding pipeline");
+ log_debug("Building FLV video decoding pipeline");
+
FLVVideoInfo* videoInfo = m_parser->getVideoInfo();
bool doVideo = video;
@@ -597,6 +614,9 @@
if (!audioInfo) doSound = false;
if (doSound) {
+
+ log_debug("Building FLV video decoding pipeline");
+
audiosource = gst_element_factory_make ("fakesrc", NULL);
if ( ! audiosource )
{
@@ -662,6 +682,8 @@
{
log_debug("Building non-FLV decoding pipeline");
+ boost::mutex::scoped_lock lock(_pipelineMutex);
+
// setup gnashnc source if we are not decoding FLV (our homegrown
source element)
source = gst_element_factory_make ("gnashsrc", NULL);
if ( ! source )
@@ -738,17 +760,19 @@
if (get_sound_handler()) sound = true;
// Setup the decoder and source
- if (m_isFLV) {
- if (!buildFLVVideoPipeline(video)) {
+ // TODO: move the m_isFLV test into buildPipeline and just call that
one...
+ if (m_isFLV)
+ {
+ if ( ! buildFLVPipeline(video, sound) )
+ {
unrefElements();
return;
}
- if (sound && !buildFLVSoundPipeline(sound)) {
- unrefElements();
- return;
}
- } else {
- if (!buildPipeline()) {
+ else
+ {
+ if (!buildPipeline())
+ {
unrefElements();
return;
}
Index: server/asobj/NetStreamGst.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/asobj/NetStreamGst.h 16 May 2007 17:50:03 -0000 1.22
+++ server/asobj/NetStreamGst.h 18 May 2007 16:23:28 -0000 1.23
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: NetStreamGst.h,v 1.22 2007/05/16 17:50:03 tgc Exp $ */
+/* $Id: NetStreamGst.h,v 1.23 2007/05/18 16:23:28 strk Exp $ */
#ifndef __NETSTREAMGST_H__
#define __NETSTREAMGST_H__
@@ -72,6 +72,8 @@
/// Creates the sound decoder and source element for playing FLVs
//
+ /// Does NOT Lock the pipeline mutex during operations, use
buildFLVPipeline() for that.
+ ///
/// @return true on success, false on failure
///
/// @param sound
@@ -82,6 +84,8 @@
/// Creates the video decoder and source element for playing FLVs
//
+ /// Does NOT Lock the pipeline mutex during operations, use
buildFLVPipeline() for that.
+ ///
/// @return true on success, false on failure
///
/// @param video
@@ -90,13 +94,35 @@
///
bool buildFLVVideoPipeline(bool &video);
+ /// Creates the decoder and source element for playing FLVs
+ //
+ /// Locks the pipeline mutex during operations
+ ///
+ ///
+ /// @param video
+ /// Determines if video should be setup. It is passed by reference
+ /// and might be changed.
+ ///
+ /// @param sound
+ /// Determines if sound should be setup. It is passed by reference
+ /// and might be changed.
+ ///
+ /// @return true on success, false on failure
+ ///
+ bool buildFLVPipeline(bool& video, bool& audio);
+
/// Creates the decoder and source element for playing non-FLVs
//
+ /// Locks the pipeline mutex during operations
+ ///
/// @return true on success, false on failure
///
bool buildPipeline();
/// Unrefs (deletes) all the gstreamer elements. Used when the setup
failed.
+ //
+ /// Locks the pipeline mutex during operations
+ ///
void unrefElements();
/// Connect the video "handoff" signal
@@ -127,6 +153,8 @@
/// Set pipeline state to GST_STATE_NULL
/// and disconnect handoff signals
//
+ /// Locks the pipeline mutex during operations
+ ///
/// If the call needs be asynchronous, we'll wait for it.
/// TODO: implement the above
///
@@ -137,6 +165,8 @@
/// connect handoff signals, send appropriate
/// notifications.
//
+ /// Locks the pipeline mutex during operations
+ ///
/// If the call needs be asynchronous, we'll wait for it.
/// TOOD: implement the above
///
@@ -146,6 +176,8 @@
/// Set pipeline state to GST_STATE_PAUSE,
/// connect handoff signals if not connected already
//
+ /// Locks the pipeline mutex during operations
+ ///
/// If the call needs be asynchronous, we'll wait for it.
/// TOOD: implement the above
///