[vlc-commits] npapi: added members for notification child classes about creation/ destroying of media_player_t

Sergey Radionov git at videolan.org
Sat Dec 24 14:40:03 CET 2011


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Sat Dec 24 08:01:53 2011 +0700| [232cc83dcbf97b80fbbb53921325299fbba4d52a] | committer: Jean-Baptiste Kempf

npapi: added members for notification child classes about creation/destroying of media_player_t

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=232cc83dcbf97b80fbbb53921325299fbba4d52a
---

 npapi/vlcplugin_base.cpp |    2 ++
 npapi/vlcplugin_base.h   |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index d1d9bc6..bd6db07 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -650,6 +650,7 @@ bool VlcPluginBase::playlist_select( int idx )
         if( playlist_isplaying() )
             playlist_stop();
         events.unhook_manager( this );
+        on_media_player_release();
         libvlc_media_player_release( libvlc_media_player );
         libvlc_media_player = NULL;
     }
@@ -657,6 +658,7 @@ bool VlcPluginBase::playlist_select( int idx )
     libvlc_media_player = libvlc_media_player_new_from_media( p_m );
     if( libvlc_media_player )
     {
+        on_media_player_new();
         set_player_window();
 
         libvlc_event_manager_t *p_em;
diff --git a/npapi/vlcplugin_base.h b/npapi/vlcplugin_base.h
index f731976..c9c8a59 100644
--- a/npapi/vlcplugin_base.h
+++ b/npapi/vlcplugin_base.h
@@ -293,6 +293,11 @@ public:
     void event_callback(const libvlc_event_t *, NPVariant *, uint32_t);
 
 protected:
+    // called after libvlc_media_player_new_from_media
+    virtual void on_media_player_new()     {};
+    // called before libvlc_media_player_release
+    virtual void on_media_player_release() {};
+
     bool playlist_select(int);
     virtual void set_player_window() = 0;
 



More information about the vlc-commits mailing list