[vlma-devel] commit: Better display-name for encapsulations. (Adrien Grand )
git version control
git at videolan.org
Sat Jan 3 00:56:12 CET 2009
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Fri Jan 2 19:10:14 2009 +0100| [fdd2ae688914320be8f513bfbdfc23b8e7af25b2] | committer: Adrien Grand
Better display-name for encapsulations.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=fdd2ae688914320be8f513bfbdfc23b8e7af25b2
---
.../org/videolan/vlma/model/StreamingStrategy.java | 13 ++++++++++++-
.../java/org/videolan/vlma/order/OrderBuilder.java | 2 +-
.../WEB-INF/jsp/media/mediaprogramadd_right.jsp | 19 +++++++++----------
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/vlma-api/src/main/java/org/videolan/vlma/model/StreamingStrategy.java b/vlma-api/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
index b8098d5..119796c 100644
--- a/vlma-api/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
+++ b/vlma-api/src/main/java/org/videolan/vlma/model/StreamingStrategy.java
@@ -63,7 +63,18 @@ public class StreamingStrategy implements Serializable {
}
public static enum Encapsulation {
- TS, PS, MPEG1, OGG, ASF, ASFH, AVI, MPJPEG;
+ TS("MPEG-TS", "ts"),
+ PS("MPEG-PS", "ps"),
+ OGG("Ogg", "ogg"),
+ ASF("ASF/WMV", "asf"),
+ AVI("AVI", "avi"),
+ MPJPEG("MPJPEG", "mpjpeg"),
+ RAW("Raw", "raw");
+ private Encapsulation(String name, String shortName) { this.name = name; this.shortName = shortName; }
+ private String name;
+ private String shortName;
+ public String getName() { return name; }
+ public String getShortName() { return shortName; }
}
private static final Type DEFAULT_TYPE = Type.BROADCAST;
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/OrderBuilder.java b/vlma-core/src/main/java/org/videolan/vlma/order/OrderBuilder.java
index 171b9c2..e3e6e8d 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/OrderBuilder.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/OrderBuilder.java
@@ -146,7 +146,7 @@ public class OrderBuilder {
assert false : "Unexpected protocol: " + program.getStreamingStrategy().getProtocol();
}
dst.append(String.format("standard{mux=%s,access=%s,dst=%s",
- program.getStreamingStrategy().getEncapsulation().toString().toLowerCase(),
+ program.getStreamingStrategy().getEncapsulation().getShortName(),
program.getStreamingStrategy().getProtocol().getScheme(),
destination));
if (program.getStreamingStrategy().isEnabled(Announcement.SAP)) {
diff --git a/vlma-webapp/src/main/webapp/WEB-INF/jsp/media/mediaprogramadd_right.jsp b/vlma-webapp/src/main/webapp/WEB-INF/jsp/media/mediaprogramadd_right.jsp
index 85a3991..b15b17d 100644
--- a/vlma-webapp/src/main/webapp/WEB-INF/jsp/media/mediaprogramadd_right.jsp
+++ b/vlma-webapp/src/main/webapp/WEB-INF/jsp/media/mediaprogramadd_right.jsp
@@ -48,8 +48,8 @@
<spring:bind path="mediaProgramAdd.type">
<td><select id="type" name="type" onchange="onTypeUpdate();">
<c:forEach items="${mediaProgramAdd.types}" var="typeOption">
- <option name="${typeOption}" <c:if test="${mediaProgramAdd.type == typeOption}">selected="true"</c:if>>
- <c:out value="${typeOption}" />
+ <option value="${typeOption}" <c:if test="${mediaProgramAdd.type == typeOption}">selected="true"</c:if>>
+ <c:out value="${typeOption.name}" />
</option>
</c:forEach>
</select></td>
@@ -61,8 +61,8 @@
<spring:bind path="mediaProgramAdd.protocol">
<td><select name="protocol" id="protocol" onchange="onProtocolUpdate();">
<c:forEach items="${mediaProgramAdd.protocols}" var="protocolOption">
- <option name="${protocolOption}" <c:if test="${mediaProgramAdd.protocol == protocolOption}">selected="true"</c:if>>
- <c:out value="${protocolOption}" />
+ <option value="${protocolOption}" <c:if test="${mediaProgramAdd.protocol == protocolOption}">selected="true"</c:if>>
+ <c:out value="${protocolOption.name}" />
</option>
</c:forEach>
</select></td>
@@ -81,8 +81,8 @@
<spring:bind path="mediaProgramAdd.mux">
<td><select id="mux" name="mux" onchange="onMuxUpdate();">
<c:forEach items="${mediaProgramAdd.muxs}" var="muxOption">
- <option name="${muxOption}" <c:if test="${mediaProgramAdd.mux == muxOption}">selected="true"</c:if>>
- <c:out value="${muxOption}" />
+ <option value="${muxOption}" <c:if test="${mediaProgramAdd.mux == muxOption}">selected="true"</c:if>>
+ <c:out value="${muxOption.name}" />
</option>
</c:forEach>
</select></td>
@@ -95,7 +95,7 @@
<spring:bind path="mediaProgramAdd.announcementCheckboxes[${loopStatus.index}].checked">
<input type="hidden" name="_<c:out value="${status.expression}"/>" />
<input id="announcements_<c:out value="${announcementOption.announcement}"/>" type="checkbox" name="<c:out value="${status.expression}"/>" <c:if test="${announcementOption.checked}">checked="checked"</c:if> />
- <c:out value="${announcementOption.announcement}" />
+ <c:out value="${announcementOption.announcement.name}" />
${status.errorCode}
<br />
</spring:bind>
@@ -135,9 +135,8 @@ function isCompatible1(type, protocol) {
function isCompatible2(protocol, mux) {
if(protocol == "UDP_MULTICAST") {
return mux == "TS";
- }
- if(protocol == "RTSP") {
- return mux == "TS" || mux == "PS";
+ } else if(protocol == "RTSP") {
+ return mux == "RAW";
}
return true;
}
More information about the vlma-devel
mailing list