added two more test SMIL files to playlistExecutor/GstreamerPlayerTest;
changed GLiveSupport to use the gstreamer player for cue output
This commit is contained in:
parent
009c6902e1
commit
d336a0bfc9
7 changed files with 141 additions and 22 deletions
|
@ -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
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -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.
|
||||
|
|
29
livesupport/modules/playlistExecutor/var/animatedSmil.smil
Normal file
29
livesupport/modules/playlistExecutor/var/animatedSmil.smil
Normal 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>
|
10
livesupport/modules/playlistExecutor/var/sequentialSmil.smil
Normal file
10
livesupport/modules/playlistExecutor/var/sequentialSmil.smil
Normal 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>
|
|
@ -78,13 +78,17 @@
|
|||
<!ELEMENT outputPlayer (audioPlayer) >
|
||||
<!ELEMENT cuePlayer (audioPlayer) >
|
||||
|
||||
<!ELEMENT audioPlayer (helixPlayer) >
|
||||
<!ELEMENT audioPlayer (helixPlayer|
|
||||
gstreamerPlayer) >
|
||||
|
||||
<!ELEMENT helixPlayer EMPTY >
|
||||
<!ATTLIST helixPlayer dllPath CDATA #REQUIRED >
|
||||
<!ATTLIST helixPlayer audioDevice CDATA #IMPLIED >
|
||||
<!ATTLIST helixPlayer audioStreamTimeout NMTOKEN #IMPLIED >
|
||||
<!ATTLIST helixPlayer fadeLookAheatTime NMTOKEN #IMPLIED >
|
||||
<!ATTLIST helixPlayer fadeLookAheadTime NMTOKEN #IMPLIED >
|
||||
|
||||
<!ELEMENT gstreamerPlayer EMPTY >
|
||||
<!ATTLIST gstreamerPlayer audioDevice CDATA #IMPLIED >
|
||||
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
|
@ -144,9 +148,7 @@
|
|||
|
||||
<cuePlayer>
|
||||
<audioPlayer>
|
||||
<helixPlayer dllPath = "../../usr/lib/helix"
|
||||
audioDevice = "/dev/dsp"
|
||||
/>
|
||||
<gstreamerPlayer audioDevice = "plughw:0,0" />
|
||||
</audioPlayer>
|
||||
</cuePlayer>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.53 $
|
||||
Version : $Revision: 1.54 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -903,7 +903,9 @@ GLiveSupport :: playCueAudio(Ptr<Playable>::Ref playable)
|
|||
case Playable::PlaylistType:
|
||||
cueItemPlayingNow = storage->acquirePlaylist(sessionId,
|
||||
playable->getId());
|
||||
cuePlayer->openAndStart(cueItemPlayingNow->getPlaylist());
|
||||
cuePlayer->open(*cueItemPlayingNow->getUri());
|
||||
std::cerr << "uri: " << *cueItemPlayingNow->getUri() << ".\n";
|
||||
cuePlayer->start();
|
||||
break;
|
||||
|
||||
default: // this never happens
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<!ATTLIST helixPlayer dllPath CDATA #REQUIRED >
|
||||
<!ATTLIST helixPlayer audioDevice CDATA #IMPLIED >
|
||||
<!ATTLIST helixPlayer audioStreamTimeout NMTOKEN #IMPLIED >
|
||||
<!ATTLIST helixPlayer fadeLookAheatTime NMTOKEN #IMPLIED >
|
||||
<!ATTLIST helixPlayer fadeLookAheadTime NMTOKEN #IMPLIED >
|
||||
|
||||
<!ELEMENT gstreamerPlayer EMPTY >
|
||||
<!ATTLIST gstreamerPlayer audioDevice CDATA #IMPLIED >
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue