M plugins/mozilla/Makefile.in

- Changes to build with objdir

M plugins/examples/MediaPlayer/JMPlayer.java

- Do not use * imports

M plugins/examples/MediaPlayer/build.xml

- distribute to objdir

M plugins/src/PlugletEngine.cpp
M plugins/src/PlugletFactory.cpp
M plugins/src/PlugletsDir.cpp

- Additional logging
This commit is contained in:
edburns%acm.org 2007-03-16 16:29:31 +00:00
Родитель 92ed79102f
Коммит 169ae5638c
7 изменённых файлов: 98 добавлений и 58 удалений

Просмотреть файл

@ -39,6 +39,8 @@
<property file="../build.properties"/> <!-- java-supplement local -->
<property environment="myenv" />
<property name="objdir.native.path" value="${objdir}/java/plugins" />
<!-- ************ Compiler Defaults *************************************** -->
<!-- Should Java compilations set the 'debug' compiler option? -->
@ -95,51 +97,69 @@
</target>
<target name="compile.src">
<copy todir="${objdir.native.path}/src">
<fileset dir="${basedir}/src">
<include name="module.res" />
</fileset>
</copy>
<exec os="SunOS" dir="${basedir}/src" failonerror="yes"
<exec os="SunOS" dir="${objdir.native.path}/src" failonerror="yes"
executable="gmake"/>
<exec os="Linux" dir="${basedir}/src" failonerror="yes"
<exec os="Linux" dir="${objdir.native.path}/src" failonerror="yes"
executable="make"/>
<exec os="Windows 2000" dir="${basedir}/src" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/src" executable="make"
failonerror="yes"/>
</target>
<target name="compile.jni">
<exec os="SunOS" dir="${basedir}/jni" executable="gmake"
<copy todir="${objdir.native.path}/jni">
<fileset dir="${basedir}/jni">
<include name="module.res" />
</fileset>
</copy>
<exec os="SunOS" dir="${objdir.native.path}/jni" executable="gmake"
failonerror="yes">
</exec>
<exec os="Linux" dir="${basedir}/jni" executable="make"
<exec os="Linux" dir="${objdir.native.path}/jni" executable="make"
failonerror="yes">
</exec>
<exec os="Mac OS X" dir="${basedir}/jni" executable="make"
<exec os="Mac OS X" dir="${objdir.native.path}/jni" executable="make"
failonerror="yes">
</exec>
<exec os="Windows 2000" dir="${basedir}/jni" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/jni" executable="make"
failonerror="yes"/>
</target>
<target name="compile.mozilla">
<exec os="SunOS" dir="${basedir}/mozilla" failonerror="yes"
<copy todir="${objdir.native.path}/mozilla">
<fileset dir="${basedir}/mozilla">
<include name="nppluglet.res" />
</fileset>
</copy>
<exec os="SunOS" dir="${objdir.native.path}/mozilla" failonerror="yes"
executable="gmake"/>
<exec os="Linux" dir="${basedir}/mozilla" failonerror="yes"
<exec os="Linux" dir="${objdir.native.path}/mozilla" failonerror="yes"
executable="make"/>
<exec os="Windows 2000" dir="${basedir}/mozilla" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/mozilla" executable="make"
failonerror="yes"/>
<exec os="SunOS" dir="${basedir}/mozilla" failonerror="yes"
<exec os="SunOS" dir="${objdir.native.path}/mozilla" failonerror="yes"
executable="gmake">
<arg line="install" />
</exec>
<exec os="Linux" dir="${basedir}/mozilla" failonerror="yes"
<exec os="Linux" dir="${objdir.native.path}/mozilla" failonerror="yes"
executable="make">
<arg line="install" />
</exec>
<exec os="Windows 2000" dir="${basedir}/mozilla" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/mozilla" executable="make"
failonerror="yes">
<arg line="install" />
</exec>
@ -153,63 +173,65 @@
<target name="clean" depends="clean.classes">
<delete >
<fileset dir="${basedir}/src">
<fileset dir="${objdir.native.path}/src">
<include name="*.ilk"/>
</fileset>
</delete>
<delete >
<fileset dir="${basedir}/jni">
<fileset dir="${objdir.native.path}/jni">
<include name="*.ilk"/>
</fileset>
</delete>
<delete >
<fileset dir="${basedir}/mozilla">
<fileset dir="${objdir.native.path}/mozilla">
<include name="*.ilk"/>
</fileset>
</delete>
<exec os="SunOS" dir="${basedir}/src" executable="gmake"
<exec os="SunOS" dir="${objdir.native.path}/src" executable="gmake"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Linux" dir="${basedir}/src" executable="make"
<exec os="Linux" dir="${objdir.native.path}/src" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Windows 2000" dir="${basedir}/src" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/src" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Windows 2000" dir="${basedir}/jni" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/jni" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="SunOS" dir="${basedir}/jni" executable="gmake"
<exec os="SunOS" dir="${objdir.native.path}/jni" executable="gmake"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Linux" dir="${basedir}/jni" executable="make"
<exec os="Linux" dir="${objdir.native.path}/jni" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="SunOS" dir="${basedir}/mozilla" executable="gmake"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Linux" dir="${basedir}/mozilla" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Windows 2000" dir="${basedir}/mozilla" executable="make"
<exec os="Windows 2000" dir="${objdir.native.path}/mozilla" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="SunOS" dir="${objdir.native.path}/mozilla" executable="gmake"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
<exec os="Linux" dir="${objdir.native.path}/mozilla" executable="make"
failonerror="yes">
<arg line="clobber_all"/>
</exec>
</target>

