Commit 7d56c120 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Mozilla: remove logging support

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.
parent 1c15d4ad
This diff is collapsed.
......@@ -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:
......
......@@ -168,17 +168,6 @@ Insert Slider widget
<INPUT size=4 value="" id="removeid"><INPUT type=submit value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);">
</TD>
</TR>
<TR><TD>Messages:
<INPUT type=button value="Messages" onClick='doMessages();'>
Verbosity:
<INPUT size=2 value="1" id="verbosity" onClick="doVerbosity(document.getElementById('verbosity').value);">
<INPUT type=button value=" + " onClick='doVerbosity(1);'>
<INPUT type=button value=" - " onClick='doVerbosity(-1);'>
</TD>
<TD>
<DIV id="message" style="text-align:center">no message</DIV>
</TD>
</TR>
<TR><TD>Audio Channel:
<SELECT readonly onClick='doAudioChannel(this.value);'>
<OPTION value=1>Stereo</OPTION>
......@@ -253,16 +242,6 @@ function doReverse(rate)
vlc.input.rate = -1.0 * vlc.input.rate;
}
function doVerbosity(value)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.log.verbosity = vlc.log.verbosity + value;
document.getElementById("verbosity").value = vlc.log.verbosity;
}
}
function doAudioChannel(value)
{
var vlc = getVLC("vlc");
......@@ -355,30 +334,6 @@ function doPlaylistClearAll()
}
}
function doMessages()
{
var vlc = getVLC("vlc");
if( vlc )
{
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity <= 1 )
{
document.getElementById("message").innerHTML = msg.message;
}
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
}
}
function updateVolume(deltaVol)
{
var vlc = getVLC("vlc");
......@@ -467,23 +422,6 @@ function monitor()
if( vlc )
{
newState = vlc.input.state;
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity == 1 )
{
alert( msg.message );
}
document.getElementById("message").innerHTML = msg.message;
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
}
if( prevState != newState )
......@@ -559,9 +497,6 @@ function doGo(targetURL)
var itemId = vlc.playlist.add(targetURL,"",options);
if( itemId != -1 )
{
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
// play MRL
vlc.playlist.playItem(itemId);
if( monitorTimerId == 0 )
......@@ -571,8 +506,6 @@ function doGo(targetURL)
}
else
{
// disable log
vlc.log.verbosity = -1;
alert("cannot play at the moment !");
}
doItemCount();
......@@ -602,16 +535,11 @@ function doPlayOrPause()
}
else if( vlc.playlist.items.count > 0 )
{
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
vlc.playlist.play();
monitor();
}
else
{
// disable log
vlc.log.verbosity = -1;
alert('nothing to play !');
}
}
......@@ -727,10 +655,7 @@ function onPause()
function onStop()
{
// disable logging
var vlc = getVLC("vlc");
if( vlc )
vlc.log.verbosity = -1;
if( inputTracker )
{
......@@ -751,25 +676,6 @@ function onError()
var vlc = getVLC("vlc");
document.getElementById("state").innerHTML = "Error...";
if( vlc )
{
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity <= 1 )
{
alert( msg.message );
}
document.getElementById("message").innerHTML = msg.message;
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
}
}
function onInputTrackerScrollStart()
......
......@@ -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 )
......
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment