]> git.sesse.net Git - vlc/commitdiff
Mozilla: remove logging support
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 20 May 2009 15:39:17 +0000 (18:39 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 20 May 2009 15:47:27 +0000 (18:47 +0300)
You don't want random web pages listing, say, the content of your
hard drive (file/xspf-open://C:/ ?). For debugging purpose, the standard
error from Mozilla is probably better than Javascript anyway, not to
mention that the libvlc logging APi is really brain-damaged.

projects/mozilla/control/npolibvlc.cpp
projects/mozilla/control/npolibvlc.h
projects/mozilla/test.html
projects/mozilla/vlcplugin.cpp
projects/mozilla/vlcplugin.h

index 5baec6e08fadf98f79b7e6c970ba9d5980600eaa..f428187e21857ca5d1801a9cfe1e95f0236b9181 100644 (file)
@@ -65,7 +65,6 @@ LibvlcRootNPObject::~LibvlcRootNPObject()
     {
         if( audioObj    ) NPN_ReleaseObject(audioObj);
         if( inputObj    ) NPN_ReleaseObject(inputObj);
-        if( logObj      ) NPN_ReleaseObject(logObj);
         if( playlistObj ) NPN_ReleaseObject(playlistObj);
         if( videoObj    ) NPN_ReleaseObject(videoObj);
     }
@@ -75,7 +74,6 @@ const NPUTF8 * const LibvlcRootNPObject::propertyNames[] =
 {
     "audio",
     "input",
-    "log",
     "playlist",
     "video",
     "VersionInfo",
@@ -86,7 +84,6 @@ enum LibvlcRootNPObjectPropertyIds
 {
     ID_root_audio = 0,
     ID_root_input,
-    ID_root_log,
     ID_root_playlist,
     ID_root_video,
     ID_root_VersionInfo,
@@ -116,14 +113,6 @@ LibvlcRootNPObject::getProperty(int index, NPVariant &result)
                              RuntimeNPClass<LibvlcInputNPObject>::getClass());
                 OBJECT_TO_NPVARIANT(NPN_RetainObject(inputObj), result);
                 return INVOKERESULT_NO_ERROR;
-            case ID_root_log:
-                // create child object in lazyman fashion to avoid
-                // ownership problem with firefox
-                if( ! logObj )
-                    logObj = NPN_CreateObject(_instance,
-                               RuntimeNPClass<LibvlcLogNPObject>::getClass());
-                OBJECT_TO_NPVARIANT(NPN_RetainObject(logObj), result);
-                return INVOKERESULT_NO_ERROR;
             case ID_root_playlist:
                 // create child object in lazyman fashion to avoid
                 // ownership problem with firefox
@@ -553,489 +542,6 @@ const NPUTF8 * const LibvlcInputNPObject::methodNames[] =
 
 COUNTNAMES(LibvlcInputNPObject,methodCount,methodNames);
 
-/*
-** implementation of libvlc message object
-*/
-
-const NPUTF8 * const LibvlcMessageNPObject::propertyNames[] =
-{
-    "severity",
-    "type",
-    "name",
-    "header",
-    "message",
-};
-COUNTNAMES(LibvlcMessageNPObject,propertyCount,propertyNames);
-
-enum LibvlcMessageNPObjectPropertyIds
-{
-    ID_message_severity,
-    ID_message_type,
-    ID_message_name,
-    ID_message_header,
-    ID_message_message,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcMessageNPObject::getProperty(int index, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        switch( index )
-        {
-            case ID_message_severity:
-            {
-                INT32_TO_NPVARIANT(_msg.i_severity, result);
-                return INVOKERESULT_NO_ERROR;
-            }
-            case ID_message_type:
-            {
-                if( _msg.psz_type )
-                {
-                    int len = strlen(_msg.psz_type);
-                    NPUTF8* retval = (NPUTF8*)NPN_MemAlloc(len);
-                    if( retval )
-                    {
-                        memcpy(retval, _msg.psz_type, len);
-                        STRINGN_TO_NPVARIANT(retval, len, result);
-                    }
-                }
-                else
-                {
-                    NULL_TO_NPVARIANT(result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            case ID_message_name:
-            {
-                if( _msg.psz_name )
-                {
-                    int len = strlen(_msg.psz_name);
-                    NPUTF8* retval = (NPUTF8*)NPN_MemAlloc(len);
-                    if( retval )
-                    {
-                        memcpy(retval, _msg.psz_name, len);
-                        STRINGN_TO_NPVARIANT(retval, len, result);
-                    }
-                }
-                else
-                {
-                    NULL_TO_NPVARIANT(result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            case ID_message_header:
-            {
-                if( _msg.psz_header )
-                {
-                    int len = strlen(_msg.psz_header);
-                    NPUTF8* retval = (NPUTF8*)NPN_MemAlloc(len);
-                    if( retval )
-                    {
-                        memcpy(retval, _msg.psz_header, len);
-                        STRINGN_TO_NPVARIANT(retval, len, result);
-                    }
-                }
-                else
-                {
-                    NULL_TO_NPVARIANT(result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            case ID_message_message:
-            {
-                if( _msg.psz_message )
-                {
-                    int len = strlen(_msg.psz_message);
-                    NPUTF8* retval = (NPUTF8*)NPN_MemAlloc(len);
-                    if( retval )
-                    {
-                        memcpy(retval, _msg.psz_message, len);
-                        STRINGN_TO_NPVARIANT(retval, len, result);
-                    }
-                }
-                else
-                {
-                    NULL_TO_NPVARIANT(result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-const NPUTF8 * const LibvlcMessageNPObject::methodNames[] =
-{
-    /* no methods */
-};
-COUNTNAMES(LibvlcMessageNPObject,methodCount,methodNames);
-
-/*
-** implementation of libvlc message iterator object
-*/
-
-LibvlcMessageIteratorNPObject::LibvlcMessageIteratorNPObject(NPP instance,
-                                                      const NPClass *aClass) :
-    RuntimeNPObject(instance, aClass),
-    _p_iter(NULL)
-{
-    // XXX FIXME use _instance or instance in this method?
-
-    /* is plugin still running */
-    if( instance->pdata )
-    {
-        VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
-        libvlc_log_t *p_log = p_plugin->getLog();
-        if( p_log )
-        {
-            _p_iter = libvlc_log_get_iterator(p_log, NULL);
-        }
-    }
-};
-
-LibvlcMessageIteratorNPObject::~LibvlcMessageIteratorNPObject()
-{
-    if( _p_iter )
-        libvlc_log_iterator_free(_p_iter, NULL);
-}
-
-const NPUTF8 * const LibvlcMessageIteratorNPObject::propertyNames[] =
-{
-    "hasNext",
-};
-COUNTNAMES(LibvlcMessageIteratorNPObject,propertyCount,propertyNames);
-
-enum LibvlcMessageIteratorNPObjectPropertyIds
-{
-    ID_messageiterator_hasNext,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcMessageIteratorNPObject::getProperty(int index, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        switch( index )
-        {
-            case ID_messageiterator_hasNext:
-            {
-                if( _p_iter && p_plugin->getLog() )
-                {
-                    libvlc_exception_t ex;
-                    libvlc_exception_init(&ex);
-
-                    BOOLEAN_TO_NPVARIANT(
-                         libvlc_log_iterator_has_next(_p_iter, &ex), result );
-                    RETURN_ON_EXCEPTION(this,ex);
-                }
-                else
-                {
-                    BOOLEAN_TO_NPVARIANT(0, result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-const NPUTF8 * const LibvlcMessageIteratorNPObject::methodNames[] =
-{
-    "next",
-};
-COUNTNAMES(LibvlcMessageIteratorNPObject,methodCount,methodNames);
-
-enum LibvlcMessageIteratorNPObjectMethodIds
-{
-    ID_messageiterator_next,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcMessageIteratorNPObject::invoke(int index, const NPVariant *args,
-                                      uint32_t argCount, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        switch( index )
-        {
-            case ID_messageiterator_next:
-                if( argCount == 0 )
-                {
-                    if( _p_iter && p_plugin->getLog() )
-                    {
-                        struct libvlc_log_message_t buffer;
-
-                        buffer.sizeof_msg = sizeof(buffer);
-
-                        libvlc_log_iterator_next(_p_iter, &buffer, &ex);
-                        RETURN_ON_EXCEPTION(this,ex);
-
-                        LibvlcMessageNPObject* message =
-                            static_cast<LibvlcMessageNPObject*>(
-                            NPN_CreateObject(_instance, RuntimeNPClass<
-                            LibvlcMessageNPObject>::getClass()));
-                        if( message )
-                        {
-                            message->setMessage(buffer);
-                            OBJECT_TO_NPVARIANT(message, result);
-                            return INVOKERESULT_NO_ERROR;
-                        }
-                        return INVOKERESULT_OUT_OF_MEMORY;
-                    }
-                    return INVOKERESULT_GENERIC_ERROR;
-                }
-                return INVOKERESULT_NO_SUCH_METHOD;
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-/*
-** implementation of libvlc message object
-*/
-
-const NPUTF8 * const LibvlcMessagesNPObject::propertyNames[] =
-{
-    "count",
-};
-COUNTNAMES(LibvlcMessagesNPObject,propertyCount,propertyNames);
-
-enum LibvlcMessagesNPObjectPropertyIds
-{
-    ID_messages_count,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcMessagesNPObject::getProperty(int index, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        switch( index )
-        {
-            case ID_messages_count:
-            {
-                libvlc_log_t *p_log = p_plugin->getLog();
-                if( p_log )
-                {
-                    libvlc_exception_t ex;
-                    libvlc_exception_init(&ex);
-
-                    INT32_TO_NPVARIANT(libvlc_log_count(p_log, &ex), result);
-                    RETURN_ON_EXCEPTION(this,ex);
-                }
-                else
-                {
-                    INT32_TO_NPVARIANT(0, result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-const NPUTF8 * const LibvlcMessagesNPObject::methodNames[] =
-{
-    "clear",
-    "iterator",
-};
-COUNTNAMES(LibvlcMessagesNPObject,methodCount,methodNames);
-
-enum LibvlcMessagesNPObjectMethodIds
-{
-    ID_messages_clear,
-    ID_messages_iterator,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcMessagesNPObject::invoke(int index, const NPVariant *args,
-                               uint32_t argCount, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        switch( index )
-        {
-            case ID_messages_clear:
-                if( argCount == 0 )
-                {
-                    libvlc_log_t *p_log = p_plugin->getLog();
-                    if( p_log )
-                    {
-                        libvlc_log_clear(p_log, &ex);
-                        RETURN_ON_EXCEPTION(this,ex);
-                    }
-                    return INVOKERESULT_NO_ERROR;
-                }
-                return INVOKERESULT_NO_SUCH_METHOD;
-
-            case ID_messages_iterator:
-                if( argCount == 0 )
-                {
-                    LibvlcMessageIteratorNPObject* iter =
-                        static_cast<LibvlcMessageIteratorNPObject*>(
-                        NPN_CreateObject(_instance, RuntimeNPClass<
-                        LibvlcMessageIteratorNPObject>::getClass()));
-                    if( iter )
-                    {
-                        OBJECT_TO_NPVARIANT(iter, result);
-                        return INVOKERESULT_NO_ERROR;
-                    }
-                    return INVOKERESULT_OUT_OF_MEMORY;
-                }
-                return INVOKERESULT_NO_SUCH_METHOD;
-
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-/*
-** implementation of libvlc message object
-*/
-
-LibvlcLogNPObject::~LibvlcLogNPObject()
-{
-    if( isValid() )
-    {
-        if( messagesObj ) NPN_ReleaseObject(messagesObj);
-    }
-};
-
-const NPUTF8 * const LibvlcLogNPObject::propertyNames[] =
-{
-    "messages",
-    "verbosity",
-};
-COUNTNAMES(LibvlcLogNPObject,propertyCount,propertyNames);
-
-enum LibvlcLogNPObjectPropertyIds
-{
-    ID_log_messages,
-    ID_log_verbosity,
-};
-
-RuntimeNPObject::InvokeResult
-LibvlcLogNPObject::getProperty(int index, NPVariant &result)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        switch( index )
-        {
-            case ID_log_messages:
-            {
-                // create child object in lazyman fashion to avoid
-                // ownership problem with firefox
-                if( ! messagesObj )
-                    messagesObj = NPN_CreateObject(_instance,
-                          RuntimeNPClass<LibvlcMessagesNPObject>::getClass());
-                OBJECT_TO_NPVARIANT(NPN_RetainObject(messagesObj), result);
-                return INVOKERESULT_NO_ERROR;
-            }
-            case ID_log_verbosity:
-            {
-                if( p_plugin->getLog() )
-                {
-                    INT32_TO_NPVARIANT( libvlc_get_log_verbosity(
-                                        p_plugin->getVLC(), &ex), result);
-                    RETURN_ON_EXCEPTION(this,ex);
-                }
-                else
-                {
-                    /* log is not enabled, return -1 */
-                    DOUBLE_TO_NPVARIANT(-1.0, result);
-                }
-                return INVOKERESULT_NO_ERROR;
-            }
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-RuntimeNPObject::InvokeResult
-LibvlcLogNPObject::setProperty(int index, const NPVariant &value)
-{
-    /* is plugin still running */
-    if( isPluginRunning() )
-    {
-        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        switch( index )
-        {
-            case ID_log_verbosity:
-                if( isNumberValue(value) )
-                {
-                    libvlc_instance_t* p_libvlc = p_plugin->getVLC();
-                    libvlc_log_t *p_log = p_plugin->getLog();
-                    int verbosity = numberValue(value);
-                    if( verbosity >= 0 )
-                    {
-                        if( !p_log )
-                        {
-                            p_log = libvlc_log_open(p_libvlc, &ex);
-                            RETURN_ON_EXCEPTION(this,ex);
-                            p_plugin->setLog(p_log);
-                        }
-                        libvlc_set_log_verbosity(p_libvlc, (unsigned)verbosity, &ex);
-                        RETURN_ON_EXCEPTION(this,ex);
-                    }
-                    else if( p_log )
-                    {
-                        /* close log  when verbosity is set to -1 */
-                        p_plugin->setLog(NULL);
-                        libvlc_log_close(p_log, &ex);
-                        RETURN_ON_EXCEPTION(this,ex);
-                    }
-                    return INVOKERESULT_NO_ERROR;
-                }
-                return INVOKERESULT_INVALID_VALUE;
-            default:
-                ;
-        }
-    }
-    return INVOKERESULT_GENERIC_ERROR;
-}
-
-const NPUTF8 * const LibvlcLogNPObject::methodNames[] =
-{
-    /* no methods */
-};
-COUNTNAMES(LibvlcLogNPObject,methodCount,methodNames);
-
 /*
 ** implementation of libvlc playlist items object
 */
index 2f396ba15831e50473805e55c0ef56d4cc73df17..3a68b52461e5627cdf135dc67311145b4375fcd0 100644 (file)
@@ -36,7 +36,6 @@ protected:
         RuntimeNPObject(instance, aClass),
     audioObj(NULL),
     inputObj(NULL),
-    logObj(NULL),
     playlistObj(NULL),
     videoObj(NULL) {};
 
@@ -55,7 +54,6 @@ protected:
 private:
     NPObject *audioObj;
     NPObject *inputObj;
-    NPObject *logObj;
     NPObject *playlistObj;
     NPObject *videoObj;
 };
@@ -101,103 +99,6 @@ protected:
     static const NPUTF8 * const methodNames[];
 };
 
-class LibvlcMessageNPObject: public RuntimeNPObject
-{
-public:
-    void setMessage(struct libvlc_log_message_t &msg)
-    {
-        _msg = msg;
-    };
-
-protected:
-    friend class RuntimeNPClass<LibvlcMessageNPObject>;
-
-    LibvlcMessageNPObject(NPP instance, const NPClass *aClass) :
-        RuntimeNPObject(instance, aClass) {};
-
-    virtual ~LibvlcMessageNPObject() {};
-
-    static const int propertyCount;
-    static const NPUTF8 * const propertyNames[];
-
-    InvokeResult getProperty(int index, NPVariant &result);
-
-    static const int methodCount;
-    static const NPUTF8 * const methodNames[];
-
-private:
-    struct libvlc_log_message_t _msg;
-};
-
-class LibvlcLogNPObject;
-
-class LibvlcMessageIteratorNPObject: public RuntimeNPObject
-{
-protected:
-    friend class RuntimeNPClass<LibvlcMessageIteratorNPObject>;
-
-    LibvlcMessageIteratorNPObject(NPP instance, const NPClass *aClass);
-    virtual ~LibvlcMessageIteratorNPObject();
-
-    static const int propertyCount;
-    static const NPUTF8 * const propertyNames[];
-
-    InvokeResult getProperty(int index, NPVariant &result);
-
-    static const int methodCount;
-    static const NPUTF8 * const methodNames[];
-
-    InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result);
-
-private:
-    libvlc_log_iterator_t*  _p_iter;
-};
-
-class LibvlcMessagesNPObject: public RuntimeNPObject
-{
-protected:
-    friend class RuntimeNPClass<LibvlcMessagesNPObject>;
-
-    LibvlcMessagesNPObject(NPP instance, const NPClass *aClass) :
-        RuntimeNPObject(instance, aClass) {};
-
-    virtual ~LibvlcMessagesNPObject() {};
-
-    static const int propertyCount;
-    static const NPUTF8 * const propertyNames[];
-
-    InvokeResult getProperty(int index, NPVariant &result);
-
-    static const int methodCount;
-    static const NPUTF8 * const methodNames[];
-
-    InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result);
-};
-
-class LibvlcLogNPObject: public RuntimeNPObject
-{
-protected:
-    friend class RuntimeNPClass<LibvlcLogNPObject>;
-
-    LibvlcLogNPObject(NPP instance, const NPClass *aClass) :
-    RuntimeNPObject(instance, aClass),
-    messagesObj(NULL) {};
-
-    virtual ~LibvlcLogNPObject();
-
-    static const int propertyCount;
-    static const NPUTF8 * const propertyNames[];
-
-    InvokeResult getProperty(int index, NPVariant &result);
-    InvokeResult setProperty(int index, const NPVariant &value);
-
-    static const int methodCount;
-    static const NPUTF8 * const methodNames[];
-
-private:
-    NPObject* messagesObj;
-};
-
 class LibvlcPlaylistItemsNPObject: public RuntimeNPObject
 {
 protected:
index 2f6086089134f97a81cde1cd358c279909349447..b9085f3d586892fb00e032f07c2ad5a1c4b2079c 100644 (file)
@@ -168,17 +168,6 @@ Insert Slider widget
 <INPUT size=4 value="" id="removeid"><INPUT type=submit value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);">\r
 </TD>\r
 </TR>\r
-<TR><TD>Messages:\r
-<INPUT type=button value="Messages" onClick='doMessages();'>\r
-Verbosity:\r
-<INPUT size=2 value="1" id="verbosity" onClick="doVerbosity(document.getElementById('verbosity').value);">\r
-<INPUT type=button value=" + " onClick='doVerbosity(1);'>\r
-<INPUT type=button value=" - " onClick='doVerbosity(-1);'>\r
-</TD>\r
-<TD>\r
-<DIV id="message" style="text-align:center">no message</DIV>\r
-</TD>\r
-</TR>\r
 <TR><TD>Audio Channel:\r
   <SELECT readonly onClick='doAudioChannel(this.value);'>\r
     <OPTION value=1>Stereo</OPTION>\r
@@ -253,16 +242,6 @@ function doReverse(rate)
         vlc.input.rate = -1.0 * vlc.input.rate;\r
 }\r
 \r
-function doVerbosity(value)\r
-{\r
-    var vlc = getVLC("vlc");\r
-    if( vlc )\r
-    {\r
-        vlc.log.verbosity = vlc.log.verbosity + value;\r
-        document.getElementById("verbosity").value = vlc.log.verbosity;\r
-    }\r
-}\r
-\r
 function doAudioChannel(value)\r
 {\r
     var vlc = getVLC("vlc");\r
@@ -355,30 +334,6 @@ function doPlaylistClearAll()
     }\r
 }\r
 \r
-function doMessages()\r
-{\r
-    var vlc = getVLC("vlc");\r
-\r
-    if( vlc )\r
-    {\r
-        if( vlc.log.messages.count > 0 )\r
-        {\r
-            // there is one or more messages in the log\r
-            var iter = vlc.log.messages.iterator();\r
-            while( iter.hasNext )\r
-            {\r
-                var msg = iter.next();\r
-                if( msg.severity <= 1 )\r
-                {\r
-                    document.getElementById("message").innerHTML = msg.message;\r
-                }\r
-            }\r
-            // clear the log once finished to avoid clogging\r
-            vlc.log.messages.clear();\r
-        }\r
-    }\r
-}\r
-\r
 function updateVolume(deltaVol)\r
 {\r
     var vlc = getVLC("vlc");\r
@@ -467,23 +422,6 @@ function monitor()
     if( vlc )\r
     {\r
         newState = vlc.input.state;\r
-\r
-        if( vlc.log.messages.count > 0 )\r
-        {\r
-            // there is one or more messages in the log\r
-            var iter = vlc.log.messages.iterator();\r
-            while( iter.hasNext )\r
-            {\r
-                var msg = iter.next();\r
-                if( msg.severity == 1 )\r
-                {\r
-                    alert( msg.message );\r
-                }\r
-                document.getElementById("message").innerHTML = msg.message;\r
-            }\r
-            // clear the log once finished to avoid clogging\r
-            vlc.log.messages.clear();\r
-        }\r
     }\r
 \r
     if( prevState != newState )\r
@@ -559,9 +497,6 @@ function doGo(targetURL)
         var itemId = vlc.playlist.add(targetURL,"",options);\r
         if( itemId != -1 )\r
         {\r
-            // clear the message log and enable error logging\r
-            vlc.log.verbosity = 1;\r
-            vlc.log.messages.clear();\r
             // play MRL\r
             vlc.playlist.playItem(itemId);\r
             if( monitorTimerId == 0 )\r
@@ -571,8 +506,6 @@ function doGo(targetURL)
         }\r
         else\r
         {\r
-            // disable log\r
-            vlc.log.verbosity = -1;\r
             alert("cannot play at the moment !");\r
         }\r
         doItemCount();\r
@@ -602,16 +535,11 @@ function doPlayOrPause()
         }\r
         else if( vlc.playlist.items.count > 0 )\r
         {\r
-            // clear the message log and enable error logging\r
-            vlc.log.verbosity = 1;\r
-            vlc.log.messages.clear();\r
             vlc.playlist.play();\r
             monitor();\r
         }\r
         else\r
         {\r
-            // disable log\r
-            vlc.log.verbosity = -1;\r
             alert('nothing to play !');\r
         }\r
     }\r
@@ -727,10 +655,7 @@ function onPause()
 \r
 function onStop()\r
 {\r
-    // disable logging\r
     var vlc = getVLC("vlc");\r
-    if( vlc )\r
-        vlc.log.verbosity = -1;\r
 \r
     if( inputTracker )\r
     {\r
@@ -751,25 +676,6 @@ function onError()
     var vlc = getVLC("vlc");\r
 \r
     document.getElementById("state").innerHTML = "Error...";\r
-    if( vlc )\r
-    {\r
-        if( vlc.log.messages.count > 0 )\r
-        {\r
-            // there is one or more messages in the log\r
-            var iter = vlc.log.messages.iterator();\r
-            while( iter.hasNext )\r
-            {\r
-                var msg = iter.next();\r
-                if( msg.severity <= 1 )\r
-                {\r
-                    alert( msg.message );\r
-                }\r
-                document.getElementById("message").innerHTML = msg.message;\r
-            }\r
-            // clear the log once finished to avoid clogging\r
-            vlc.log.messages.clear();\r
-        }\r
-    }\r
 }\r
 \r
 function onInputTrackerScrollStart()\r
index 51704b18df12d0bd907ffb0de989c5d62b8d7f3d..8f3ebe5e1cdbb4128eb7b85339a61dacc2ceb48b 100644 (file)
@@ -50,7 +50,6 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
     libvlc_instance(NULL),
     libvlc_media_list(NULL),
     libvlc_media_player(NULL),
-    libvlc_log(NULL),
     p_scriptClass(NULL),
     p_browser(instance),
     psz_baseURL(NULL)
@@ -268,8 +267,6 @@ VlcPlugin::~VlcPlugin()
 {
     free(psz_baseURL);
     free(psz_target);
-    if( libvlc_log )
-        libvlc_log_close(libvlc_log, NULL);
     if( libvlc_media_player )
         libvlc_media_player_release( libvlc_media_player );
     if( libvlc_media_list )
index ed109ae4ecbd124bacbf913f2ee5e11750bc6973..97a9dea61726e6ac1e9860f3d284fa8d0ccb3663 100644 (file)
@@ -107,10 +107,6 @@ public:
     NPClass*            getScriptClass()
                             { return p_scriptClass; };
 
-    void                setLog(libvlc_log_t *log)
-                            { libvlc_log = log; };
-    libvlc_log_t*       getLog()
-                            { return libvlc_log; };
 #if XP_WIN
     WNDPROC             getWindowProc()
                             { return pf_wndproc; };
@@ -208,7 +204,6 @@ private:
     libvlc_instance_t   *libvlc_instance;
     libvlc_media_list_t *libvlc_media_list;
     libvlc_media_player_t *libvlc_media_player;
-    libvlc_log_t        *libvlc_log;
     NPClass             *p_scriptClass;
 
     /* browser reference */