How to close a jmf rtp session when the entire file is sent.

I use jmf to stream a video file from one client to another, everything seems to work fine except for the fact that I don't know how to close the prosessor and the session/datasink on the transmission side when customers the clientis done streaming, I can close lets say after 60 seconds of starting, but I am not able to understand how to stop when the entire record is streaming. I tried to use the datasinklistner when sending the video and the following code
public void dataSinkUpdate(DataSinkEvent event) {

         if (event instanceof javax.media.datasink.EndOfStreamEvent) {
             endOfStream = true;

         }
     }
but the endofstream event is never received from the data source.

the problem is that it works very well if I using 20 second video and I close the datasink and the processor in 60 seconds, the entire file get listened to but if I have a file for more than 60 seconds, then just file is reduced to 60 seconds.

I also tried to use a sessionmanager a sessionlistener and a sendStreamListener with the following code
/**
     * SessionListener.
     */
    public synchronized void update(SessionEvent evt) {


    }


    /**
     * SendStreamListener
     */
    public synchronized void update( SendStreamEvent evt) {
        System.out.println(evt);

     if (evt instanceof InactiveSendStreamEvent) {
          flag=true;
          System.out.println("done");


     }
     if (evt instanceof ActiveSendStreamEvent) {

         System.out.println("start");


    }
    }
I ran the code and send files and everything, but neither an activestreamevent nor an inactivestreamevent happens but the file is currently distributed correctly

user13490676 wrote:
could this be a problem with jmf itself that the endofstream don't get generated for the playing of a file data source

In this case, that would be the problem... more that likely there is something odd about the file, maybe it doesn't have a duration set in the header and JMF treats it as a live stream.

You can always write a custom data source that passes right through the entrance of a normal data source and then generate the EndOfStream event yourself... maybe based on a timeout counter or failure? I have not received all the data in x seconds or after x attempts, so I guess that the file is... Or when you have read enough data that the file cannot have more (read > = file header / data file)...

Tags: Java

Similar Questions

Maybe you are looking for

  • Satellite 2450 - free display

    My screen on my laptop has come loose.Anyone know how I can fix this problem? Thank you

  • Pixel white dot on Satellite A100. What can I do?

    Hello I have two of them (these are white dots that can be on the white pages) I am currently using software undead pixelWhat can I do? I don't want theirIt's terrible.My Satellite A100 237 I have warranty related it a week agoIt works on this situat

  • Equium A110-233 - cannot find Steromix

    Hi every1 I have a prob on my computer model of Toshiba laptop satellite A110-233. I want to play songs in the chatroom through Stero mix but I found no table of mixing stereo or another that I could play songs without speakers, because normally ther

  • Can someone convert my VI´s?

    I have some files I've done in labview 9, but I need for school in labview 7 and my labview test 9 expired so I can't convert me. It is a zip file with the files that need to be converted http://www.sendspace.com/file/3r0q85 If someone could make thi

  • What is a part of Windows 7? ETDCtrl.exe

    I got an alert will appear on the start saying:-C:\Program Files\Elantech\ETDCtrl.exe "This application has requested execution to terminate in an unusual way." I have not installed this software and the site of momentum (which seems to be associated