Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

hi all,
i studied some relative posts but dint help me thats y im posting it,please help..

im building helix to brew, in order i have succeded in playing http streaming.
now im building rtsp client.

the problem im facing here is, im able to write and read successfully for the first time, but after second successful write i get zero and server shuts down the connection(0 byte suggests peer shut down).
isocket_read returns 0 for the second time..

the url which im trying to hit for my music file
rtsp://192.168.1.21/house.rm

request is proper,because it works for other builds the same(windows and etc..)

i think have used socket properly wherein it works fine for http, but here in rtsp dosent, im :confused:

please help..

As i understand http and rtsp are two different protocols and require different handling.
http is quite straight forward but same cannot be said about rtsp. RTSP uses other control protocols like RTCP etc which control the link.
You mentioned ' request is proper,because it works for other builds the same(windows and etc..) ' Can you elaborate on this ? Is it the same way it works on other platforms ?

As i understand http and rtsp are two different protocols and require different handling.
http is quite straight forward but same cannot be said about rtsp. RTSP uses other control protocols like RTCP etc which control the link.
You mentioned ' request is proper,because it works for other builds the same(windows and etc..) ' Can you elaborate on this ? Is it the same way it works on other platforms ?

What are the steps you are following?
What are the packets you are writing on the connection?
I think there are four subsequent RTSP commands to get to the final execution/play of your url/file.
If you are not getting response from some specific Command, try writing some extra "\r\n" on the connection, after writing the command.
thanks,
Shivendra

What are the steps you are following?
What are the packets you are writing on the connection?
I think there are four subsequent RTSP commands to get to the final execution/play of your url/file.
If you are not getting response from some specific Command, try writing some extra "\r\n" on the connection, after writing the command.
thanks,
Shivendra

ash_123 wrote:As i understand http and rtsp are two different protocols and require different handling.
http is quite straight forward but same cannot be said about rtsp. RTSP uses other control protocols like RTCP etc which control the link.
Hi ash,
yes ur correct http is quite straigth forward than rtsp, in that after conn open only a single request would be written to the socket and in response we get the data to play,
where as here in rtsp we have more than one request which are written and read resp for it before play starts..
ash_123 wrote:
You mentioned ' request is proper,because it works for other builds the same(windows and etc..) ' Can you elaborate on this ? Is it the same way it works on other platforms ?
yeah request is proper means, i read in the forum that on read 0 byte,one of the reason would be mistake in the request written,am i offline here??
and ya in other platforms like windows,symbian,posix when i checked they are able to get response for the second req which im getting zero byte here in my case..
in the below i have pasted the packets which states the scene.
shivendra wrote:What are the steps you are following?
basically im porting the helix restricted code from helix community, all the design has been made from them for playing,streaming,buffer handling and loading approporiate dll based on header recieved to play the data.. im implementing platform specific code for networks, ie socket interface, all i have to do is connect,write,read and return filled buffer to the helix.
shivendra wrote:
What are the packets you are writing on the connection?
i have attached the packets which im writing for brew and as well as windows build as well in the next post here..
shivendra wrote:
I think there are four subsequent RTSP commands to get to the final execution/play of your url/file.
yes ur correct there are more than one request to be written before the final play begins.
shivendra wrote:
If you are not getting response from some specific Command, try writing some extra "\r\n" on the connection, after writing the command.
i dint get adding "\r\n" on the connection?? do you mean in request written or??
the poin is request is framed by helix like wise it is done so for other platforms, so i think it shuld have all these "\r\n" properly and also i tried this all but dint work
i have a doubt for both of u, when i write the data to the socket, after success i initialize a call back method which is triggered when the data is there to be read, here in my case after writing request second time i initialize the callback for read thru isocket_redable and it gets triggered as if there is data to be read but isocket_read returns zero, why it happens??

