[vlma-devel] commit: No announcement. (Adrien Grand )

git version control git at videolan.org
Wed Jun 25 19:38:05 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Wed Jun 25 15:34:35 2008 +0200| [84747ca482a76d17e0670c52a41d5a675f4f6e5a]

No announcement.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=84747ca482a76d17e0670c52a41d5a675f4f6e5a
---

 vlma-daemon/src/main/resources/daemon.xml          |    1 +
 .../org/videolan/vlma/model/StreamingStrategy.java |    2 +-
 .../org/videolan/vlma/model/order/FilesOrder.java  |   18 ++++++++----------
 .../org/videolan/vlma/model/order/SatOrder.java    |   12 ++++++++----
 .../org/videolan/vlma/model/order/StreamOrder.java |   18 ++++++++----------
 .../org/videolan/vlma/model/order/TNTOrder.java    |   12 ++++++++----
 6 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/vlma-daemon/src/main/resources/daemon.xml b/vlma-daemon/src/main/resources/daemon.xml
index 3cd53c8..59af876 100644
--- a/vlma-daemon/src/main/resources/daemon.xml
+++ b/vlma-daemon/src/main/resources/daemon.xml
@@ -79,6 +79,7 @@
 
 	<bean id="orderGiver" class="org.videolan.vlma.OrderGiverImpl">
 	    <property name="vlmaService" ref="vlmaService" />
+	    <property name="orderFactory" ref="orderFactory" />
 	</bean>
 
     <bean id="orderMonitor" class="org.videolan.vlma.monitor.OrderMonitor">
diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/StreamingStrategy.java b/vlma-model/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
index e1f7f8e..51a57bc 100644
--- a/vlma-model/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
@@ -32,7 +32,7 @@ public class StreamingStrategy {
     }
 
     public enum Announcement {
-        SAP
+        NONE, SAP
     }
 
     private static final Protocol DEFAULT_PROTOCOL = Protocol.UDP;
diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/order/FilesOrder.java b/vlma-model/src/main/java/org/videolan/vlma/model/order/FilesOrder.java
index 5b8cabc..c9745a8 100644
--- a/vlma-model/src/main/java/org/videolan/vlma/model/order/FilesOrder.java
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/order/FilesOrder.java
@@ -22,6 +22,7 @@ package org.videolan.vlma.model.order;
 
 import java.io.IOException;
 
