use of us.mn.state.dot.tms.EncoderStream in project iris by mnit-rtmc.
the class EncoderStreamModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<EncoderStream>> createColumns() {
ArrayList<ProxyColumn<EncoderStream>> cols = new ArrayList<ProxyColumn<EncoderStream>>(8);
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.view.num", 80, Integer.class) {
public Object getValueAt(EncoderStream es) {
return es.getViewNum();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "viewNum");
}
public void setValueAt(EncoderStream es, Object value) {
Integer view = (value instanceof Integer) ? (Integer) value : null;
es.setViewNum(view);
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.flow", 90, Boolean.class) {
public Object getValueAt(EncoderStream es) {
return es.getFlowStream();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "flowStream");
}
public void setValueAt(EncoderStream es, Object value) {
if (value instanceof Boolean)
es.setFlowStream((Boolean) value);
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.encoding", 90) {
public Object getValueAt(EncoderStream es) {
return Encoding.fromOrdinal(es.getEncoding());
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "encoding");
}
public void setValueAt(EncoderStream es, Object value) {
if (value instanceof Encoding) {
Encoding e = (Encoding) value;
es.setEncoding(e.ordinal());
}
}
protected TableCellEditor createCellEditor() {
return new DefaultCellEditor(new JComboBox<Encoding>(Encoding.values()));
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.quality", 80) {
public Object getValueAt(EncoderStream es) {
return EncodingQuality.fromOrdinal(es.getQuality());
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "quality");
}
public void setValueAt(EncoderStream es, Object value) {
if (value instanceof EncodingQuality) {
EncodingQuality q = (EncodingQuality) value;
es.setQuality(q.ordinal());
}
}
protected TableCellEditor createCellEditor() {
return new DefaultCellEditor(new JComboBox<EncodingQuality>(EncodingQuality.values()));
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.uri.scheme", 100) {
public Object getValueAt(EncoderStream es) {
return es.getUriScheme();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "uriScheme");
}
public void setValueAt(EncoderStream es, Object value) {
String s = value.toString().trim();
es.setUriScheme((s.length() > 0) ? s : null);
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.uri.path", 240) {
public Object getValueAt(EncoderStream es) {
return es.getUriPath();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "uriPath");
}
public void setValueAt(EncoderStream es, Object value) {
String p = value.toString().trim();
es.setUriPath((p.length() > 0) ? p : null);
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.mcast.port", 100, Integer.class) {
public Object getValueAt(EncoderStream es) {
return es.getMcastPort();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "mcastPort");
}
public void setValueAt(EncoderStream es, Object value) {
Integer port = (value instanceof Integer) ? (Integer) value : null;
es.setMcastPort(port);
}
});
cols.add(new ProxyColumn<EncoderStream>("encoder.stream.latency", 100, Integer.class) {
public Object getValueAt(EncoderStream es) {
return es.getLatency();
}
public boolean isEditable(EncoderStream es) {
return canWrite(es, "latency");
}
public void setValueAt(EncoderStream es, Object value) {
if (value instanceof Integer)
es.setLatency((Integer) value);
}
});
return cols;
}
use of us.mn.state.dot.tms.EncoderStream in project iris by mnit-rtmc.
the class SwitchProp method formatReq.
/**
* Format a switch request
*/
private String formatReq() {
EncoderStream es = getEncoderStream();
StringBuilder sb = new StringBuilder();
sb.append("play");
sb.append(UNIT_SEP);
sb.append(pin - 1);
sb.append(UNIT_SEP);
sb.append(getCamNum());
sb.append(UNIT_SEP);
sb.append(getUri());
sb.append(UNIT_SEP);
sb.append(getEncoding(es));
sb.append(UNIT_SEP);
sb.append(getDescription());
sb.append(UNIT_SEP);
sb.append(getLatency(es));
sb.append(RECORD_SEP);
return sb.toString();
}
use of us.mn.state.dot.tms.EncoderStream in project iris by mnit-rtmc.
the class VideoRequest method getEncoding.
/**
* Get the encoding for a camera
*/
private Encoding getEncoding(Camera c) {
EncoderStream es = CameraHelper.getStream(c);
Encoding enc = getEncoding(es);
if (usingServletProxy() && (enc != Encoding.UNKNOWN))
return Encoding.MJPEG;
else
return enc;
}
use of us.mn.state.dot.tms.EncoderStream in project iris by mnit-rtmc.
the class FlowStreamImpl method getSinkPort.
/**
* Get the sink port
*/
public String getSinkPort() {
Integer p = getPort();
if (p != null)
return p.toString();
EncodingQuality eq = getEncodingQuality();
EncoderStream es = CameraHelper.getStream(camera, eq, true);
if (es != null) {
p = es.getMcastPort();
if (p != null)
return p.toString();
}
return "";
}
Aggregations