ash_123 wrote:As i understand http and rtsp are two different protocols and require different handling.
http is quite straight forward but same cannot be said about rtsp. RTSP uses other control protocols like RTCP etc which control the link.
Hi ash,
yes ur correct http is quite straigth forward than rtsp, in that after conn open only a single request would be written to the socket and in response we get the data to play,
where as here in rtsp we have more than one request which are written and read resp for it before play starts..
ash_123 wrote:
You mentioned ' request is proper,because it works for other builds the same(windows and etc..) ' Can you elaborate on this ? Is it the same way it works on other platforms ?
yeah request is proper means, i read in the forum that on read 0 byte,one of the reason would be mistake in the request written,am i offline here??
and ya in other platforms like windows,symbian,posix when i checked they are able to get response for the second req which im getting zero byte here in my case..
in the below i have pasted the packets which states the scene.
shivendra wrote:What are the steps you are following?
basically im porting the helix restricted code from helix community, all the design has been made from them for playing,streaming,buffer handling and loading approporiate dll based on header recieved to play the data.. im implementing platform specific code for networks, ie socket interface, all i have to do is connect,write,read and return filled buffer to the helix.
shivendra wrote:
What are the packets you are writing on the connection?
i have attached the packets which im writing for brew and as well as windows build as well in the next post here..
shivendra wrote:
I think there are four subsequent RTSP commands to get to the final execution/play of your url/file.
yes ur correct there are more than one request to be written before the final play begins.
shivendra wrote:
If you are not getting response from some specific Command, try writing some extra "\r\n" on the connection, after writing the command.
i dint get adding "\r\n" on the connection?? do you mean in request written or??
the poin is request is framed by helix like wise it is done so for other platforms, so i think it shuld have all these "\r\n" properly and also i tried this all but dint work
i have a doubt for both of u, when i write the data to the socket, after success i initialize a call back method which is triggered when the data is there to be read, here in my case after writing request second time i initialize the callback for read thru isocket_redable and it gets triggered as if there is data to be read but isocket_read returns zero, why it happens??

