added two more test SMIL files to playlistExecutor/GstreamerPlayerTest;

changed GLiveSupport to use the gstreamer player for cue output
This commit is contained in:
fgerlits 2005-07-01 12:03:41 +00:00
parent 009c6902e1
commit d336a0bfc9
7 changed files with 141 additions and 22 deletions

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.2 $
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx,v $
------------------------------------------------------------------------------*/
@ -157,7 +157,7 @@ GstreamerPlayerTest :: simplePlayTest(void)
* Play a simple SMIL file
*----------------------------------------------------------------------------*/
void
GstreamerPlayerTest :: smilTest(void)
GstreamerPlayerTest :: simpleSmilTest(void)
throw (CPPUNIT_NS::Exception)
{
Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10)));
@ -182,6 +182,64 @@ GstreamerPlayerTest :: smilTest(void)
}
/*------------------------------------------------------------------------------
* Play a more complicated SMIL file
*----------------------------------------------------------------------------*/
void
GstreamerPlayerTest :: secondSmilTest(void)
throw (CPPUNIT_NS::Exception)
{
Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10)));
player->initialize();
try {
player->open("file:var/sequentialSmil.smil");
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL(e.what());
}
CPPUNIT_ASSERT(!player->isPlaying());
CPPUNIT_ASSERT_NO_THROW(
player->start();
);
CPPUNIT_ASSERT(player->isPlaying());
while (player->isPlaying()) {
TimeConversion::sleep(sleepT);
}
CPPUNIT_ASSERT(!player->isPlaying());
player->close();
player->deInitialize();
}
/*------------------------------------------------------------------------------
* Play a SMIL file with sound animation
*----------------------------------------------------------------------------*/
void
GstreamerPlayerTest :: animatedSmilTest(void)
throw (CPPUNIT_NS::Exception)
{
Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10)));
player->initialize();
try {
player->open("file:var/animatedSmil.smil");
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL(e.what());
}
CPPUNIT_ASSERT(!player->isPlaying());
player->start();
CPPUNIT_ASSERT(player->isPlaying());
while (player->isPlaying()) {
TimeConversion::sleep(sleepT);
}
CPPUNIT_ASSERT(!player->isPlaying());
player->close();
player->deInitialize();
}
/*------------------------------------------------------------------------------
* Check for error conditions
*----------------------------------------------------------------------------*/

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.2 $
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h,v $
------------------------------------------------------------------------------*/
@ -57,19 +57,21 @@ namespace PlaylistExecutor {
/**
* Unit test for the GstreamerPlayer class.
*
* @author $Author: maroy $
* @version $Revision: 1.2 $
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @see GstreamerPlayer
*/
class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(GstreamerPlayerTest);
CPPUNIT_TEST(firstTest);
CPPUNIT_TEST(simplePlayTest);
CPPUNIT_TEST(smilTest);
CPPUNIT_TEST(checkErrorConditions);
CPPUNIT_TEST(eventListenerAttachTest);
CPPUNIT_TEST(eventListenerTest);
// CPPUNIT_TEST(firstTest);
// CPPUNIT_TEST(simplePlayTest);
CPPUNIT_TEST(simpleSmilTest);
CPPUNIT_TEST(secondSmilTest);
CPPUNIT_TEST(animatedSmilTest);
// CPPUNIT_TEST(checkErrorConditions);
// CPPUNIT_TEST(eventListenerAttachTest);
// CPPUNIT_TEST(eventListenerTest);
CPPUNIT_TEST_SUITE_END();
private:
@ -104,7 +106,23 @@ class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture
* @exception CPPUNIT_NS::Exception on test failures.
*/
void
smilTest(void) throw (CPPUNIT_NS::Exception);
simpleSmilTest(void) throw (CPPUNIT_NS::Exception);
/**
* Play a more complicated SMIL file.
*
* @exception CPPUNIT_NS::Exception on test failures.
*/
void
secondSmilTest(void) throw (CPPUNIT_NS::Exception);
/**
* Play a SMIL file with sound animation.
*
* @exception CPPUNIT_NS::Exception on test failures.
*/
void
animatedSmilTest(void) throw (CPPUNIT_NS::Exception);
/**
* Check for error conditions.

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<smil xmlns = "http://www.w3.org/2001/SMIL20/Language">
<body>
<par>
<audio src="file:var/test10001.mp3" begin="0s">
<animate attributeName = "soundLevel"
from = "100%"
to = "0%"
calcMode = "linear"
begin = "6.23s"
end = "11.23s"
fill = "freeze"
/>
</audio>
<audio src="file:var/test10002.mp3" begin="6.23s"/>
<animate attributeName = "soundLevel"
from = "0%"
to = "100%"
calcMode = "linear"
begin = "0s"
end = "5s"
fill = "freeze"
/>
</audio>
<audio src="file:var/test10003.mp3" begin="18.45s">
</audio>
</par>
</body>
</smil>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<smil xmlns = "http://www.w3.org/2001/SMIL20/Language">
<body>
<par>
<audio src="file:var/test10001.mp3" begin="0s"/>
<audio src="file:var/test10002.mp3" begin="11.23s"/>
<audio src="file:var/test10003.mp3" begin="23.45s"/>
</par>
</body>
</smil>