Просмотреть файл

@ -1,17 +1,22 @@
import javax.media.*;
import javax.media.util.*;
import javax.media.format.*;
import javax.media.bean.playerbean.*;
import javax.media.control.*;
import org.mozilla.pluglet.*;
import org.mozilla.pluglet.mozilla.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import java.io.*;
import java.util.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.print.PrinterJob;
import java.io.InputStream;
import javax.media.ControllerEvent;
import javax.media.ControllerListener;
import javax.media.MediaLocator;
import javax.media.PrefetchCompleteEvent;
import javax.media.RealizeCompleteEvent;
import javax.media.bean.playerbean.MediaPlayer;
import org.mozilla.pluglet.Pluglet;
import org.mozilla.pluglet.PlugletFactory;
import org.mozilla.pluglet.PlugletStreamListener;
import org.mozilla.pluglet.mozilla.PlugletManager;
import org.mozilla.pluglet.mozilla.PlugletPeer;
import org.mozilla.pluglet.mozilla.PlugletStreamInfo;
import org.mozilla.pluglet.mozilla.PlugletTagInfo2;
public class JMPlayer implements PlugletFactory {

Просмотреть файл

@ -108,7 +108,7 @@
</fileset>
</jar>
<copy todir="${myenv.MOZ_SRC}/mozilla/dist/bin/plugins"
<copy todir="${objdir}/dist/bin/plugins"
file="${basedir}/build/mediaplayer.jar" />
</target>

Просмотреть файл

@ -42,7 +42,9 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
PLUGIN_SDK=$(DEPTH)/modules/plugin/tools/sdk
PLUGIN_SDK_PATH=modules/plugin/tools/sdk
PLUGIN_SDK_SRC=$(DEPTH)/../modules/plugin/tools/sdk
PLUGIN_SDK_OBJDIR=$(DEPTH)/modules/plugin/tools/sdk
XPIDL_MODULE = nppluglet
LIBRARY_NAME = nppluglet
@ -60,7 +62,7 @@ CPPSRCS = nsScriptablePeer.cpp \
XPIDLSRCS = nsISimplePlugin.idl
SHARED_LIBRARY_LIBS = $(PLUGIN_SDK)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS)
SHARED_LIBRARY_LIBS = $(PLUGIN_SDK_OBJDIR)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS)
ifeq ($(OS_ARCH),WINNT)
DEFFILE = $(win_srcdir)/nppluglet.def
@ -73,12 +75,11 @@ ifeq ($(OS_ARCH),WINNT)
INCLUDES += \
-I$(MSVCDIR)/Include \
-I$(MSVCDIR)/ATL/SRC \
-I../src \
-I$(DEPTH)/../java/plugins/src \
-I../src/_xpidlgen \
-I$(MOZILLA_FIVE_HOME)/../include/string \
-I$(MOZILLA_FIVE_HOME)/../include/xpcom_obsolete \
$(NULL)
CXXFLAGS += /Zi /Yd
endif
CXXFLAGS += -DFORCE_PR_LOG
@ -90,8 +91,8 @@ EXTRA_DSO_LDOPTS += $(XLDFLAGS) -rdynamic -lXi -lXext -lX11 -lm -lXt
endif
LOCAL_INCLUDES = -I./$(XPIDL_GEN_DIR) \
-I$(PLUGIN_SDK)/samples/include \
-I$(PLUGIN_SDK)/../../base/src \
-I$(PLUGIN_SDK_SRC)/samples/include \
-I$(PLUGIN_SDK_SRC)/../../base/src \
$(NULL)
install::
$(INSTALL) $(IFLAGS1) $(SHARED_LIBRARY) $(DIST)/bin/plugins