logs from wire shark--
brew packets
[HTML]
//first request after conn open
OPTIONS rtsp://192.168.1.21:554 RTSP/1.0
CSeq: 1
User-Agent: RealMedia Player HelixDNAClient/10.0.0.13149 (brew)
Supported: ABD-1.0
GUID: 00000000-0000-0000-0000-000000000000
ClientID: UNK_6.1_10.0.0.13149_play32_RN01_EN_ARM_No-FPU
Pragma: initiate-session
RegionData: 0
ClientChallenge: 06d08a185e3a919ef586c74d36f98dc7
CompanyID: ezYCyzUSY6nlXxJ5HT/jzA==
PlayerStarttime: [17/02/3909:17:29:56 00:00]
//response
.........:RTSP/1.0 200 OK
CSeq: 1
Date: Tue, 17 Feb 2009 11:59:38 GMT
Supported: ABD-1.0
Session: 102-1;timeout=79
Server: Helix Mobile Server Version 12.0.0.1095 (win32) (RealServer compatible)
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN
TurboPlay: 1
RealChallenge1: f38cc682220c17565dd2ad7eef9a450f
StatsMask: 8
//second request after which socket read 0 happens
DESCRIBE rtsp://192.168.1.21:554/house.rm RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: RealMedia Player HelixDNAClient/10.0.0.13149 (brew)
Session: 102-1;timeout=79
Require: com.real.retain-entity-for-setup
Language: en-US
RegionData: 0
ClientID: UNK_6.1_10.0.0.13149_play32_RN01_EN_ARM_No-FPU
GUID: 00000000-0000-0000-0000-000000000000
SupportsMaximumASMBandwidth: 1
[/HTML]
windows packets for first two requests
[HTML]
//first request after conn open
OPTIONS rtsp://192.168.1.21:554 RTSP/1.0
CSeq: 1
User-Agent: RealMedia Player HelixDNAClient/10.0.0.16656 (win32)
Supported: ABD-1.0
ClientChallenge: 3e80a3802aa683401104e2f093f95437
ClientID: ....................................................................
CompanyID: 2RBkeaz2OyE20qwDo2CQew==
GUID: 00000000-0000-0000-0000-000000000000
PlayerStarttime: [17/02/2009:10:06:40 05:00]
Pragma: initiate-session
RegionData: 0
//response
RTSP/1.0 200 OK
CSeq: 1
Date: Tue, 17 Feb 2009 04:36:26 GMT
Supported: ABD-1.0
Session: 45-1;timeout=79
Server: Helix Mobile Server Version 12.0.0.1095 (win32) (RealServer compatible)
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN
TurboPlay: 1
RealChallenge1: c687dadba8a2b1ed3fa9b74d7d6cc874
StatsMask: 8
//second request in windows
DESCRIBE rtsp://192.168.1.21:554/house.rm RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: RealMedia Player HelixDNAClient/10.0.0.16656 (win32)
Session: 45-1;timeout=79
Bandwidth: 10485800
Cookie: cbid=hkcgphjidgckeldmeopogpktqojrktlufkejkidlejdfflplqsronplqmoosdtcufkfgdmjl
GUID: 00000000-0000-0000-0000-000000000000
Language: en-US
PlayerCookie: cbid
RegionData: 0
Require: com.real.retain-entity-for-setup
SupportsMaximumASMBandwidth: 1
//response
RTSP/1.0 200 OK
CSeq: 2
Date: Tue, 17 Feb 2009 04:36:27 GMT
Session: 45-1;timeout=79
vsrc: http://192.168.1.21:80/viewsource/template.html?nuyhtgCBejz69Ab5tg0fs6wf...
Last-Modified: Wed, 05 Nov 2008 06:54:06 GMT
Content-base: rtsp://192.168.1.21:554/house.rm/
ETag: 45-1
Vary: User-Agent, ClientID
Content-type: application/sdp
x-real-usestrackid: 1
Content-length: 1214
v=0
o=- 1225868046 1225868046 IN IP4 192.168.1.21
s=House Of Dreams
i=
c=IN IP4 0.0.0.0
t=0 0
a=SdpplinVersion:1610641560
a=StreamCount:integer;1
a=control:*
a=Flags:integer;2
a=IsRealDataType:integer;1
a=Title:buffer;"SG91c2UgT2YgRHJlYW1zAA=="
a=range:npt=0-165.888000
m=audio 0 RTP/AVP 101
b=AS:10
b=TIAS:8000
b=RR:160
b=RS:80
a=maxprate:3.472222
a=control:streamid=0
a=range:npt=0-165.888000
a=length:npt=165.888000
a=rtpmap:101 x-pn-realaudio/1000
a=fmtp:101
a=mimetype:string;"audio/x-pn-realaudio"
a=Helix-Adaptation-Support:1
a=ActualPreroll:integer;2304
a=AvgBitRate:integer;8000
a=AvgPacketSize:integer;288
a=EndOneRuleEndAll:integer;1
a=MaxBitRate:integer;8000
a=MaxPacketSize:integer;288
a=Preroll:integer;4608
a=OpaqueData:buffer;"LnJh/QAFAAAucmE1AAAAAAAFAAAARgAAAAABIAACiAAAAOpgAADqYAAIASAAIAAAAAAfQAAAH0AAAAAQAAFnZW5yY29vawECAAAAAAAIAQAAAQEAAAw="
a=RMFF 1.0 Flags:buffer;"AAIAAgAA"
a=ASMRuleBook:string;"priority=5,averagebandwidth=8000,PNMKeyFrameRule=T;priority=5,averagebandwidth=0,PNMNonKeyFrameRule=T,OnDepend=\"0\"",OffDepend=\""0\"";""
a=intrinsicDurationType:string;""intrinsicDurationContinuous""
a=StreamName:string;""Audio Stream""
[/HTML]"

