? 1.txt Index: src/POSIX/jvprotocol.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-ui/jvideo/src/POSIX/jvprotocol.i3,v retrieving revision 1.2 diff -u -r1.2 jvprotocol.i3 --- src/POSIX/jvprotocol.i3 17 Mar 2008 03:45:44 -0000 1.2 +++ src/POSIX/jvprotocol.i3 14 Apr 2010 10:09:26 -0000 @@ -6,7 +6,6 @@ (* modified on Thu Aug 19 10:29:32 PDT 1993 by sfreeman *) INTERFACE jvprotocol; -IMPORT Utime; FROM Ctypes IMPORT int, unsigned_int, unsigned_short_int; (* The ports were once upon a time htons'ed. INET ports are in local @@ -93,11 +92,19 @@ MaxControlMsgSize = 128 DIV BYTESIZE(CHAR); TYPE ControlBuffer = ARRAY [0 .. MaxControlMsgSize - 1] OF CHAR; +(* This does not appear to really be used for anything. + * Formerly from Utime. + *) +TYPE struct_timeval = RECORD + tv_sec: unsigned_int; (* Really should be LONGINT for year 2038. *) + tv_usec: unsigned_int; (* Really should be LONGINT for alignment. *) + END; + TYPE VideoFrame = RECORD type : int := JVP_VIDEO; length : int; - timestamp: Utime.struct_timeval; + timestamp: struct_timeval; (* data goes here for 'length' bytes *) END; VideoFramePtr = UNTRACED REF VideoFrame; @@ -128,7 +135,7 @@ seqNum: unsigned_int; (* not consecutive; cumulative count of samples *) length : int; - timestamp: Utime.struct_timeval; + timestamp: struct_timeval; (* data goes here for 'length' bytes *) END; AudioFramePtr = UNTRACED REF AudioFrame; @@ -161,7 +168,7 @@ TYPE EndMark = RECORD type : int := JVP_ENDMARK; - timestamp: Utime.struct_timeval; + timestamp: struct_timeval; END; EndMarkPtr = UNTRACED REF EndMark; @@ -178,7 +185,7 @@ type : int := JVP_INFO; length: int; (* of data following *) code : int; (* whatever *) - timestamp: Utime.struct_timeval; + timestamp: struct_timeval; (* Additional data here *) END; InfoFramePtr = UNTRACED REF InfoFrame; @@ -190,7 +197,7 @@ seqNum: unsigned_int; (* not consecutive; cumulative count of samples *) length: int; (* number of silent samples *) - timestamp: Utime.struct_timeval; + timestamp: struct_timeval; END; AudioSilenceFramePtr = UNTRACED REF AudioSilenceFrame; @@ -215,7 +222,7 @@ VideoUdpData = RECORD type : int := JVP_VIDEO_UDP_DATA; jvpu_length: int; (* total data *) - jvpu_timestamp: ARRAY [0 .. 1] OF Utime.struct_timeval; + jvpu_timestamp: ARRAY [0 .. 1] OF struct_timeval; (* lance wanted two *) jvpu_sequence: int; (* for reassembly *) END; Index: src/POSIX/decunix/JVSink.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-ui/jvideo/src/POSIX/decunix/JVSink.m3,v retrieving revision 1.2 diff -u -r1.2 JVSink.m3 --- src/POSIX/decunix/JVSink.m3 14 Apr 2003 20:18:48 -0000 1.2 +++ src/POSIX/decunix/JVSink.m3 14 Apr 2010 10:09:26 -0000 @@ -15,9 +15,6 @@ (**IMPORT Stdio;**) -FROM Ctypes IMPORT int; -FROM Utypes IMPORT u_int; - CONST RetrySeconds = 30.0d0; REVEAL @@ -52,16 +49,6 @@ (* {{{ -- methods -- *) -PROCEDURE signed_ntohl(x: int): int = - BEGIN - RETURN LOOPHOLE(Uin.ntohl(LOOPHOLE(x, u_int)), int) - END signed_ntohl; - -PROCEDURE signed_htonl(x: int): int = - BEGIN - RETURN LOOPHOLE(Uin.htonl(LOOPHOLE(x, u_int)), int) - END signed_htonl; - PROCEDURE Init (t : T; hostname : TEXT; quality : Quality := DefaultQuality; @@ -214,7 +201,7 @@ (* control data from the server currently is thrown away *) PROCEDURE GetControl (netlength: Ctypes.int) RAISES {Rd.Failure, Thread.Alerted} = - VAR length := signed_ntohl(netlength); + VAR length := Uin.ntohl(netlength); BEGIN IF length > jvprotocol.MaxControlMsgSize THEN RAISE Rd.Failure(NIL); @@ -253,7 +240,7 @@ LOCK t DO GetHeader(t, t.tcp, buffer); END; IF any.type = jvprotocol.JVP_VIDEO THEN - VAR subtype := JvsBuffer.Subtype2(signed_ntohl(hdr.length)); + VAR subtype := JvsBuffer.Subtype2(Uin.ntohl(hdr.length)); BEGIN IF jvbuff # NIL AND jvbuff.subtype # subtype THEN jvbuff.free(); @@ -308,25 +295,25 @@ WITH type = LOOPHOLE(any, jvprotocol.VideoTypePtr), si = t.info DO INC(si.serial); - si.qfactor := signed_ntohl(type.qfactor); - si.width := signed_ntohl(type.width); - si.height := signed_ntohl(type.height); + si.qfactor := Uin.ntohl(type.qfactor); + si.width := Uin.ntohl(type.width); + si.height := Uin.ntohl(type.height); END; | jvprotocol.JVP_SYNC => WITH sync = LOOPHOLE(any, jvprotocol.SyncFramePtr) DO (* if this is the reply we're waiting for, send credits to restart stream *) - IF t.sync = signed_ntohl(sync.code) THEN t.sync := 0; END; + IF t.sync = Uin.ntohl(sync.code) THEN t.sync := 0; END; END; | jvprotocol.JVP_QUALITIES => length := LOOPHOLE(any, jvprotocol.QualitiesFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_ERROR => length := LOOPHOLE(any, jvprotocol.ErrorFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_INFO => length := LOOPHOLE(any, jvprotocol.InfoFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_VIDEO_UDP_REQUEST, jvprotocol.JVP_VIDEO_UDP_RESPONSE => | jvprotocol.JVP_AUDIO, jvprotocol.JVP_STATUS, @@ -396,7 +383,7 @@ bytesLeft: CARDINAL; BEGIN GetMinBytes(o, t, SUBARRAY(buffer, 0, AnySize)); - any.type := signed_ntohl(any.type); + any.type := Uin.ntohl(any.type); CASE any.type OF | jvprotocol.JVP_FirstEvent .. jvprotocol.JVP_LastEvent => bytesLeft := jvprotocol.HdrSizes[any.type] - AnySize; @@ -437,9 +424,9 @@ <* ASSERT jvb # NIL *> jvb.serial := t.readSerial; INC(t.readSerial); - jvb.timestamp.tv_sec := signed_ntohl(hdr.timestamp.tv_sec); - jvb.timestamp.tv_usec := signed_ntohl(hdr.timestamp.tv_usec); - jvb.frameLength := signed_ntohl(hdr.length); + jvb.timestamp.tv_sec := Uin.ntohl(hdr.timestamp.tv_sec); + jvb.timestamp.tv_usec := Uin.ntohl(hdr.timestamp.tv_usec); + jvb.frameLength := Uin.ntohl(hdr.length); jvb.localTime := Tick.Now(); <* ASSERT jvb.frameLength <= jvb.length *> @@ -596,8 +583,8 @@ nmsg := msg; data := LOOPHOLE(ADR(nmsg), UNTRACED REF ARRAY [0 .. 7] OF CHAR); BEGIN - nmsg.type := signed_htonl(nmsg.type); - nmsg.period := signed_htonl(nmsg.period); + nmsg.type := Uin.htonl(nmsg.type); + nmsg.period := Uin.htonl(nmsg.period); t.put(data^); END SendFrameRateToSource; Index: src/POSIX/generic/JVSink.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-ui/jvideo/src/POSIX/generic/JVSink.m3,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 JVSink.m3 --- src/POSIX/generic/JVSink.m3 13 Jan 2001 15:01:29 -0000 1.1.1.1 +++ src/POSIX/generic/JVSink.m3 14 Apr 2010 10:09:26 -0000 @@ -14,9 +14,6 @@ (**IMPORT Stdio;**) -FROM Ctypes IMPORT int; -FROM Utypes IMPORT u_int; - CONST RetrySeconds = 30.0d0; REVEAL @@ -49,11 +46,6 @@ (* {{{ -- methods -- *) -PROCEDURE signed_ntohl(x: int): int = - BEGIN - RETURN LOOPHOLE(Uin.ntohl(LOOPHOLE(x, u_int)), int) - END signed_ntohl; - PROCEDURE Init (t : T; hostname : TEXT; quality : Quality := DefaultQuality; @@ -175,7 +167,7 @@ (* control data from the server currently is thrown away *) PROCEDURE GetControl (netlength: Ctypes.int) RAISES {Rd.Failure, Thread.Alerted} = - VAR length := signed_ntohl(netlength); + VAR length := Uin.ntohl(netlength); BEGIN IF length > jvprotocol.MaxControlMsgSize THEN RAISE Rd.Failure(NIL); @@ -240,25 +232,25 @@ WITH type = LOOPHOLE(any, jvprotocol.VideoTypePtr), si = t.info DO INC(si.serial); - si.qfactor := signed_ntohl(type.qfactor); - si.width := signed_ntohl(type.width); - si.height := signed_ntohl(type.height); + si.qfactor := Uin.ntohl(type.qfactor); + si.width := Uin.ntohl(type.width); + si.height := Uin.ntohl(type.height); END; | jvprotocol.JVP_SYNC => WITH sync = LOOPHOLE(any, jvprotocol.SyncFramePtr) DO (* if this is the reply we're waiting for, send credits to restart stream *) - IF t.sync = signed_ntohl(sync.code) THEN t.sync := 0; END; + IF t.sync = Uin.ntohl(sync.code) THEN t.sync := 0; END; END; | jvprotocol.JVP_QUALITIES => length := LOOPHOLE(any, jvprotocol.QualitiesFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_ERROR => length := LOOPHOLE(any, jvprotocol.ErrorFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_INFO => length := LOOPHOLE(any, jvprotocol.InfoFramePtr).length; - GetControl(signed_ntohl(length)); + GetControl(Uin.ntohl(length)); | jvprotocol.JVP_VIDEO_UDP_REQUEST, jvprotocol.JVP_VIDEO_UDP_RESPONSE => | jvprotocol.JVP_AUDIO, jvprotocol.JVP_STATUS, @@ -324,7 +316,7 @@ bytesLeft: CARDINAL; BEGIN GetMinBytes(t, SUBARRAY(buffer, 0, AnySize)); - any.type := signed_ntohl(any.type); + any.type := Uin.ntohl(any.type); CASE any.type OF | jvprotocol.JVP_FirstEvent .. jvprotocol.JVP_LastEvent => bytesLeft := jvprotocol.HdrSizes[any.type] - AnySize; @@ -365,9 +357,9 @@ <* ASSERT jvb # NIL *> jvb.serial := t.readSerial; INC(t.readSerial); - jvb.timestamp.tv_sec := signed_ntohl(hdr.timestamp.tv_sec); - jvb.timestamp.tv_usec := signed_ntohl(hdr.timestamp.tv_usec); - jvb.frameLength := signed_ntohl(hdr.length); + jvb.timestamp.tv_sec := Uin.ntohl(hdr.timestamp.tv_sec); + jvb.timestamp.tv_usec := Uin.ntohl(hdr.timestamp.tv_usec); + jvb.frameLength := Uin.ntohl(hdr.length); jvb.localTime := Tick.Now(); <* ASSERT jvb.frameLength <= jvb.length *>