Revision
25706
Author
amogge
Date
2010-09-21 10:45:49 -0700 (Tue, 21 Sep 2010)

Log Message

less traffic

Modified Paths

Diff

Modified: client/trunk/azureus3/src/com/aelitis/azureus/core/messenger/config/PlatformDevicesMessenger.java (25705 => 25706)


--- client/trunk/azureus3/src/com/aelitis/azureus/core/messenger/config/PlatformDevicesMessenger.java	2010-09-21 16:30:21 UTC (rev 25705)
+++ client/trunk/azureus3/src/com/aelitis/azureus/core/messenger/config/PlatformDevicesMessenger.java	2010-09-21 17:45:49 UTC (rev 25706)
@@ -51,17 +51,13 @@
 
 	private static final String OP_QOS_TRANSCODE = "qos-transcode";
 
-	private static final String OP_QOS_PLAYBACK = "qos-playback";
-
-	private static final String OP_GET_PROFILES = "get-profiles";
-
 	private static final String OP_REPORT_DEVICES = "report-devices";
-
-	private static final String OP_QOS_TRANSCODE_REQUEST = "qos-transcode-request";
 	
-	private static String plugin_xcode_version = null;
+	private static String[] ignoreExtensions = { ".jpg", ".mp3", ".rar", };
 	
-	private static String plugin_itunes_version = null;
+	static {
+		Arrays.sort(ignoreExtensions);
+	}
 
 	public static void qosTurnOn(boolean withITunes) {
 		if (!COConfigurationManager.getBooleanParameter(CFG_SEND_QOS, false)) {
@@ -136,34 +132,6 @@
 		map.put("os-name", Constants.OSName);
 	}
 
-	public static void qosTranscodeRequest(TranscodeTarget transcodeTarget, String sourceRef) {
-		if (!COConfigurationManager.getBooleanParameter(CFG_SEND_QOS, false)
-				|| transcodeTarget == null) {
-			return;
-		}
-
-		HashMap<String, Object> map = new HashMap<String, Object>();
-
-		addPluginVersionsToMap(map);
-
-		Device device = transcodeTarget.getDevice();
-		if (device != null) { // should never be null..
-			map.put("device-name", getDeviceName(device));
-			map.put("device-type", new Integer(device.getType()));
-		}
-		if (transcodeTarget instanceof DeviceMediaRenderer) {
-			DeviceMediaRenderer renderer = (DeviceMediaRenderer) transcodeTarget;
-			map.put("renderer-species",
-					Integer.valueOf(renderer.getRendererSpecies()));
-		}
-		map.put("source-ref", sourceRef);
-
-		PlatformMessage message = new PlatformMessage("AZMSG", LISTENER_ID,
-				OP_QOS_TRANSCODE_REQUEST, map, 5000);
-		message.setSendAZID(false);
-		PlatformMessenger.queueMessage(message, null);
-	}
-
 	private static Object getDeviceName(Device device) {
 		String name = device.getName();
 		String classification = device.getClassification();
@@ -177,12 +145,29 @@
 			return;
 		}
 
+		HashMap<String, Object> map = new HashMap<String, Object>();
+
 		TranscodeFile transcodeFile = job.getTranscodeFile();
 		DiskManagerFileInfo sourceFileInfo = null;
 		try {
 			sourceFileInfo = transcodeFile.getSourceFile();
 		} catch (Throwable t) {
 		}
+		
+		// Don't worry, we don't send the filename, just the extension.  This
+		// helps us figure out which file types are failing/succeeding the most
+		if (sourceFileInfo != null) {
+			String extension = FileUtil.getExtension(sourceFileInfo.getFile().getName()).toLowerCase();
+			long len = sourceFileInfo.getLength();
+			if (Arrays.binarySearch(ignoreExtensions, extension) >= 0
+					|| extension.matches("^\\.r[0-9][0-9]$") || len < 768000) {
+				return;
+			}
+			map.put("source-file-ext", extension);
+			map.put("source-file-size", new Long(len));
+		}
+		
+		
 		DiskManagerFileInfo targetFileInfo = null;
 		try {
 			targetFileInfo = transcodeFile.getTargetFile();
@@ -192,8 +177,6 @@
 		TranscodeTarget target = job.getTarget();
 		Device device = target.getDevice();
 		
-		HashMap<String, Object> map = new HashMap<String, Object>();
-
 		addPluginVersionsToMap(map);
 
 		map.put("job-state", Integer.valueOf(stateOveride));
@@ -240,12 +223,6 @@
 			map.put("renderer-species", Integer.valueOf(renderer.getRendererSpecies()));
 		}
 
-		// Don't worry, we don't send the filename, just the extension.  This
-		// helps us figure out which file types are failing/succeeding the most
-		if (sourceFileInfo != null) {
-			map.put("source-file-ext", FileUtil.getExtension(sourceFileInfo.getFile().getName()));
-			map.put("source-file-size", new Long(sourceFileInfo.getLength()));
-		}
 		if (targetFileInfo != null) {
 			map.put("target-file-ext", FileUtil.getExtension(targetFileInfo.getFile().getName()));
 			map.put("target-file-size", new Long(targetFileInfo.getLength()));

Modified: client/trunk/azureus3/src/com/aelitis/azureus/ui/swt/devices/TranscodeChooser.java (25705 => 25706)


--- client/trunk/azureus3/src/com/aelitis/azureus/ui/swt/devices/TranscodeChooser.java	2010-09-21 16:30:21 UTC (rev 25705)
+++ client/trunk/azureus3/src/com/aelitis/azureus/ui/swt/devices/TranscodeChooser.java	2010-09-21 17:45:49 UTC (rev 25706)
@@ -286,12 +286,6 @@
 
 		if (selectedTranscodeTarget != null) {
 			try {
-				PlatformDevicesMessenger.qosTranscodeRequest(selectedTranscodeTarget,
-						source);
-			} catch (Throwable ignore) {
-			}
-
-			try {
 				TranscodeProfile defaultProfile = selectedTranscodeTarget.getDefaultTranscodeProfile();
 				if (defaultProfile != null) {
 					// user chose not to ask