logs from wire shark--
brew packets
[HTML]
//first request after conn open
OPTIONS rtsp://192.168.1.21:554 RTSP/1.0
CSeq: 1
User-Agent: RealMedia Player HelixDNAClient/10.0.0.13149 (brew)
Supported: ABD-1.0
GUID: 00000000-0000-0000-0000-000000000000
ClientID: UNK_6.1_10.0.0.13149_play32_RN01_EN_ARM_No-FPU
Pragma: initiate-session
RegionData: 0
ClientChallenge: 06d08a185e3a919ef586c74d36f98dc7
CompanyID: ezYCyzUSY6nlXxJ5HT/jzA==
PlayerStarttime: [17/02/3909:17:29:56 00:00]
//response
.........:RTSP/1.0 200 OK
CSeq: 1
Date: Tue, 17 Feb 2009 11:59:38 GMT
Supported: ABD-1.0
Session: 102-1;timeout=79
Server: Helix Mobile Server Version 12.0.0.1095 (win32) (RealServer compatible)
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN
TurboPlay: 1
RealChallenge1: f38cc682220c17565dd2ad7eef9a450f
StatsMask: 8
//second request after which socket read 0 happens
DESCRIBE rtsp://192.168.1.21:554/house.rm RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: RealMedia Player HelixDNAClient/10.0.0.13149 (brew)
Session: 102-1;timeout=79
Require: com.real.retain-entity-for-setup
Language: en-US
RegionData: 0
ClientID: UNK_6.1_10.0.0.13149_play32_RN01_EN_ARM_No-FPU
GUID: 00000000-0000-0000-0000-000000000000
SupportsMaximumASMBandwidth: 1
[/HTML]
windows packets for first two requests
[HTML]
//first request after conn open
OPTIONS rtsp://192.168.1.21:554 RTSP/1.0
CSeq: 1
User-Agent: RealMedia Player HelixDNAClient/10.0.0.16656 (win32)
Supported: ABD-1.0
ClientChallenge: 3e80a3802aa683401104e2f093f95437
ClientID: ....................................................................
CompanyID: 2RBkeaz2OyE20qwDo2CQew==
GUID: 00000000-0000-0000-0000-000000000000
PlayerStarttime: [17/02/2009:10:06:40 05:00]
Pragma: initiate-session
RegionData: 0
//response
RTSP/1.0 200 OK
CSeq: 1
Date: Tue, 17 Feb 2009 04:36:26 GMT
Supported: ABD-1.0
Session: 45-1;timeout=79
Server: Helix Mobile Server Version 12.0.0.1095 (win32) (RealServer compatible)
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN
TurboPlay: 1
RealChallenge1: c687dadba8a2b1ed3fa9b74d7d6cc874
StatsMask: 8
//second request in windows
DESCRIBE rtsp://192.168.1.21:554/house.rm RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: RealMedia Player HelixDNAClient/10.0.0.16656 (win32)
Session: 45-1;timeout=79
Bandwidth: 10485800
Cookie: cbid=hkcgphjidgckeldmeopogpktqojrktlufkejkidlejdfflplqsronplqmoosdtcufkfgdmjl
GUID: 00000000-0000-0000-0000-000000000000
Language: en-US
PlayerCookie: cbid
RegionData: 0
Require: com.real.retain-entity-for-setup
SupportsMaximumASMBandwidth: 1
//response
RTSP/1.0 200 OK
CSeq: 2
Date: Tue, 17 Feb 2009 04:36:27 GMT
Session: 45-1;timeout=79
vsrc: http://192.168.1.21:80/viewsource/template.html?nuyhtgCBejz69Ab5tg0fs6wf...
Last-Modified: Wed, 05 Nov 2008 06:54:06 GMT
Content-base: rtsp://192.168.1.21:554/house.rm/
ETag: 45-1
Vary: User-Agent, ClientID
Content-type: application/sdp
x-real-usestrackid: 1
Content-length: 1214
v=0
o=- 1225868046 1225868046 IN IP4 192.168.1.21
s=House Of Dreams
i=
c=IN IP4 0.0.0.0
t=0 0
a=SdpplinVersion:1610641560
a=StreamCount:integer;1
a=control:*
a=Flags:integer;2
a=IsRealDataType:integer;1
a=Title:buffer;"SG91c2UgT2YgRHJlYW1zAA=="
a=range:npt=0-165.888000
m=audio 0 RTP/AVP 101
b=AS:10
b=TIAS:8000
b=RR:160
b=RS:80
a=maxprate:3.472222
a=control:streamid=0
a=range:npt=0-165.888000
a=length:npt=165.888000
a=rtpmap:101 x-pn-realaudio/1000
a=fmtp:101
a=mimetype:string;"audio/x-pn-realaudio"
a=Helix-Adaptation-Support:1
a=ActualPreroll:integer;2304
a=AvgBitRate:integer;8000
a=AvgPacketSize:integer;288
a=EndOneRuleEndAll:integer;1
a=MaxBitRate:integer;8000
a=MaxPacketSize:integer;288
a=Preroll:integer;4608
a=OpaqueData:buffer;"LnJh/QAFAAAucmE1AAAAAAAFAAAARgAAAAABIAACiAAAAOpgAADqYAAIASAAIAAAAAAfQAAAH0AAAAAQAAFnZW5yY29vawECAAAAAAAIAQAAAQEAAAw="
a=RMFF 1.0 Flags:buffer;"AAIAAgAA"
a=ASMRuleBook:string;"priority=5,averagebandwidth=8000,PNMKeyFrameRule=T;priority=5,averagebandwidth=0,PNMNonKeyFrameRule=T,OnDepend=\"0\"",OffDepend=\""0\"";""
a=intrinsicDurationType:string;""intrinsicDurationContinuous""
a=StreamName:string;""Audio Stream""
[/HTML]"

