Avmedia/VLC: Fixing some errors when creating libvlc_instance_t.

condition wait is temporary only for non-windows system. Looks like there is some
hang. Must be investigate later...

Change-Id: Ia20227503f70244d33411164d4af95ba69e86509
This commit is contained in:
Minh Ngo 2013-10-07 10:23:04 +03:00
parent 8de1f54e19
commit bc43c1ca94
3 changed files with 25 additions and 4 deletions

View File

@ -28,10 +28,15 @@ namespace
const char * const VLC_ARGS[] = { const char * const VLC_ARGS[] = {
"-Vdummy", "-Vdummy",
// "--ignore-config"
"--demux",
"ffmpeg",
"--snapshot-format=png", "--snapshot-format=png",
"--ffmpeg-threads", "--ffmpeg-threads", /* Is deprecated in 2.1.0 */
"--verbose=2", "--verbose=2",
"--no-audio" "--no-audio"//,
//"--file-logging",
//"--logfile=C:/home/dev/log/vlc_log"
}; };
} }
@ -64,7 +69,11 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString
mPlayer.pause(); mPlayer.pause();
const TimeValue timeout = {2, 0}; const TimeValue timeout = {2, 0};
//TODO: Fix this hang on Windows
#ifndef WNT
condition.wait(&timeout); condition.wait(&timeout);
#endif
if ( !mPlayer.hasVout() ) if ( !mPlayer.hasVout() )
{ {

View File

@ -30,7 +30,13 @@ namespace
const char * const VLC_ARGS[] = { const char * const VLC_ARGS[] = {
"-Vdummy", "-Vdummy",
"--verbose=2" #ifdef WNT
"--demux",
"ffmpeg",
#endif
"--verbose=2"//,
//"--file-logging",
//"--logfile=C:/home/dev/log/vlc_log"
}; };
} }
@ -69,7 +75,9 @@ Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr )
SAL_WARN("avmedia", "Cannot load symbols"); SAL_WARN("avmedia", "Cannot load symbols");
if (m_is_vlc_found) if (m_is_vlc_found)
{
mEventHandler.create(); mEventHandler.create();
}
} }
Manager::~Manager() Manager::~Manager()

View File

@ -50,7 +50,10 @@ unsigned VLCPlayer::getHeight() const
void SAL_CALL VLCPlayer::start() throw ( ::com::sun::star::uno::RuntimeException ) void SAL_CALL VLCPlayer::start() throw ( ::com::sun::star::uno::RuntimeException )
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
mPlayer.play(); if (!mPlayer.play())
{
// TODO: Error
}
} }
void SAL_CALL VLCPlayer::stop() throw ( ::com::sun::star::uno::RuntimeException ) void SAL_CALL VLCPlayer::stop() throw ( ::com::sun::star::uno::RuntimeException )
@ -226,6 +229,7 @@ uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabb
throw ( ::com::sun::star::uno::RuntimeException ) throw ( ::com::sun::star::uno::RuntimeException )
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
if ( !mrFrameGrabber.is() ) if ( !mrFrameGrabber.is() )
{ {
VLCFrameGrabber *frameGrabber = new VLCFrameGrabber( mEventHandler, mUrl ); VLCFrameGrabber *frameGrabber = new VLCFrameGrabber( mEventHandler, mUrl );