+import org.videolan.vlma.model.StreamingStrategy;
 import org.videolan.vlma.model.media.FilesChannel;
 
 public class FilesOrder extends Order {
@@ -43,17 +44,14 @@ public class FilesOrder extends Order {
                 telnetCommand("setup " + getVLMCommandName() + " input \"" + file_path + "\"");
             }
 
-            String command = String.format(
-                    "#standard{mux=ts,access=udp,dst=%s,sap,name=\"%s\",group=\"%s\"}",
-                    ch.getProgram().getIp().getHostAddress(),
-                    ch.getProgram().getSapName(),
-                    ch.getProgram().getSapGroup());
-
-            // Orders to stream the channels
-            command = "setup " + getVLMCommandName()
-                    + " output " + command;
+            StringBuffer output = new StringBuffer();
+            output.append(String.format("#standard{mux=ts,access=udp,dst=%s", ch.getProgram().getIp().getHostAddress()));
+            if (streamingStrategy.getAnnouncement().equals(StreamingStrategy.Announcement.SAP)) {
+                output.append(String.format(",sap,name=\"%s\",group=\"%s\")", ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
+            }
+            output.append("}");
 
-            telnetCommand(command);
+            telnetCommand("setup " + getVLMCommandName() + " output " + output.toString());
             telnetCommand("setup " + getVLMCommandName() + " enabled");
             telnetCommand("control " + getVLMCommandName() + " play");
         }
diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/order/SatOrder.java b/vlma-model/src/main/java/org/videolan/vlma/model/order/SatOrder.java
index 8916dcc..7b18c5f 100644
--- a/vlma-model/src/main/java/org/videolan/vlma/model/order/SatOrder.java
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/order/SatOrder.java
@@ -23,6 +23,7 @@ package org.videolan.vlma.model.order;
 import java.io.IOException;
 
 import org.videolan.vlma.VLMa;
+import org.videolan.vlma.model.StreamingStrategy;
 import org.videolan.vlma.model.media.Media;
 import org.videolan.vlma.model.media.SatChannel;
 
@@ -65,10 +66,13 @@ public class SatOrder extends Order {
                 if (command != "") {
                     command += ",";
                 }
-                command += String.format(
-                        "dst=standard{mux=ts,access=udp,dst=%s,sap,name=\"%s\",group=\"%s\"},select=\"program=%d\"",
-                        ch.getProgram().getIp().getHostAddress(), ch.getProgram().getSapName(),
-                        ch.getProgram().getSapGroup(), ch.getSid());
+                command += String.format("dst=standard{mux=ts,access=udp,dst=%s",
+                        ch.getProgram().getIp().getHostAddress());
+                if (streamingStrategy.getAnnouncement().equals(StreamingStrategy.Announcement.SAP)) {
+                    command += String.format(",sap,name=\"%s\",group=\"%s\"",
+                            ch.getProgram().getSapName(), ch.getProgram().getSapGroup());
+                }
+                command += String.format("},select=\"program=%d\"", ch.getSid());
             }
             // Orders to stream the channels
             telnetCommand("setup " + getVLMCommandName()
diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/order/StreamOrder.java b/vlma-model/src/main/java/org/videolan/vlma/model/order/StreamOrder.java
index 5321a6f..85b5451 100755
--- a/vlma-model/src/main/java/org/videolan/vlma/model/order/StreamOrder.java
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/order/StreamOrder.java
@@ -22,6 +22,7 @@ package org.videolan.vlma.model.order;
 
 import java.io.IOException;
 
+import org.videolan.vlma.model.StreamingStrategy;
 import org.videolan.vlma.model.media.StreamChannel;
 
 public class StreamOrder extends Order {
@@ -41,17 +42,14 @@ public class StreamOrder extends Order {
             telnetCommand("setup " + getVLMCommandName() +
                     " input \"" + ch.getStreamURL() + "\"");
 
-            String command = String.format(
-                    "#standard{mux=ts,access=udp,dst=%s,sap,name=\"%s\",group=\"%s\"}",
-                    ch.getProgram().getIp().getHostAddress(),
-                    ch.getProgram().getSapName(),
-                    ch.getProgram().getSapGroup());
+            StringBuffer output = new StringBuffer();
+            output.append(String.format("#standard{mux=ts,access=udp,dst=%s", ch.getProgram().getIp().getHostAddress()));
+            if (streamingStrategy.getAnnouncement().equals(StreamingStrategy.Announcement.SAP)) {
+                output.append(String.format(",sap,name=\"%s\",group=\"%s\")", ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
+            }
+            output.append("}");
 
-            // Orders to stream the channels
-            command = "setup " + getVLMCommandName()
-                    + " output " + command;
-
-            telnetCommand(command);
+            telnetCommand("setup " + getVLMCommandName() + " output " + output.toString());
             telnetCommand("setup " + getVLMCommandName() + " enabled");
             telnetCommand("control " + getVLMCommandName() + " play");
         }
diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/order/TNTOrder.java b/vlma-model/src/main/java/org/videolan/vlma/model/order/TNTOrder.java
index b03bb0a..3eee772 100644
--- a/vlma-model/src/main/java/org/videolan/vlma/model/order/TNTOrder.java
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/order/TNTOrder.java
@@ -23,6 +23,7 @@ package org.videolan.vlma.model.order;
 import java.io.IOException;
 
 import org.videolan.vlma.VLMa;
+import org.videolan.vlma.model.StreamingStrategy;
 import org.videolan.vlma.model.media.Media;
 import org.videolan.vlma.model.media.TNTChannel;
 
@@ -55,10 +56,13 @@ public class TNTOrder extends Order {
                 if (command != "") {
                     command += ",";
                 }
-                command += String.format(
-                                "dst=standard{mux=ts,access=udp,dst=%s,sap,name=\"%s\",group=\"%s\"},select=\"program=%d\"",
-                                ch.getProgram().getIp().getHostAddress(), ch.getProgram().getSapName(),
-                                ch.getProgram().getSapGroup(), ch.getSid());
+                command += String.format("dst=standard{mux=ts,access=udp,dst=%s",
+                        ch.getProgram().getIp().getHostAddress());
+                if (streamingStrategy.getAnnouncement().equals(StreamingStrategy.Announcement.SAP)) {
+                    command += String.format(",sap,name=\"%s\",group=\"%s\"",
+                            ch.getProgram().getSapName(), ch.getProgram().getSapGroup());
+                }
+                command += String.format("},select=\"program=%d\"", ch.getSid());
             }
             // Orders to stream the channels
             telnetCommand("setup " + getVLMCommandName()



More information about the vlma-devel mailing list