hi all,
i got it,
problem was i was doing strlen on the buffer and using that value for isoket_write which was writing 17 bytes extra than wat allocated, there was a member in the class which represents allocated leght of the buffer, i used it for no of bytes to write and it all worked, wire shark helped me to check the log where it showed 17 bytes extra and check sum was false..
thanks

hi all,
i got it,
problem was i was doing strlen on the buffer and using that value for isoket_write which was writing 17 bytes extra than wat allocated, there was a member in the class which represents allocated leght of the buffer, i used it for no of bytes to write and it all worked, wire shark helped me to check the log where it showed 17 bytes extra and check sum was false..
thanks

thanks all,
im able to play the music.
thanks shiva and ash for all ur help and forum where i got helpful information..

thanks all,
im able to play the music.
thanks shiva and ash for all ur help and forum where i got helpful information..

great.. just was curious to know, how r u playing the RTSP data?
thanks,
Shivendra

great.. just was curious to know, how r u playing the RTSP data?
thanks,
Shivendra

shivendra wrote:great.. just was curious to know, how r u playing the RTSP data?
thanks,
Shivendra
Hi here basically im porting helix restricted code, from helix community which some us have access too.(real player).
all the design has been already made by them,
like required plugins/dlls to play the packets of different formats.likre .rm,wma,mp3.
it initializes the renderers and setup the appropriate renderer based on the stream information..
we have added static plugins of all the different modules to form a single brewext dll
way to play rtsp is common for all platforms.

shivendra wrote:great.. just was curious to know, how r u playing the RTSP data?
thanks,
Shivendra
Hi here basically im porting helix restricted code, from helix community which some us have access too.(real player).
all the design has been already made by them,
like required plugins/dlls to play the packets of different formats.likre .rm,wma,mp3.
it initializes the renderers and setup the appropriate renderer based on the stream information..
we have added static plugins of all the different modules to form a single brewext dll
way to play rtsp is common for all platforms.

Is there a public or official way to get this extension for BREW from 3rd party?
thanks,
Shivendra

Is there a public or official way to get this extension for BREW from 3rd party?
thanks,
Shivendra

shivendra wrote:Is there a public or official way to get this extension for BREW from 3rd party?
thanks,
Shivendra
hey u can get that code at ur end as wel thru helixcommunity, except some restricted modules, and you have to build it for brew if u gonna do at ur end..
u can check out the code from helix community cvs.. its an open source
the only difference would be the code which we have builded for brew is not open source, we do not check back to helix public community

shivendra wrote:Is there a public or official way to get this extension for BREW from 3rd party?
thanks,
Shivendra
hey u can get that code at ur end as wel thru helixcommunity, except some restricted modules, and you have to build it for brew if u gonna do at ur end..
u can check out the code from helix community cvs.. its an open source
the only difference would be the code which we have builded for brew is not open source, we do not check back to helix public community

Hi,
How did wireshark help to detect the extra bytes, I am having exactly the same issue, I get 0 bytes in ISocket_read, after a write.
First few times ISocket_Write and read works fine, but after a certain point, wen i do isocket_write, immediately i get ISocket_Read with 0 bytes

Hi,
How did wireshark help to detect the extra bytes, I am having exactly the same issue, I get 0 bytes in ISocket_read, after a write.
First few times ISocket_Write and read works fine, but after a certain point, wen i do isocket_write, immediately i get ISocket_Read with 0 bytes