[Live-devel] (no subject)

Richy Mong richymong at gmail.com
Thu Jan 28 01:27:19 PST 2010


2010/1/28 Ross Finlayson <finlayson at live555.com>

>        1. There are two memory leaks here.I write my programs following
> the test***streamer and free the memory as the following:
>       if (sessionState.sink != NULL) sessionState.sink->stopPlaying();
>
>       Medium::close(sessionState.rtcpInstance);
>       Medium::close(sessionState.sink);
>       Medium::close(sessionState.source);
>
>       Medium::close(sms);
>       Medium::close(rtspServer);
>       delete sessionState.rtpGroupsock;
>
>       delete sessionState.rtcpGroupsock;
>
>       if(scheduler) delete scheduler;
>
>       if(env) env->reclaim();
>
>
> What you are doing is correct (although, if you are planning to rerun the
> same code once again, you could reuse the same "UsageEnvironment" and
> "TaskScheduler" objects; i.e., you would not need to delete them).  However,
> why don't you just run your code in its own process (i.e., as a separate
> application)?  That way, all of the memory that you allocated will
> automatically be reclaimed.
>
>    Thanks for your replay.I have never used a mailing list before so I
dont't know how to spilt
   my question asked from your answer.I'm sorry about the trouble you may
have in reading my
   email .Because I am using multiple thread here,so I have to reclaim the
memory by myself.
   Otherwise,there will be losts of memory leaks.

>
>       If I just create the sinkÅAsourcÅArtspserver etc and don't
> startplaying,there will be no memory leak.But if I add startplaying,after I
> close the server,there will be two memory leaks :
>
>
>
>       Detected memory leaks!
> Dumping objects ->
> {594258} normal block at 0x003CC818, 32 bytes long.
>  Data: <l G             > 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00
> {594245} normal block at 0x00B49008, 32 bytes long.
>
>  Data: <l G             > 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00
>
>       I am sorry that It may be difficult for you to find out what resulted
> in this,but can you give me some suggestion?
>
>
> Does 64 bytes of extra memory get allocated each time you run your code
> (i.e., in a loop), or does only 64 extra bytes get allocated, no matter how
> many times you run your code?  If it's the latter case, then the problem
> doesn't seem serious.
>
> However, you may be able to use "valgrind" (if you're running on a Unix or
> Linux system) to help track down where this memory allocation is coming
> from.
>
>     The case is the former.My os is windows.Bad luck:)

>
>       2.Sometimes esapcically after I restart teh server,when I start my
> server and use VLC to play th stream,the server receives the
> "DECRIBE"ÅA"SETUP" and "PLAY"command ok, but VLC just doesn't play the
> stream and it tears down a few seconds later.I don't know the reason.I use
> openRTSP and try to save the stream into a file.Things are the same.The
> connection between the RTSP server and openRTSP is ok,but openRTSP can't
> receive any data,so the file is empty. Then I restart the server for one or
> more times,everything goes all right.
>
>         I rarely run into this problem with testprogs or
> OnDemandRTSPServer.Therefore,there must be some reason that I have not found
> in my program.Would you please help me?
>
>
>
>  Unfortunately not; I can (in general) help only with the unmodified
> supplied code.
>
> I tested today and just found that if I run my server and VLC on the same
pc,it didn't work for
serval times. If I run my server and VLC ont different computers,I did't run
into this problem.It
was strange.

Other quesitons:
I want to add the client's IP address and port into a list or arry once he
connect to the server.So that after getting a frame,I can send it to all the
client.Because my server and client may run over the iternet rather than
LAN, I don't use multicast stream.Is it possible?
Or can I follow the existed testOnDemandRTSPServer and write my own subclass
of OnDemandServerMediaSubsessionto stream live source?If I can, should
createNewStreamSource returns the same soure instead of
FramedSource::createNew?

Thans for you time and answer.

Richy
Best regards

> --
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100128/63f5a76a/attachment.html>


More information about the live-devel mailing list