[Live-devel] seg fault in framed source

Mat Laibowitz mlaibow.davinci at gmail.com
Sat Jan 3 02:16:27 PST 2009


I am trying to add optional unicast support to my stream server which
currently runs great using multicast. I have implemented a custom
DeviceFrameSource class extending FramedSource to control my MPEG4 encoder
hardware. This is working great using multicast.
To get it to run using unicast I based the code on wis-streamer and created
a custom MediaSubSession class extending OnDemandServerMediaSubsession.

When a client connects it gets fairly far, parses the DESCRIBE, creates the
stream source and rtpsink, connects to the encoder and gets two frames to
create SDP, sends back the SDP,  gets a SETUP command and creates the stream
source again and the RTPSink/MPEG4ESVideoRTPSink, sends the response to
SETUP, and finally receives the play command.
The debug trace is below.
But when trying to get the first frame after receiving the PLAY command, it
always seg faults. Some debug trace shows that it executes the GetNextFrame
in FramedSource which calls doGetNextFrame on MPEG4DiscreteFramer, which
calls getNextFrame on FramedSource again, where is fails.

It basically does the same thing it does when getting the frames for the SDP
call, but this time it fails.
I thought it might be a problem with how I am passing the pointer to
DeviceFrameSource class or something wrong with that class altogether, but
it works while getting the SDP frames and when using multicast.

The specific point of seg fault is at the call of doGetNextFrame() from
within FramedSource::getNextFrame called from
MPEG4VideoStreanDiscreteFramer::doGetNextFrame.

Any insight would be greatly appreciated.
Thanks,
-mat

Play this stream using the URL "rtsp://18.85.45.113:8554/videoStream"
Created On Demand Server...
accept()ed connection from 18.85.45.34
RTSPClientSession[0xd2720]::incomingRequestHandler1() read 134 bytes:OPTIONS
rtsp://18.85.45.113:8554/videoStream RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)


parseRTSPRequestString() returned cmdName "OPTIONS", urlPreSuffix "",
urlSuffix "videoStream"
sending response: RTSP/1.0 200 OK
CSeq: 1
Date: Thu, Jan 01 1970 21:40:38 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE

RTSPClientSession[0xd2720]::incomingRequestHandler1() read 160
bytes:DESCRIBE rtsp://18.85.45.113:8554/videoStream RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)


parseRTSPRequestString() returned cmdName "DESCRIBE", urlPreSuffix "",
urlSuffix "videoStream"
Creating New Stream Source...
Creating New RTP Sink Buffer Set...
Creating New MPEG4ESVideoRTPSInk
Created RTPSink...
Get AUX SDP Line...
MultiFramerRTPSink buildandsendpacket
MultiFramerRTPSink packframe
MultiFramerRTPSink getNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
MPEG4DiscreteFramer doGetNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
Spinner Video Debug: About to call requestframe...
DEVICE Request Frame
Spinner Video Debug: Got Frame at buffer 9
FramedSource donegetnextframe
FramedSource donegetnextframe
Checking for AUX SDP Line...
Spinner Video Debug: About to capture frame..
MultiFramerRTPSink buildandsendpacket
MultiFramerRTPSink packframe
MultiFramerRTPSink buildandsendpacket
MultiFramerRTPSink packframe
MultiFramerRTPSink buildandsendpacket
MultiFramerRTPSink packframe
MultiFramerRTPSink getNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
MPEG4DiscreteFramer doGetNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
Spinner Video Debug: About to call requestframe...
DEVICE Request Frame
Spinner Video Debug: Got Frame at buffer 9
FramedSource donegetnextframe
FramedSource donegetnextframe
Checking for AUX SDP Line...
Got AUX SDP Line...
a=fmtp:96
profile-level-id=5;config=000001B005000001B509000001000000012000845D4C28B42190A31F
sending response: RTSP/1.0 200 OK
CSeq: 2
Date: Thu, Jan 01 1970 21:40:38 GMT
Content-Base: rtsp://18.85.45.113:8554/videoStream/
Content-Type: application/sdp
Content-Length: 491

v=0
o=- 78015985469 1 IN IP4 18.85.45.113
s=Session streamed by "spinner_video_server"
i=spinner_video_session
t=0 0
a=tool:LIVE555 Streaming Media v2008.12.19
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "spinner_video_server"
a=x-qt-text-inf:spinner_video_session
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96
profile-level-id=5;config=000001B005000001B509000001000000012000845D4C28B42190A31F
a=control:track1
RTSPClientSession[0xd2720]::incomingRequestHandler1() read 191 bytes:SETUP
rtsp://18.85.45.113:8554/videoStream/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=45844-45845
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)


parseRTSPRequestString() returned cmdName "SETUP", urlPreSuffix
"videoStream", urlSuffix "track1"
Handling Command Setup
Creating New Stream Source...
Creating New RTP Sink Buffer Set...
Creating New MPEG4ESVideoRTPSInk
Created RTPSink...
sending response: RTSP/1.0 200 OK
CSeq: 3
Date: Thu, Jan 01 1970 21:40:38 GMT
Transport:
RTP/AVP;unicast;destination=18.85.45.34;source=18.85.45.113;client_port=45844-45845;server_port=6970-6971
Session: 1

RTSPClientSession[0xd2720]::incomingRequestHandler1() read 163 bytes:PLAY
rtsp://18.85.45.113:8554/videoStream/ RTSP/1.0
CSeq: 4
Session: 1
Range: npt=0.000-
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)


parseRTSPRequestString() returned cmdName "PLAY", urlPreSuffix
"videoStream", urlSuffix ""
Handling command within
Handle command play
Doing required seeking
Start Streaming
Start Stream 0
startStream
startPlaying
MultiFramerRTPSink buildandsendpacket
MultiFramerRTPSink packframe
MultiFramerRTPSink getNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
MPEG4DiscreteFramer doGetNextFrame
FramedSource getnextframe
FramedSource doinggetnextframe
Segmentation fault


Trace from VLC:
[00000421] live555 demux error: RTSP PLAY failed Failed to read response:
Success
[00000424] main access error: connection failed: Connection refused
[00000424] access_realrtsp access error: cannot connect to 18.85.45.113:8554
[00000420] main input error: open of `rtsp://18.85.45.113:8554/videoStream'
failed: could not create access
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090103/c7aa1ac4/attachment-0001.html>


More information about the live-devel mailing list