|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectohmm.CvBase.ImageServer
protected class CvBase.ImageServer
HTTP multipart/x-mixed-replace image server.
The image encoding is controlled by CvBase.serverFormat
and CvBase.serverMimeType
, reasonable options include jpeg and gif. The former
constitutes MJPEG encoding, and gives good quality with low bandwidth, but
may not be compatible with all browsers. In particular, current versions
of Firefox show severe flickering with MJPEG encoding (Mozilla bug
625012). Chrome seems to work pretty well, though there are issues with
non-alphanumeric keycodes. gif encoding doesn't look great due to color
quantizing.
Images are served to at most one client at a time at maximum
framerate CvBase.maxServerFPS
.
Normally these variables are configured prior to starting the server,
but it should be possible to change them online, protected by CvBase.serverLock
.
The server starts automatically and listens on CvBase.serverPort
iff
CvBase.useServer
is true.
The server knows about the following request paths:
Thus, once the server is running, you can connect to it from a remote host by bringing up e.g. Google Chrome and browsing to the url
http://ADDR:PORT/server.htmlwhere ADDR is the IP address and PORT the listening port of the server.
Field Summary | |
---|---|
protected java.util.concurrent.ExecutorService |
executor
The transaction executor. |
protected com.sun.net.httpserver.HttpServer |
server
The internal server object. |
Constructor Summary | |
---|---|
protected |
CvBase.ImageServer(int port)
Binds server to indicated port. |
Method Summary | |
---|---|
protected void |
stop(int delay)
Stops server and executor . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.sun.net.httpserver.HttpServer server
protected java.util.concurrent.ExecutorService executor
Constructor Detail |
---|
protected CvBase.ImageServer(int port)
Method Detail |
---|
protected void stop(int delay)
server
and executor
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |