[vlc-devel] [PATCH 09/12] dash: dashmanager refactoring

Hugo Beauzée-Luyssen beauze.h at gmail.com
Tue Mar 13 16:34:35 CET 2012


On Tue, Mar 13, 2012 at 3:18 PM,  <Christopher at mailsrv.uni-klu.ac.at> wrote:
> From: Christopher Mueller <christopher.mueller at itec.aau.at>
>
> ---
>  modules/stream_filter/dash/DASHManager.cpp |   31 +++++++++++++++------------
>  modules/stream_filter/dash/dash.cpp        |    5 +---
>  2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/modules/stream_filter/dash/DASHManager.cpp b/modules/stream_filter/dash/DASHManager.cpp
> index bb2f3f0..dfa275e 100644
> --- a/modules/stream_filter/dash/DASHManager.cpp
> +++ b/modules/stream_filter/dash/DASHManager.cpp
> @@ -43,20 +43,6 @@ DASHManager::DASHManager    ( MPD *mpd,
>              mpd            ( mpd ),
>              stream         (stream)
>  {
> -    this->mpdManager        = mpd::MPDManagerFactory::create( mpd );
> -    if ( this->mpdManager == NULL )
> -        return ;
> -    this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream);
> -    if ( this->adaptationLogic == NULL )
> -        return ;
> -
> -    this->conManager = new dash::http::HTTPConnectionManager(this->adaptationLogic, this->stream);
> -
> -    this->buffer     = new BlockBuffer(this->stream);
> -    this->downloader = new DASHDownloader(this->conManager, this->buffer);
> -
> -    this->conManager->attach(this->adaptationLogic);
> -    this->buffer->attach(this->adaptationLogic);
>  }
>  DASHManager::~DASHManager   ()
>  {
> @@ -69,6 +55,23 @@ DASHManager::~DASHManager   ()
>
>  bool    DASHManager::start()
>  {
> +    this->mpdManager = mpd::MPDManagerFactory::create( mpd );
> +
> +    if ( this->mpdManager == NULL )
> +        return false;
> +
> +    this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream);
> +
> +    if ( this->adaptationLogic == NULL )
> +        return false;
> +
> +    this->conManager = new dash::http::HTTPConnectionManager(this->adaptationLogic, this->stream);
> +    this->buffer     = new BlockBuffer(this->stream);
> +    this->downloader = new DASHDownloader(this->conManager, this->buffer);
> +
> +    this->conManager->attach(this->adaptationLogic);
> +    this->buffer->attach(this->adaptationLogic);
> +
>     return this->downloader->start();
>  }
>  int     DASHManager::read( void *p_buffer, size_t len )
> diff --git a/modules/stream_filter/dash/dash.cpp b/modules/stream_filter/dash/dash.cpp
> index ee42beb..0f7f3bc 100644
> --- a/modules/stream_filter/dash/dash.cpp
> +++ b/modules/stream_filter/dash/dash.cpp
> @@ -117,10 +117,7 @@ static int Open(vlc_object_t *p_obj)
>                                           dash::logic::IAdaptationLogic::RateBased,
>                                           p_stream);
>
> -    if ( p_dashManager->getMpdManager()           == NULL   ||
> -         p_dashManager->getMpdManager()->getMPD() == NULL   ||
> -         p_dashManager->getAdaptionLogic()        == NULL   ||
> -         p_dashManager->start()                   == false)
> +    if(!p_dashManager->start())
>     {
>         delete p_dashManager;
>         free( p_sys );
> --
> 1.7.0.4
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

Ok

-- 
Hugo Beauzée-Luyssen



More information about the vlc-devel mailing list