[vlma-devel] commit: Add an order class for the StreamChannels. (Adrien Maglo )

git version control git at videolan.org
Mon May 19 20:51:21 CEST 2008


vlma | branch: master | Adrien Maglo <magsoft at videolan.org> | Mon May 19 20:52:42 2008 +0200| [ab93cb7eab2839863eef5f06562cc223445f59ca]

Add an order class for the StreamChannels.

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

 .../org/videolan/vlma/model/order/StreamOrder.java |   62 ++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

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
new file mode 100755
index 0000000..8c17519
--- /dev/null
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/order/StreamOrder.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2006-2008 the VideoLAN team
+ *
+ * This file is part of VLMa.
+ *
+ * VLMa is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * VLMa is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VLMa. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.videolan.vlma.model.order;
+
+import java.io.IOException;
+
+import org.videolan.vlma.model.media.StreamChannel;
+import org.videolan.vlma.model.order.Order;
+
+public class StreamOrder extends Order {
+
+    @Override
+    public void start() throws IOException {
+        telnetConnect();
+        init();
+        if (!medias.medias.isEmpty()) {
+            StreamChannel ch = (StreamChannel) medias.medias.get(0);
+
+            telnetCommand("setup " + getVLMCommandName()
+                    + " loop");
+            telnetCommand("setup " + getVLMCommandName()
+                    + " option sout-keep");
+
+            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());
+
+            // Orders to stream the channels
+            command = "setup " + getVLMCommandName()
+                    + " output " + command;
+
+            telnetCommand(command);
+            telnetCommand("setup " + getVLMCommandName() + " enabled");
+            telnetCommand("control " + getVLMCommandName() + " play");
+        }
+        telnetClose();
+    }
+
+}



More information about the vlma-devel mailing list