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

i am using jmf to Stream a video file from a one client to another, everything seems to be working fine except for the fact that i dont know how to close the prosessor and the session/datasink on the transmitting clients side when the clientis done streaming, i can close it lets say after 60 seconds of starting but i am not able to figure out how make it stop when the whole file is done streaming. i tried using the datasinklistner while 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 datasource.
the problem is that it works fine if i using a 20 second video and i close the datasink and the processor in 60 seconds, the whole file does get streamed but if i have a file longer than 60 seconds then the file just gets cut at 60 seconds.
i also tried to use a sessionmanager with a sessionlistener and a sendStreamListener and 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 whole code and sent files and everything but neither an activestreamevent nor a inactivestreamevent happens but the file is being streamed properly

user13490676 wrote:
could it be a problem with jmf itself that the endofstream doesnt get generated for the datasource being read from a fileIn this instance, that would be the problem... more than likely, there's something weird about the file, perhaps it doesn't have a duration set in the header and JMF treats it like a live stream.
You could always write a custom DataSource that just passes through the input of a normal data source, and then generate the EndOfStream event yourself... maybe based on a timeout or failure counter? I haven't received any data in x seconds or after x attempts, so I'm assuming the file is done... Or when you've read enough data that the file can't possibly have any more (read >= file header + file data)...

