[vlma-devel] commit: Now the init() function needs also the program streamingStrategy. ( Adrien Maglo )

git version control git at videolan.org
Thu Oct 9 23:09:33 CEST 2008


vlma | branch: master | Adrien Maglo <magsoft at videolan.org> | Thu Oct  9 22:56:22 2008 +0200| [a8ba0c58eb9fa59f518c0b7e0a8d9a736ebd751f] | committer: Adrien Maglo 

Now the init() function needs also the program streamingStrategy.

That is in order to create the right element ( broadcast or vod ) when it gives the orders to VLC.

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

 .../org/videolan/vlma/order/DTTOrderSender.java    |    2 +-
 .../java/org/videolan/vlma/order/OrderSender.java  |   10 +++++++---
 .../org/videolan/vlma/order/SatOrderSender.java    |    2 +-
 .../org/videolan/vlma/order/StreamOrderSender.java |    2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/DTTOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/DTTOrderSender.java
index 0f5ef5d..52ba5e1 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/DTTOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/DTTOrderSender.java
@@ -32,7 +32,7 @@ public class DTTOrderSender extends OrderSender {
     @Override
     public void start(Order o) throws IOException {
         telnetConnect(o.getAdapter().getServer());
-        init(getVLMCommandName(o), o.getAdapter());
+        init(getVLMCommandName(o), o.getAdapter(), null);
         if (!o.getMedias().isEmpty()) {
             DTTChannel ch = (DTTChannel) o.getMedias().get(0);
             telnetCommand("setup " + getVLMCommandName(o) + " input dvb://",
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
index 4ddabb9..afc91ed 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
@@ -134,13 +134,17 @@ public abstract class OrderSender {
      *
      * @throws IOException Operation aborted
      */
-    protected void init(String commandName, Adapter adapter) throws IOException {
+    protected void init(String commandName, Adapter adapter, StreamingStrategy streamingStrategy )
+    	throws IOException {
         // Remove the stream if there is one
         telnetCommand("setup " + commandName + " disabled", adapter);
         telnetCommand("control " + commandName + " stop", adapter);
         telnetCommand("del " + commandName, adapter);
-        // Create a multicast diffusion program
-        telnetCommand("new " + commandName + " broadcast", adapter);
+        // Create a vod program
+        if(streamingStrategy.getProtocol() == StreamingStrategy.Protocol.VOD)
+        	telnetCommand("new " + commandName + " vod", adapter);
+        else // Create a multicast diffusion program
+        	telnetCommand("new " + commandName + " broadcast", adapter);
         // Verbose mode using colors
         telnetCommand("setup " + commandName + " option vvv", adapter);
         telnetCommand("setup " + commandName + " option color", adapter);
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
index 6a42128..e516444 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
@@ -32,7 +32,7 @@ public class SatOrderSender extends OrderSender {
     @Override
     public void start(Order o) throws IOException {
         telnetConnect(o.getAdapter().getServer());
-        init(getVLMCommandName(o), o.getAdapter());
+        init(getVLMCommandName(o), o.getAdapter(), null);
         if (!o.getMedias().isEmpty()) {
             SatChannel ch = (SatChannel) o.getMedias().get(0);
             telnetCommand("setup " + getVLMCommandName(o) + " input dvb://", o.getAdapter());
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/StreamOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/StreamOrderSender.java
index a585aaf..7f17517 100755
--- a/vlma-core/src/main/java/org/videolan/vlma/order/StreamOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/StreamOrderSender.java
@@ -37,7 +37,7 @@ public class StreamOrderSender extends OrderSender {
 
             String commandName = getVLMCommandName(o) + ch.getId();
 
-            init(commandName, o.getAdapter());
+            init(commandName, o.getAdapter(), null);
             telnetCommand("setup " + commandName + " loop", o.getAdapter());
             telnetCommand("setup " + commandName + " option sout-keep", o.getAdapter());
             telnetCommand("setup " + commandName + " input \"" + ch.getStreamURL()



More information about the vlma-devel mailing list