# This file was automatically generated on Fri 14 Jun 2013 14:13:01 BST from
# source: /dls_sw/prod/R3.14.11/support/ffmpegServer/1-16-3/etc/makeIocs/example.xml
# 
# *** Please do not edit this file: edit the source file instead. ***
# 
/**
\page build_instructions_example Build Instructions for example
Build Instructions for example
<ol>
<li> Add the dependencies to configure/RELEASE.
\verbatim
ASYN=/dls_sw/prod/R3.14.11/support/asyn/4-21
BUSY=/dls_sw/prod/R3.14.11/support/busy/1-4dls1
AREADETECTOR=/dls_sw/prod/R3.14.11/support/areaDetector/1-9dls4
FFMPEGSERVER=/dls_sw/prod/R3.14.11/support/ffmpegServer/1-16-3
\endverbatim

<li> Add the DBD dependencies to src/Makefile
\verbatim
example_DBD += base.dbd
example_DBD += asyn.dbd
example_DBD += busySupport.dbd
example_DBD += ADSupport.dbd
example_DBD += NDPluginSupport.dbd
example_DBD += simDetectorSupport.dbd
example_DBD += ffmpegServer.dbd
\endverbatim

<li> Add the LIBS dependencies to src/Makefile
\verbatim
example_LIBS += ffmpegServer
example_LIBS += simDetector
example_LIBS += NDPlugin
example_LIBS += ADBase
example_LIBS += netCDF
example_LIBS += cbfad
example_LIBS += NeXus
example_LIBS += hdf5
example_LIBS += sz
example_LIBS += PvAPI
example_LIBS += GraphicsMagick++
example_LIBS += GraphicsMagickWand
example_LIBS += GraphicsMagick
example_LIBS += busy
example_LIBS += asyn
example_SYS_LIBS += avdevice
example_SYS_LIBS += avformat
example_SYS_LIBS += avcodec
example_SYS_LIBS += avutil
example_SYS_LIBS += swscale
example_SYS_LIBS += tiff
example_SYS_LIBS += jpeg
example_SYS_LIBS += z
example_SYS_LIBS += gomp
example_SYS_LIBS += X11
example_SYS_LIBS += xml2
example_SYS_LIBS += png12
example_SYS_LIBS += bz2
example_SYS_LIBS += Xext
example_SYS_LIBS += freetype
\endverbatim

<li> Use the template files to add records to the database.
\verbatim

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/ADBase.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":CAM:", "CAM1.CAM", "1", "0" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/simDetector.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":CAM:", "CAM1.CAM", "1", "0" }
}

# Macros:
#  P             Device Prefix
#  R             Device Suffix
#  PORT          Asyn Port name
#  TIMEOUT       Timeout
#  ADDR          Asyn Port address
#  NDARRAY_PORT  Input Array Port
#  NDARRAY_ADDR  Input Array Address
#  Enabled       Plugin Enabled at startup?
file $(AREADETECTOR)/db/NDPluginBase.template
{
pattern { P, R, PORT, TIMEOUT, ADDR, NDARRAY_PORT, NDARRAY_ADDR, Enabled }
    { "BLxxI-DI-PHDGN-01", ":ROI:", "CAM1.ROI", "1", "0", "CAM1.CAM", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":PROC:", "CAM1.PROC", "1", "0", "CAM1.ROI", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":STAT:", "CAM1.STAT", "1", "0", "CAM1.PROC", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":ARR:", "CAM1.ARR", "1", "0", "CAM1.PROC", "0", "0" }
    { "BLxxI-DI-PHDGN-01", ":HDF5:", "CAM1.HDF5", "1", "0", "CAM1.STAT", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":FIMG:", "CAM1.FIMG", "1", "0", "CAM1.STAT", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:", "CAM1.OVER", "1", "0", "CAM1.PROC", "0", "1" }
    { "BLxxI-DI-PHDGN-01", ":MJPG:", "CAM1.MJPG", "1", "0", "CAM1.OVER", "0", "1" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/NDROI.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":ROI:", "CAM1.ROI", "1", "0" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/NDProcess.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":PROC:", "CAM1.PROC", "1", "0" }
}

# Macros:
#  P          Device Prefix
#  R          Device Suffix
#  PORT       Asyn Port name
#  TIMEOUT    Timeout
#  ADDR       Asyn Port address
#  XSIZE      Maximum size of X histograms (e.g. 1024)
#  YSIZE      Maximum size of Y histograms (e.g. 768)
#  HIST_SIZE  Maximum size of Pixel binning histogram (e.g. 256 for Int8)
#  NCHAN      Number of elements in the waveforms which accumulate past statistics
file $(AREADETECTOR)/db/NDStats.template
{
pattern { P, R, PORT, TIMEOUT, ADDR, XSIZE, YSIZE, HIST_SIZE, NCHAN }
    { "BLxxI-DI-PHDGN-01", ":STAT:", "CAM1.STAT", "1", "0", "1024", "768", "256", "1000" }
}

# Macros:
#  P          Device Prefix
#  R          Device Suffix
#  PORT       Asyn Port name
#  TIMEOUT    Timeout
#  ADDR       Asyn Port address
#  TYPE       Asyn Type e.g. Int32
#  FTVL       Format, e.g. Int
#  NELEMENTS  Number of elements
file $(AREADETECTOR)/db/NDStdArrays.template
{
pattern { P, R, PORT, TIMEOUT, ADDR, TYPE, FTVL, NELEMENTS }
    { "BLxxI-DI-PHDGN-01", ":ARR:", "CAM1.ARR", "1", "0", "Int8", "UCHAR", "786432" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/NDFile.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":HDF5:", "CAM1.HDF5", "1", "0" }
    { "BLxxI-DI-PHDGN-01", ":FIMG:", "CAM1.FIMG", "1", "0" }
}

# Macros:
#  P     Device Prefix
#  R     Device Suffix
#  PORT  Asyn Port name
file $(AREADETECTOR)/db/NDFileHDF5.template
{
pattern { P, R, PORT }
    { "BLxxI-DI-PHDGN-01", ":HDF5:", "CAM1.HDF5" }
}

# Macros:
#  P     Device Prefix
#  R     Device Suffix
#  PORT  Asyn Port name
file $(FFMPEGSERVER)/db/ffmpegFile.template
{
pattern { P, R, PORT }
    { "BLxxI-DI-PHDGN-01", ":FIMG:", "CAM1.FIMG" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
file $(AREADETECTOR)/db/NDOverlay.template
{
pattern { P, R, PORT, TIMEOUT, ADDR }
    { "BLxxI-DI-PHDGN-01", ":OVER:", "CAM1.OVER", "1", "0" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  O        NDOverlay Device Suffix
#  PORT     Asyn Port name
#  TIMEOUT  Timeout
#  ADDR     Asyn Port address
#  NAME     Name for the overlay
#  XPOS     Link for the XPos of the overlay
#  YPOS     Link for the YPos of the overlay
#  XSIZE    Link for the XSize of the overlay
#  YSIZE    Link for the YSize of the overlay
#  SHAPE    Shape of the overlay
file $(AREADETECTOR)/db/NDOverlayN.template
{
pattern { P, R, O, PORT, TIMEOUT, ADDR, NAME, XPOS, YPOS, XSIZE, YSIZE, SHAPE }
    { "BLxxI-DI-PHDGN-01", ":OVER:1:", ":OVER:", "CAM1.OVER", "1", "0", "Overlay 1", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:2:", ":OVER:", "CAM1.OVER", "1", "1", "Overlay 2", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:3:", ":OVER:", "CAM1.OVER", "1", "2", "Overlay 3", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:4:", ":OVER:", "CAM1.OVER", "1", "3", "Overlay 4", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:5:", ":OVER:", "CAM1.OVER", "1", "4", "Overlay 5", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:6:", ":OVER:", "CAM1.OVER", "1", "5", "Overlay 6", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:7:", ":OVER:", "CAM1.OVER", "1", "6", "Overlay 7", "", "", "", "", "1" }
    { "BLxxI-DI-PHDGN-01", ":OVER:8:", ":OVER:", "CAM1.OVER", "1", "7", "Overlay 8", "", "", "", "", "1" }
}

# Macros:
#  P        Device Prefix
#  R        Device Suffix
#  PORT     Asyn Port name
#  QUALITY  Jpeg Quality in percent
#  MAXW     Maximum Jpeg Width
#  MAXH     Maximum Jpeg Height
file $(FFMPEGSERVER)/db/ffmpegStream.template
{
pattern { P, R, PORT, QUALITY, MAXW, MAXH }
    { "BLxxI-DI-PHDGN-01", ":MJPG:", "CAM1.MJPG", "100", "1600", "1200" }
}
\endverbatim

<li> Add the startup commands to st.cmd
\verbatim

# Loading libraries
# -----------------

# Device initialisation
# ---------------------

cd "$(TOP)"

dbLoadDatabase "dbd/example.dbd"
example_registerRecordDeviceDriver(pdbbase)

# simDetectorConfig(portName, maxSizeX, maxSizeY, dataType, maxBuffers, maxMemory)
simDetectorConfig("CAM1.CAM", 1600, 1200, 1, 50, 0)

# NDROIConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, maxBuffers, maxMemory)
NDROIConfigure("CAM1.ROI", 16, 0, "CAM1.CAM", 0, 50, 0)

# NDProcessConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, maxBuffers, maxMemory)
NDProcessConfigure("CAM1.PROC", 16, 0, "CAM1.ROI", 0, 50, 0)

# NDStatsConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, maxBuffers, maxMemory)
NDStatsConfigure("CAM1.STAT", 16, 0, "CAM1.PROC", 0, 50, 0)

# NDStdArraysConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, maxMemory)
NDStdArraysConfigure("CAM1.ARR", 2, 0, "CAM1.PROC", 0, 0)

# NDFileHDF5Configure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr)
NDFileHDF5Configure("CAM1.HDF5", 16, 0, "CAM1.STAT", 0)

# ffmpegFileConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr)
ffmpegFileConfigure("CAM1.FIMG", 16, 0, "CAM1.STAT", 0)

# NDOverlayConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, NOverlays, maxBuffers, maxMemory)
NDOverlayConfigure("CAM1.OVER", 16, 0, "CAM1.PROC", 0, 8, 50, 0)

ffmpegServerConfigure(8080)
# ffmpegStreamConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, maxMemory)
ffmpegStreamConfigure("CAM1.MJPG", 2, 0, "CAM1.OVER", "0", -1)

dbpf BLxxI-DI-PHDGN-01:STAT:NDAttributesFile, exampleApp/data/CAM1.STAT.xml


















\endverbatim
</ol>
**/