Similar Messages

  • How do I restore a previous session when the Firefox homepage does NOT have the "restore" button and it is grayed out in the menu? menu

    My Firefox homepage had a "Restore Previous Session" button but it has disappeared. SO when my Firefox crashes I lose all my tabs and tab groups, and this is very inconvenient. I have checked through all the "Options" seeing if there is some button there to enable this feature, but to no avail. I am frustrated as after a crash I spend hours revisiting all my links in my History menu to reset my tabs. Can you help?

    In case you are using "Clear history when Firefox closes":
    *do not clear the Browsing History
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    Clearing cookies will remove all specified (selected) cookies including cookies that have an allow exception and cookies from plugins.

  • How can I log on my session when the memory disk is full. I can't enter the password

    Need help!!!
    I can't start my session on my air book .. Some days ago I had a message which sayed that the memory disk is full..
    I wasn't starting to cancel files so when I would do it some hours later I can't anymore enter the password of my session.
    Some one can help me please.

    Use your computer to go to http://www.icloud.com/find
    Locate your iPhone, and choose "Remove This Device" on the bottom.

  • How can I edit my iweb published site when the domain file is empty?

    How can I edit my iweb site when the domain file opens up empty? I have the site backed up in mobile me, on my computer, and on an external hard drive.
    How can I transfer these files into iweb?

    Hi there,
    To edit your site from one of your backed up versions, place the Domain file in User>Library>Application Support>iWeb & then launch iWeb. Update & publish.
    Ben

  • How make to know when the attachment file display its visible or hidden

    Hi guys,
    sorry for my english.
    In my scenario I have two button for open or close the attachment file display with the script 'app.execMenuItem("ShowHideFileAttachment");'.
    But i don't know when the attachment file display its visible or hidden or detect when the user clicks on show/hidden in the display.
    Anybody knows?
    Thanks in advance.
    ZAMPAZAMPA.

    Thanks radzmar,
    You help me a lot, but how i make to ask to pdf is it panel of attachment its open?
    I make this:
    event.target.viewState == {overViewMode:7}
    but return false all the time when panel of attachment its open and when its close.
    ZAMPAZAMPA.

  • How to preven JButton of generated actions when the user keep pressing down

    How to preven JButton of generated actions when the user keep pressing down the key or the short cut
    The code below to show the issue when the user keep pressing Alt+ O
    We want to prevent the JButton from generating multi actions just one action only
    A sample of code shows the behaviour which has to be prevented. Continue pressing "Alt +O" and you will see the standard ouptput will print time stamps
    Please notice, I am NOT interested in Mouse press which has a solution by adding a threshold ( setMultiClickThreshhold(long threshhold) on the JButton  as an attribute.
    public class TestPanel extends JPanel
       private JButton btn;
       public TestPanel()
          btn = new JButton("Open");
          this.add(btn);
          registerCommand(new MyAction(), InputEvent.ALT_MASK,
                KeyEvent.VK_O, btn, btn.getText(), 0);
       public static void registerCommand(AbstractAction action,
             int mask,
             int shortCommand,
             JComponent component,
             String actionName,
             int mnemonicIndex)
          InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
          KeyStroke knappKombination = KeyStroke.getKeyStroke(shortCommand, mask);
          if ((component instanceof AbstractButton)
                && mnemonicIndex >= 0
                && mnemonicIndex < actionName.length()
                && (shortCommand >= KeyEvent.VK_A && shortCommand <= KeyEvent.VK_Z))
             ((AbstractButton) component).setDisplayedMnemonicIndex(mnemonicIndex);
          if (inputMap != null)
             ActionMap actionMap = component.getActionMap();
             inputMap.put(knappKombination, actionName);
             if (actionMap != null)
                actionMap.put(actionName, action);
       public static class MyAction extends AbstractAction
          private static final long serialVersionUID = 1L;
          @Override
          public void actionPerformed(ActionEvent e)
             System.out.println(System.currentTimeMillis());
       public static void main(String... args)
          SwingUtilities.invokeLater(new Runnable()
             public void run()
                JFrame frame = new JFrame("Testing");
                JPanel panel = new TestPanel();
                frame.getContentPane().add(panel);
                frame.setPreferredSize(new Dimension(500, 500));
                frame.setMinimumSize(new Dimension(500, 500));
                frame.pack();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setVisible(true);
    }Edited by: user12130673 on 2013-feb-13 03:01

    Use KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease) with onKeyRelease=true instead?

  • How do I verify my iCloud account when the email address apple wants to send the instructions to no longer exists?

    How do I verify my iCloud account when the email address Apple wants to send the instructions to doesn't exist?  I know I need to change the email account associated with iCloud but there doesn't seem to be a way to do so.  Any help would be greatly appreciated!! 

    Did you create an entirely new ID or did you just change the Gmail address to a new email address on your existing ID?

  • How do you reset apple ID password when the safety email address is no longer active?

    How do you resent Apple ID password when the safety email address is no longer active?

    The Best Alternatives for Security Questions and Rescue Mail
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contact Apple support.
        c. Rescue email address and how to reset Apple ID security questions.

  • In Elements 12, how do I get thumbnails to show when opening a file?

    In Elements 12, how do I get thumbnails to show when opening a file?

    When in iPhoto (photos, library, an album, whatever, etc.) and I try to position the thumbnails at the top of the page I am unable to do so. In the "View" menu of iPhoto, then "Thumbnails" at the bottom, then all the items in the menu are grayed out. I have tried to go to iPhoto prefences and try there, but no luck. I get the beachball turning for a few minutes, then it stops, but still no luck.
    I have iPhoto 08, OS 10.5.8, anda PowerBook G4, 17"
    Thanks, and sorry for the brief/incomplete question.

  • How do I uninstall or reinstall itunes when the itunes.mls file is missing and won't do either without it?

    How do I uninstall or reinstall itunes when the itunes.mls file is missing and won't do either without it? Have done a search for the file extension on PC and two external hard drives. Doesn't show up.

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Can anyone explain to how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this it is driving me nuts

    can anyone explain to me how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this i want to get rid of it it is driving me nuts

    What do you have checked in Firefox Preferences>General?
    Ciao.

  • How can I turn off "reply" button when the messages come? I prefer the "open" button.

    How can I turn off "reply" button when the messages come? I prefer the "open" button. Because my friends usually send lots of messages at the same time so I cannot read all of them when I press "reply", then I have to go to Messages -> my friends' messages, and it's really complicated.

    Sorry for not quite understanding. I guess you are referring to a notice in an alert. I do not have that alert active on my device, so I cannot say. I use the banner alert, so I just get a notice of a message and can swipe to open that particular message. If I ignore it, it will eventually go away.

  • I need to know how to authorize or deauthorize a computer when the email address attached to it no longer exists.

    I need to know how to authorize or deauthorize a computer when the email address attached to it no longer exists
    I can't access the account because your system doesn't recognize the last password -- and it won't let me change the password because it says the birthday information is wrong -- it's not.  There is no help item for that either, so somebody PLEASE tell me how to get around this problem.  My music is being held hostage.

    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team..

  • HT5312 how do you reset your security questions when the rescue email address no longer exists?

    how do you reset your security questions when the rescue email address no longer exists?

    Didn't the link to contact the iTunes Store staff in the 'Additional Information' section of that article work for you? If you don't already have a valid rescue email address, only Apple itself can reset the questions.
    (90823)

  • HT4061 how do i turn my phone on when the power button stuck

    how do i turn my phone on when the power button stuck

    Plug it in to the charger - plugging it in should cause it to power on.

Maybe you are looking for