diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-12-08 15:43:44 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-12-08 15:43:44 -0800 |
commit | 6471d5337d542fde05ece58b9337a60b3411fe8b (patch) | |
tree | 64d5b9ccbbca134c9064fcb867a2512002e26374 | |
parent | 6e221bf1f4463fb8ca9255d3f02362713d42436f (diff) | |
download | dsub-6471d5337d542fde05ece58b9337a60b3411fe8b.tar.gz dsub-6471d5337d542fde05ece58b9337a60b3411fe8b.tar.bz2 dsub-6471d5337d542fde05ece58b9337a60b3411fe8b.zip |
Upgrade to Cling 2.0.1, up min SDK to 4.0+
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | libs/cling-core-1.0.5.jar | bin | 551922 -> 0 bytes | |||
-rw-r--r-- | libs/cling-core-2.0.1.jar | bin | 0 -> 686501 bytes | |||
-rw-r--r-- | libs/cling-support-1.0.5.jar | bin | 359154 -> 0 bytes | |||
-rw-r--r-- | libs/cling-support-2.0.1.jar | bin | 0 -> 490043 bytes | |||
-rw-r--r-- | libs/javax.servlet-3.0.0.v201112011016.jar | bin | 0 -> 200387 bytes | |||
-rw-r--r-- | libs/jetty-all-8.1.16.v20140903.jar | bin | 0 -> 1880786 bytes | |||
-rw-r--r-- | libs/seamless-http-1.1.0.jar | bin | 0 -> 21646 bytes | |||
-rw-r--r-- | libs/seamless-util-1.1.0.jar | bin | 0 -> 94456 bytes | |||
-rw-r--r-- | libs/seamless-xml-1.1.0.jar | bin | 0 -> 63142 bytes | |||
-rw-r--r-- | libs/teleal-common-1.0.13.jar | bin | 231831 -> 0 bytes | |||
-rw-r--r-- | src/github/daneren2005/dsub/domain/DLNADevice.java | 2 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/provider/DLNARouteProvider.java | 129 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/DLNAController.java | 53 |
14 files changed, 138 insertions, 50 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 25734167..bbedcea4 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -30,7 +30,7 @@ <uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
- <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>
+ <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="19"/>
<supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
@@ -86,7 +86,7 @@ <service android:name=".service.DownloadService"
android:label="Subsonic Download Service"/>
- <service android:name="org.teleal.cling.android.AndroidUpnpServiceImpl"/>
+ <service android:name="org.fourthline.cling.android.AndroidUpnpServiceImpl"/>
<service android:name="github.daneren2005.dsub.service.sync.AuthenticatorService">
<intent-filter>
diff --git a/libs/cling-core-1.0.5.jar b/libs/cling-core-1.0.5.jar Binary files differdeleted file mode 100644 index 8079f329..00000000 --- a/libs/cling-core-1.0.5.jar +++ /dev/null diff --git a/libs/cling-core-2.0.1.jar b/libs/cling-core-2.0.1.jar Binary files differnew file mode 100644 index 00000000..632d3038 --- /dev/null +++ b/libs/cling-core-2.0.1.jar diff --git a/libs/cling-support-1.0.5.jar b/libs/cling-support-1.0.5.jar Binary files differdeleted file mode 100644 index a0ca6363..00000000 --- a/libs/cling-support-1.0.5.jar +++ /dev/null diff --git a/libs/cling-support-2.0.1.jar b/libs/cling-support-2.0.1.jar Binary files differnew file mode 100644 index 00000000..7fa28604 --- /dev/null +++ b/libs/cling-support-2.0.1.jar diff --git a/libs/javax.servlet-3.0.0.v201112011016.jar b/libs/javax.servlet-3.0.0.v201112011016.jar Binary files differnew file mode 100644 index 00000000..b1354096 --- /dev/null +++ b/libs/javax.servlet-3.0.0.v201112011016.jar diff --git a/libs/jetty-all-8.1.16.v20140903.jar b/libs/jetty-all-8.1.16.v20140903.jar Binary files differnew file mode 100644 index 00000000..25b1d324 --- /dev/null +++ b/libs/jetty-all-8.1.16.v20140903.jar diff --git a/libs/seamless-http-1.1.0.jar b/libs/seamless-http-1.1.0.jar Binary files differnew file mode 100644 index 00000000..98ec884a --- /dev/null +++ b/libs/seamless-http-1.1.0.jar diff --git a/libs/seamless-util-1.1.0.jar b/libs/seamless-util-1.1.0.jar Binary files differnew file mode 100644 index 00000000..12026b7f --- /dev/null +++ b/libs/seamless-util-1.1.0.jar diff --git a/libs/seamless-xml-1.1.0.jar b/libs/seamless-xml-1.1.0.jar Binary files differnew file mode 100644 index 00000000..1e740877 --- /dev/null +++ b/libs/seamless-xml-1.1.0.jar diff --git a/libs/teleal-common-1.0.13.jar b/libs/teleal-common-1.0.13.jar Binary files differdeleted file mode 100644 index 2d6403ef..00000000 --- a/libs/teleal-common-1.0.13.jar +++ /dev/null diff --git a/src/github/daneren2005/dsub/domain/DLNADevice.java b/src/github/daneren2005/dsub/domain/DLNADevice.java index ba4c2777..2de84013 100644 --- a/src/github/daneren2005/dsub/domain/DLNADevice.java +++ b/src/github/daneren2005/dsub/domain/DLNADevice.java @@ -22,7 +22,7 @@ package github.daneren2005.dsub.domain; import android.os.Parcel;
import android.os.Parcelable;
-import org.teleal.cling.model.meta.Device;
+import org.fourthline.cling.model.meta.Device;
/**
* Created by Scott on 11/1/2014.
diff --git a/src/github/daneren2005/dsub/provider/DLNARouteProvider.java b/src/github/daneren2005/dsub/provider/DLNARouteProvider.java index 44cde0ef..3601e696 100644 --- a/src/github/daneren2005/dsub/provider/DLNARouteProvider.java +++ b/src/github/daneren2005/dsub/provider/DLNARouteProvider.java @@ -33,19 +33,20 @@ import android.support.v7.media.MediaRouteProvider; import android.support.v7.media.MediaRouteProviderDescriptor; import android.util.Log; -import org.teleal.cling.android.AndroidUpnpService; -import org.teleal.cling.android.AndroidUpnpServiceImpl; -import org.teleal.cling.model.action.ActionInvocation; -import org.teleal.cling.model.message.UpnpResponse; -import org.teleal.cling.model.meta.Device; -import org.teleal.cling.model.meta.LocalDevice; -import org.teleal.cling.model.meta.RemoteDevice; -import org.teleal.cling.model.meta.StateVariable; -import org.teleal.cling.model.meta.StateVariableAllowedValueRange; -import org.teleal.cling.model.types.ServiceType; -import org.teleal.cling.registry.Registry; -import org.teleal.cling.registry.RegistryListener; -import org.teleal.cling.support.renderingcontrol.callback.GetVolume; +import org.eclipse.jetty.util.log.Logger; +import org.fourthline.cling.android.AndroidUpnpService; +import org.fourthline.cling.android.AndroidUpnpServiceImpl; +import org.fourthline.cling.model.action.ActionInvocation; +import org.fourthline.cling.model.message.UpnpResponse; +import org.fourthline.cling.model.meta.Device; +import org.fourthline.cling.model.meta.LocalDevice; +import org.fourthline.cling.model.meta.RemoteDevice; +import org.fourthline.cling.model.meta.StateVariable; +import org.fourthline.cling.model.meta.StateVariableAllowedValueRange; +import org.fourthline.cling.model.types.ServiceType; +import org.fourthline.cling.registry.Registry; +import org.fourthline.cling.registry.RegistryListener; +import org.fourthline.cling.support.renderingcontrol.callback.GetVolume; import java.util.ArrayList; import java.util.HashMap; @@ -58,9 +59,6 @@ import github.daneren2005.dsub.service.DLNAController; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.RemoteController; -/** - * Created by Scott on 11/28/13. - */ public class DLNARouteProvider extends MediaRouteProvider { private static final String TAG = DLNARouteProvider.class.getSimpleName(); public static final String CATEGORY_DLNA = "github.daneren2005.dsub.DLNA"; @@ -75,6 +73,10 @@ public class DLNARouteProvider extends MediaRouteProvider { public DLNARouteProvider(Context context) { super(context); + + // Use custom logger + org.eclipse.jetty.util.log.Log.setLog(new JettyAndroidLog()); + this.downloadService = (DownloadService) context; dlnaServiceConnection = new ServiceConnection() { @Override @@ -83,12 +85,12 @@ public class DLNARouteProvider extends MediaRouteProvider { dlnaService.getRegistry().addListener(new RegistryListener() { @Override public void remoteDeviceDiscoveryStarted(Registry registry, RemoteDevice remoteDevice) { - + Log.i(TAG, "Stared DLNA discovery"); } @Override public void remoteDeviceDiscoveryFailed(Registry registry, RemoteDevice remoteDevice, Exception e) { - + Log.w(TAG, "Failed to discover DLNA devices"); } @Override @@ -138,7 +140,10 @@ public class DLNARouteProvider extends MediaRouteProvider { dlnaService = null; } }; - context.bindService(new Intent(context, AndroidUpnpServiceImpl.class), dlnaServiceConnection, Context.BIND_AUTO_CREATE); + + if(!context.getApplicationContext().bindService(new Intent(context, AndroidUpnpServiceImpl.class), dlnaServiceConnection, Context.BIND_AUTO_CREATE)) { + Log.e(TAG, "Failed to bind to DLNA service"); + } } private void broadcastDescriptors() { @@ -189,7 +194,7 @@ public class DLNARouteProvider extends MediaRouteProvider { } private void deviceAdded(final Device device) { - final org.teleal.cling.model.meta.Service renderingControl = device.findService(new ServiceType("schemas-upnp-org", "RenderingControl")); + final org.fourthline.cling.model.meta.Service renderingControl = device.findService(new ServiceType("schemas-upnp-org", "RenderingControl")); if(renderingControl == null) { return; } @@ -235,6 +240,8 @@ public class DLNARouteProvider extends MediaRouteProvider { adding.remove(id); } }); + } else { + adding.remove(id); } } private void deviceRemoved(Device device) { @@ -302,4 +309,86 @@ public class DLNARouteProvider extends MediaRouteProvider { broadcastDescriptors(); } } + + public static class JettyAndroidLog implements Logger { + final private static java.util.logging.Logger log = java.util.logging.Logger.getLogger("Jetty"); + + public static boolean __isIgnoredEnabled = false; + public String _name; + + public JettyAndroidLog() { + this (JettyAndroidLog.class.getName()); + } + + public JettyAndroidLog(String name) { + _name = name; + } + + public String getName () { + return _name; + } + + public void debug(Throwable th) { + // Log.d(TAG, "", th); + } + + public void debug(String msg, Throwable th) { + // Log.d(TAG, msg, th); + } + + public void debug(String msg, Object... args) { + // Log.d(TAG, msg); + } + + public Logger getLogger(String name) { + return new JettyAndroidLog(name); + } + + public void info(String msg, Object... args) { + Log.i(TAG, msg); + } + + public void info(Throwable th) { + Log.i(TAG, "", th); + } + + public void info(String msg, Throwable th) { + Log.i(TAG, msg, th); + } + + public boolean isDebugEnabled() { + return false; + } + + public void warn(Throwable th) { + Log.w(TAG, "", th); + } + + public void warn(String msg, Object... args) { + Log.w(TAG, msg); + } + + public void warn(String msg, Throwable th) { + Log.w(TAG, msg, th); + } + + public boolean isIgnoredEnabled () { + return __isIgnoredEnabled; + } + + + public void ignore(Throwable ignored) { + if (__isIgnoredEnabled) { + warn("IGNORED", ignored); + } + } + + public void setIgnoredEnabled(boolean enabled) { + __isIgnoredEnabled = enabled; + } + + public void setDebugEnabled(boolean enabled) { + + } + } } diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java index 2448b088..522bf586 100644 --- a/src/github/daneren2005/dsub/service/DLNAController.java +++ b/src/github/daneren2005/dsub/service/DLNAController.java @@ -19,31 +19,30 @@ import android.content.SharedPreferences; import android.os.Looper;
import android.util.Log;
-import org.teleal.cling.controlpoint.ControlPoint;
-import org.teleal.cling.controlpoint.SubscriptionCallback;
-import org.teleal.cling.model.action.ActionInvocation;
-import org.teleal.cling.model.gena.CancelReason;
-import org.teleal.cling.model.gena.GENASubscription;
-import org.teleal.cling.model.message.UpnpResponse;
-import org.teleal.cling.model.meta.Device;
-import org.teleal.cling.model.meta.StateVariable;
-import org.teleal.cling.model.state.StateVariableValue;
-import org.teleal.cling.model.types.ServiceType;
-import org.teleal.cling.support.avtransport.callback.Pause;
-import org.teleal.cling.support.avtransport.callback.Play;
-import org.teleal.cling.support.avtransport.callback.Seek;
-import org.teleal.cling.support.avtransport.callback.SetAVTransportURI;
-import org.teleal.cling.support.avtransport.callback.Stop;
-import org.teleal.cling.support.avtransport.lastchange.AVTransportLastChangeParser;
-import org.teleal.cling.support.avtransport.lastchange.AVTransportVariable;
-import org.teleal.cling.support.contentdirectory.DIDLParser;
-import org.teleal.cling.support.lastchange.LastChange;
-import org.teleal.cling.support.model.DIDLContent;
-import org.teleal.cling.support.model.SeekMode;
-import org.teleal.cling.support.model.item.Item;
-import org.teleal.cling.support.model.item.MusicTrack;
-import org.teleal.cling.support.model.item.VideoItem;
-import org.teleal.cling.support.renderingcontrol.callback.SetVolume;
+import org.fourthline.cling.controlpoint.ControlPoint;
+import org.fourthline.cling.controlpoint.SubscriptionCallback;
+import org.fourthline.cling.model.action.ActionInvocation;
+import org.fourthline.cling.model.gena.CancelReason;
+import org.fourthline.cling.model.gena.GENASubscription;
+import org.fourthline.cling.model.message.UpnpResponse;
+import org.fourthline.cling.model.meta.Device;
+import org.fourthline.cling.model.state.StateVariableValue;
+import org.fourthline.cling.model.types.ServiceType;
+import org.fourthline.cling.support.avtransport.callback.Pause;
+import org.fourthline.cling.support.avtransport.callback.Play;
+import org.fourthline.cling.support.avtransport.callback.Seek;
+import org.fourthline.cling.support.avtransport.callback.SetAVTransportURI;
+import org.fourthline.cling.support.avtransport.callback.Stop;
+import org.fourthline.cling.support.avtransport.lastchange.AVTransportLastChangeParser;
+import org.fourthline.cling.support.avtransport.lastchange.AVTransportVariable;
+import org.fourthline.cling.support.contentdirectory.DIDLParser;
+import org.fourthline.cling.support.lastchange.LastChange;
+import org.fourthline.cling.support.model.DIDLContent;
+import org.fourthline.cling.support.model.SeekMode;
+import org.fourthline.cling.support.model.item.Item;
+import org.fourthline.cling.support.model.item.MusicTrack;
+import org.fourthline.cling.support.model.item.VideoItem;
+import org.fourthline.cling.support.renderingcontrol.callback.SetVolume;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -120,7 +119,7 @@ public class DLNAController extends RemoteController { boolean failed = false;
for(StateVariableValue val: m.values()) {
if(val.toString().indexOf("TransportStatus val=\"ERROR_OCCURRED\"") != -1) {
- Log.w(TAG, "Failed to load with event: val.toString()");
+ Log.w(TAG, "Failed to load with event: " + val.toString());
failed = true;
}
}
@@ -195,7 +194,7 @@ public class DLNAController extends RemoteController { public void shutdown() {
controlPoint.execute(new Stop(device.renderer.findService(new ServiceType("schemas-upnp-org", "AVTransport"))) {
@Override
- public void failure(ActionInvocation invocation, org.teleal.cling.model.message.UpnpResponse operation, String defaultMessage) {
+ public void failure(ActionInvocation invocation, org.fourthline.cling.model.message.UpnpResponse operation, String defaultMessage) {
Log.w(TAG, "Stop failed: " + defaultMessage);
}
});
|