Просмотреть файл

@ -205,8 +205,11 @@ void PlugletEngine::StartJVM() {
vm_args.nOptions = 1; // EDBURNS: Change to 3 for debugging
vm_args.ignoreUnrecognized = JNI_FALSE;
/* Create the Java VM */
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletEngine::StartJVM about to start JVM with options %s %s %s\n",
options[0].optionString, options[1].optionString,
options[2].optionString));
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
printf("--bcJavaGlobal::StartJVM jvm started res %d\n",res);
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletEngine::StartJVM after CreateJavaVM res = %d\n",res));
}

Просмотреть файл

@ -155,8 +155,6 @@ nsresult PlugletFactory::Shutdown(void) {
}
nsresult PlugletFactory::GetMIMEDescription(const char* *result) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletFactory::GetMimeDescription\n"));
if(!result) {
return NS_ERROR_FAILURE;
}
@ -166,6 +164,10 @@ nsresult PlugletFactory::GetMIMEDescription(const char* *result) {
PlugletFactory::PlugletFactory(const char *inMimeDescription, const char *inPath) : jthis(nsnull), path(PL_strdup(inPath)), mimeDescription(PL_strdup(inMimeDescription))
{
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletFactory::PlugletFactory: mimeDescription: %s, path: %s\n",
mimeDescription, path));
}
PlugletFactory::~PlugletFactory(void) {
@ -203,7 +205,12 @@ PlugletFactory * PlugletFactory::Load(const char * path) {
char * mime = PlugletLoader::GetMIMEDescription(path);
PlugletFactory * result = nsnull;
if (mime) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletFactory::Load: About to create PlugletFactory instance\n"));
result = new PlugletFactory(mime,path);
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletFactory::Load: successfully created PlugletFactory instance\n"));
//delete[] mime; //nb we have a strange exception here
}
return result;

Просмотреть файл

@ -94,7 +94,6 @@ nsresult PlugletsDir::LoadPluglets() {
for (nsDirectoryIterator iter(dir,PR_TRUE); iter.Exists(); iter++) {
const nsFileSpec& file = iter;
const char* name = file.GetCString();
printf("debug: edburns: PlugletsDir::LoadPluglets: name: %s\n", name);
int length;
if((length = strlen(name)) <= 4 // if it's shorter than ".jar"
|| strcmp(name+length - 4,".jar") ) {
@ -104,14 +103,17 @@ nsresult PlugletsDir::LoadPluglets() {
mimeType = nsnull;
rv = plugletFactory->GetMIMEDescription(&mimeType);
if (NS_SUCCEEDED(rv)) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletsDir::LoadPluglets: got mime description: %s\n", mimeType));
const char *key = PL_strdup(mimeType);
printf("debug: edburns: key: %s address: %p\n",
key, key);
PLHashEntry *entry =
PL_HashTableAdd(mMimeTypeToPlugletFacoryHash,
(const void *) key,
plugletFactory);
rv = (nsnull != entry) ? NS_OK : NS_ERROR_FAILURE;
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletsDir::LoadPluglets: adding to mimeTypeToPlugletFactoryHash. rv: %d\n", rv));
}
}
}