00001 # % macro, P, Device Prefix
00002 # % macro, R, Device Suffix
00003 # % macro, PORT, Asyn Port name
00004 # % macro, QUALITY, Jpeg Quality in percent
00005 # % macro, MAXW, Maximum Jpeg Width
00006 # % macro, MAXH, Maximum Jpeg Height
00007 # % gui, $(PORT), edmtab, ffmpegStream.edl, P=$(P),R=$(R)
00008
00009 # # \file
00010 # # ffmpegServer contains a very simple http server based on
00011 # # <a href="http://www.nulllogic.ca/httpd">nullhttpd</a>. If a file named
00012 # # \<port\>.jpg is requested for any ffmpegStream object named \<port\>, then it
00013 # # will return the last NDArray received by the object compressed to jpeg. If
00014 # # \<port\>.mjpg is requested then it will return an mjpg stream over http to the
00015 # # client. Otherwise, it will return an index page listing all the available
00016 # # streams.
00017 # # \section ffmpegStream_setup Setup
00018 # # - In the database, an instance of NDPluginBase is required, followed by an
00019 # # instance of this template.
00020 # # - In the startup scripts, call ffmpegServerConfigure() once per IOC to setup
00021 # # the http server, then call ffmpegStreamConfigure() once per ffmpegStream
00022 # # instance to setup the areadetector plugin
00023 # # - see \ref build_instructions
00024 # # \section ffmpegStream_screenshots Screenshots
00025 # # \image html server.png "Index page for ffmpegServer"
00026 # # \image html ffmpegStreamEdm.png "Edm screen for ffmpegStream"
00027
00028 # All tags starting with gdatag are DLS specific for GDA
00029 # % gdatag, template, ffmpegStream, $(PORT)_ffmpegStream, $(PORT) ffmpegStream class instance
00030
00031 # # JPEG Quality
00032 # % gdatag, pv, rw, $(PORT)_ffmpegStream, QUALITY, Set QUALITY
00033 record(ao, "$(P)$(R)QUALITY") {
00034 field(DTYP, "asynInt32")
00035 field(OUT, "@asyn($(PORT) 0)FFMPEG_QUALITY")
00036 field(VAL, "$(QUALITY=100)")
00037 field(DRVH, "100")
00038 field(DRVL, "0")
00039 field(PINI, "1")
00040 }
00041
00042 # # JPEG Quality Readback from driver
00043 # % gdatag, pv, ro, $(PORT)_ffmpegStream, QUALITY_RBV, Readback for QUALITY
00044 record(ai, "$(P)$(R)QUALITY_RBV") {
00045 field(SCAN, "I/O Intr")
00046 field(DTYP, "asynInt32")
00047 field(INP, "@asyn($(PORT) 0)FFMPEG_QUALITY")
00048 }
00049
00050 # # Maximum jpg width
00051 # % gdatag, pv, rw, $(PORT)_ffmpegStream, MAXW, Set MAXW
00052 record(ao, "$(P)$(R)MAXW") {
00053 field(DTYP, "asynInt32")
00054 field(OUT, "@asyn($(PORT) 0)FFMPEG_MAXW")
00055 field(VAL, "$(MAXW=1600)")
00056 field(PINI, "1")
00057 }
00058
00059 # # Maximum jpg width Readback from driver
00060 # % gdatag, pv, ro, $(PORT)_ffmpegStream, MAXW_RBV, Readback for MAXW
00061 record(ai, "$(P)$(R)MAXW_RBV") {
00062 field(SCAN, "I/O Intr")
00063 field(DTYP, "asynInt32")
00064 field(INP, "@asyn($(PORT) 0)FFMPEG_MAXW")
00065 }
00066
00067 # # Maximum jpg width
00068 # % gdatag, pv, rw, $(PORT)_ffmpegStream, MAXH, Set MAXH
00069 record(ao, "$(P)$(R)MAXH") {
00070 field(DTYP, "asynInt32")
00071 field(OUT, "@asyn($(PORT) 0)FFMPEG_MAXH")
00072 field(VAL, "$(MAXH=1200)")
00073 field(PINI, "1")
00074 }
00075
00076 # # Maximum jpg width Readback from driver
00077 # % gdatag, pv, ro, $(PORT)_ffmpegStream, MAXH_RBV, Readback for MAXH
00078 record(ai, "$(P)$(R)MAXH_RBV") {
00079 field(SCAN, "I/O Intr")
00080 field(DTYP, "asynInt32")
00081 field(INP, "@asyn($(PORT) 0)FFMPEG_MAXH")
00082 }
00083
00084
00085 # # Toggle False colour mode
00086 # % gdatag, binary, rw, $(PORT)_ffmpegStream, FALSE_COL, Set FALSE_COL
00087 record(bo, "$(P)$(R)FALSE_COL") {
00088 field(DTYP, "asynInt32")
00089 field(OUT, "@asyn($(PORT) 0)FFMPEG_FALSE_COL")
00090 field(ZNAM, "Off")
00091 field(ONAM, "On")
00092 field(VAL, "0")
00093 field(PINI, "1")
00094 }
00095
00096 # # False colour mode readback from driver
00097 # % gdatag, binary, ro, $(PORT)_ffmpegStream, FALSE_COL_RBV, Readback for FALSE_COL
00098 record(bi, "$(P)$(R)FALSE_COL_RBV") {
00099 field(SCAN, "I/O Intr")
00100 field(DTYP, "asynInt32")
00101 field(INP, "@asyn($(PORT) 0)FFMPEG_FALSE_COL")
00102 field(ZNAM, "Off")
00103 field(ONAM, "On")
00104 }
00105
00106 # # Always produce jpegs, even when no-one is listening
00107 # % gdatag, binary, rw, $(PORT)_ffmpegStream, ALWAYS_ON, Set ALWAYS_ON
00108 record(bo, "$(P)$(R)ALWAYS_ON") {
00109 field(DTYP, "asynInt32")
00110 field(OUT, "@asyn($(PORT) 0)FFMPEG_ALWAYS_ON")
00111 field(ZNAM, "Off")
00112 field(ONAM, "On")
00113 field(VAL, "0")
00114 field(PINI, "1")
00115 }
00116
00117 # # Always on readback from driver
00118 # % gdatag, binary, ro, $(PORT)_ffmpegStream, ALWAYS_ON_RBV, Readback for ALWAYS_ON
00119 record(bi, "$(P)$(R)ALWAYS_ON_RBV") {
00120 field(SCAN, "I/O Intr")
00121 field(DTYP, "asynInt32")
00122 field(INP, "@asyn($(PORT) 0)FFMPEG_ALWAYS_ON")
00123 field(ZNAM, "Off")
00124 field(ONAM, "On")
00125 }
00126
00127 # # HTTP Port to connect an mjpg viewer to
00128 # % gdatag, pv, ro, $(PORT)_ffmpegStream, HTTP_PORT_RBV, Readback for HTTP_PORT
00129 record(ai, "$(P)$(R)HTTP_PORT_RBV")
00130 {
00131 field(PINI, "1")
00132 field(DTYP, "asynInt32")
00133 field(INP, "@asyn($(PORT) 0)FFMPEG_HTTP_PORT")
00134 field(SCAN, "I/O Intr")
00135 }
00136
00137 # # Hostname of the HTTP server
00138 # % gdatag, pv, ro, $(PORT)_ffmpegStream, HOST_RBV, Readback for HOST
00139 record(stringin, "$(P)$(R)HOST_RBV")
00140 {
00141 field(PINI, "1")
00142 field(DTYP, "asynOctetRead")
00143 field(INP, "@asyn($(PORT) 0)FFMPEG_HOST")
00144 field(SCAN, "I/O Intr")
00145 }
00146
00147 # # Number of clients
00148 # % gdatag, pv, ro, $(PORT)_ffmpegStream, CLIENTS_RBV, Readback for CLIENTS
00149 record(ai, "$(P)$(R)CLIENTS_RBV")
00150 {
00151 field(PINI, "1")
00152 field(DTYP, "asynInt32")
00153 field(INP, "@asyn($(PORT) 0)FFMPEG_CLIENTS")
00154 field(SCAN, "I/O Intr")
00155 }
00156
00157 # # URL of the jpg snapshot
00158 # % gdatag, pv, ro, $(PORT)_ffmpegStream, JPG_URL_RBV, Readback for JPG URL
00159 record(waveform, "$(P)$(R)JPG_URL_RBV")
00160 {
00161 field(DTYP, "asynOctetRead")
00162 field(INP, "@asyn($(PORT) 0)FFMPEG_JPG_URL")
00163 field(FTVL, "UCHAR")
00164 field(NELM, "256")
00165 field(SCAN, "I/O Intr")
00166 }
00167
00168 # # URL of the mjpg stream
00169 # % gdatag, pv, ro, $(PORT)_ffmpegStream, MJPG_URL_RBV, Readback for MJPG URL
00170 record(waveform, "$(P)$(R)MJPG_URL_RBV")
00171 {
00172 field(DTYP, "asynOctetRead")
00173 field(INP, "@asyn($(PORT) 0)FFMPEG_MJPG_URL")
00174 field(FTVL, "UCHAR")
00175 field(NELM, "256")
00176 field(SCAN, "I/O Intr")
00177 }
00178
00179 #% autosave 2
00180 #% archiver 10 Monitor
00181 record(longout, "$(P)$(R)GX") {
00182 field(VAL, "100")
00183 field(PINI, "1")
00184 }
00185
00186 #% autosave 2
00187 #% archiver 10 Monitor
00188 record(longout, "$(P)$(R)GY") {
00189 field(VAL, "100")
00190 field(PINI, "1")
00191 }
00192
00193 #% autosave 2
00194 #% archiver 10 Monitor
00195 record(bo, "$(P)$(R)GRID") {
00196 field(VAL, "0")
00197 field(ZNAM, "Off")
00198 field(ONAM, "On")
00199 field(PINI, "1")
00200 }
00201
00202 #% autosave 2
00203 #% archiver 10 Monitor
00204 # default white
00205 record(longout, "$(P)$(R)GCOL") {
00206 field(VAL, "0xFFFFFF")
00207 field(PINI, "1")
00208 }
00209
00210 #% autosave 2
00211 #% archiver 10 Monitor
00212 record(longout, "$(P)$(R)GS") {
00213 field(VAL, "200")
00214 field(DRVL, "10")
00215 field(DRVH, "2000")
00216 field(PINI, "1")
00217 }