[vlma-devel] commit: Adapt fileOrderSender in order to support VoD. (Adrien Maglo )
git version control
git at videolan.org
Thu Oct 9 23:09:34 CEST 2008
vlma | branch: master | Adrien Maglo <magsoft at videolan.org> | Thu Oct 9 23:04:20 2008 +0200| [0ecacddf656502ea997cf14c303d7e49b5f10fe6] | committer: Adrien Maglo
Adapt fileOrderSender in order to support VoD.
This streaming strategy is just available for file channels.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=0ecacddf656502ea997cf14c303d7e49b5f10fe6
---
.../org/videolan/vlma/order/FilesOrderSender.java | 41 ++++++++++++--------
1 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/FilesOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/FilesOrderSender.java
index 73ee309..dab9587 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/FilesOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/FilesOrderSender.java
@@ -34,28 +34,37 @@ public class FilesOrderSender extends OrderSender {
telnetConnect(o.getAdapter().getServer());
for (Media m : o.getMedias()) {
FilesChannel ch = (FilesChannel) m;
+ StreamingStrategy streamingStrategy = ch.getProgram().getStreamingStrategy();
String commandName = getVLMCommandName(o) + ch.getId();
- init(commandName, o.getAdapter());
- telnetCommand("setup " + commandName + " loop", o.getAdapter());
- telnetCommand("setup " + commandName + " option sout-keep", o.getAdapter());
-
- // Set the input with the file list
- for (String file_path : ch.getFiles()) {
- telnetCommand("setup " + commandName + " input \"" + file_path + "\"", o.getAdapter());
+ init(commandName, o.getAdapter(), streamingStrategy);
+ if(streamingStrategy.getProtocol() == StreamingStrategy.Protocol.VOD)
+ {
+ telnetCommand("setup " + commandName + " input \"" + ch.getFiles().get(0) + "\"", o.getAdapter());
+ telnetCommand("setup " + commandName + " enabled", o.getAdapter());
}
+ else
+ {
+ telnetCommand("setup " + commandName + " loop", o.getAdapter());
+ telnetCommand("setup " + commandName + " option sout-keep", o.getAdapter());
- StringBuilder output = new StringBuilder();
- output.append(String.format("#standard{mux=%s,access=%s,dst=%s", getMux(ch.getProgram()), getAccess(ch.getProgram()), getDst(ch.getProgram())));
- if (ch.getProgram().getStreamingStrategy().isEnabled(StreamingStrategy.Announcement.SAP)) {
- output.append(String.format(",sap,name=\"%s\",group=\"%s\")", ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
+ // Set the input with the file list
+ for (String file_path : ch.getFiles()) {
+ telnetCommand("setup " + commandName + " input \"" + file_path + "\"", o.getAdapter());
+ }
+
+ StringBuilder output = new StringBuilder();
+ output.append(String.format("#standard{mux=%s,access=%s,dst=%s", getMux(ch.getProgram()), getAccess(ch.getProgram()), getDst(ch.getProgram())));
+ if (streamingStrategy.isEnabled(StreamingStrategy.Announcement.SAP)) {
+ output.append(String.format(",sap,name=\"%s\",group=\"%s\")", ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
+ }
+ output.append("}");
+
+ telnetCommand("setup " + commandName + " output " + output.toString(), o.getAdapter());
+ telnetCommand("setup " + commandName + " enabled", o.getAdapter());
+ telnetCommand("control " + commandName + " play", o.getAdapter());
}
- output.append("}");
-
- telnetCommand("setup " + commandName + " output " + output.toString(), o.getAdapter());
- telnetCommand("setup " + commandName + " enabled", o.getAdapter());
- telnetCommand("control " + commandName + " play", o.getAdapter());
}
telnetClose();
}
More information about the vlma-devel
mailing list