Difference between revisions of "SOURCEDG"
From ICE Enterprises
ConvertBot (talk | contribs) (Datagram reader for streaming RTP/RAW/SDP (UDP) into pipes.) |
(No difference)
|
Latest revision as of 18:04, 27 April 2020
Datagram reader for streaming RTP/RAW/SDP (UDP) into pipes.
<OUT> - Pipe for raw output
<CONVOUT> - Pipe for linear output
Optional Keyword only parameters:
[HOSTPORT] - "host:port", listen on this stream [DEF="127.0.0.1:18800"]
if /sap then [DEF="224.2.127.254:9875"]
Datagram reader for streaming RTP/RAW/SDP into NeXtMidas pipes.
NOTE: Requires JDK1.40+
Messages:
Received:
CLOSENET - Set state OFF
EXITNET - Set state OFF and EXIT (close) primitive
OPENNET - Set state OFF, open stream on "host:port" specified in data,
and set state ON.
Sent: NONE
Real-Time Controls:
See the JavaDocs API for various sets and gets for this primitive.
Examples:
1. Get RTP packets, specify transfer length by result, get raw and linear
output.
nM> sourcedg/id=multl/intl=^audiotl_g _mul _mll
nM> set reg.multl.host "^threads.^{curThread_sa}.multicase" ! set host
nM> set reg.multl.port "^threads.^{curThread_sa}.mport" ! set port
nM> set reg.multl.dgstate "ON" ! Turn on the flow of packets
nM> set reg.multl.dgstate "OFF" ! Turn OFF the flow of packets
2. Get SAP packets into a raw pipe, with info on each packet received with a
2000 ms timeout.
nM> sourcedg/verbose/packets/nortp/sap/timeout=2000/id=sapout _mul
3. Get raw UDP packets with info on each packet received with a 2000 ms
timeout.
nM> sourcedg/verbose/packets/nortp/timeout=2000 _mul _junk "^hostport_g"
4. Get multicast RTP stream with payload type 0 (PCMU) for u-law encoded audio
on 224.1.1.1/18800 to NeXtMidas pipes (raw 8-bit u-law and decoded 16-bit
linear PCM), plot decoded audio pipe as a line plot, and play it on sound
card using sinkaudio (AUDIO option tree should be in path). This assumes
that the audio data sample rate (sr) is 8000 Hz (so xdelta is 1/sr).
...
set sr 8000
set xd 1/sr
pipe on
sourcedg/ulaw/on/xdelta=xd _raw _linearpcm{size=1k} "224.1.1.2:18800"
plot/all _linearpcm type=line
sinkaudio _linearpcm
...
pipe off
...
5. Get multicast RTP stream with payload type 10 (L16) for 16-bit signed audio
sampled at 44100 Hz on 224.1.1.1/18800 to NeXtMidas pipe, plot raw linear
audio data (_rawout) as a line plot (showing 1K of data at a time), FFT the
linear audio data, and plot a PSD of the transformed data (_fftaudio).
...
set xd 1/44100
pipe on
sourcedg/on/xdelta=xd _rawout{form="SI"} ,, "224.1.1.1:18800"
plot/id=lineplot _rawout{FrameSize=1k} type=line
fft/psd/log _rawout _fftaudio nfft=1k navg=1 over=0
plot/id=psdplot _fftaudio
...
pipe off
...
Switches:
/ALLHOSTS - Turns multicast off and gets data on a port from all hosts,
the socketconstructor is "new DatagramSocket(port)"
/FILL - Fill in missing packets? [DEF=NO]
/FRAMESIZE - Data frame size, /FTYPE=2000 only
/FTYPE - Output file type [1000,2000,...] [DEF=1000]
/ICEHDRINPIPE - Is there an ICE header in the pipe? [DEF=NO]
/INITIALTIME - Set output ystart, -1=based on input [DEF=-1]
/INTL - Set transfer length for pipes
/LOG=<file> - Logs start and stop only to <file>
/MIDASSI - Sets the output data type to SI
/MSGID= - Registry name of command to handle messages [DEF=null]
Requires /MSGONLY.
/MSGNAME= - The name for XML message (only with /MSGID switch)
[DEF=XMLMSGS]
/MSGONLY= - Send messages only, not pipes to value of /MSGID [DEF=null]
/NORMAL3000 - Scott - TBD
/NORTP - No RTP protocol on packets [DEF=RTP]
/NOXSXD - Used with /TIMECODE to disable updates to XS and XD. (Since
NeXtMidas 2.1.1)
/OFFSET= - Data offset for each read [DEF=0]
/ON - Turns on listener at startup
/PACKETS - Debug - show all packets received if present
/RTPFILTER= - Used to get only specific RTP packets in a multiplexed stream
[DEF=-1 (disabled)]
/SAP - Use SAP protocol to decode packets [DEF=OFF]
/STRUCT=table - Sets the structure of the type 3000 file
/TIMEOUT=<ms> - Sets socket timeout value in milliseconds.
Wait time to receive packet [DEF=50]
/TIMECODE - Indicates that a the output pipe will receive TimeCode data
via a call-back from DatagramData. This will set the X units
to frequency and Y units to time if /NOXSXD is NOT set.
(Since NeXtMidas 1.9.3)
/ULAW - Treat the input data as U-Law, FALSE for LINEAR [DEF=FALSE]
If TRUE and CONVOUT= pipe is specified, then decode the 8-bit
U-law data stream to a PCM 16-bit signed integer (SI format)
onto the CONVOUT= pipe.
/VERBOSE - Turn on some information output
/XSTART - Set xstart on pipe
/XDELTA - Set xdelta on pipe
/XUNITS - Set xunit on pipe
See Also: sinkdg, nxm.sys.net.DatagramData