×

Discussion Board

Results 1 to 12 of 12

Thread: SeekControl

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    SeekControl

    Hi,
    i have a simple test midlet where i play audio aac inside mp4 file.
    i use DataSource to initiate the player (manager.createplayer(datasource)).
    (the purpose of the test is to use DataSource so no answers with out DataSource pls).

    for some freaking reason Nokia N95 (so far the only nokia i've tested) calls DataSource.getControl("SeekControl") WHAT THE HELL IS THAT CONTROL????
    its undocumented its not in any of the spec (135 or 234).

    WTF nokia!!!

    Answers???

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: SeekControl

    Hello??? response? any1?

  3. #3
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: SeekControl

    Sorry, I did not exactly understand what you are asking (normal for me, my brains are getting slower by the day :-)

    So can you explain a this with a code sample and more detailed explanation and also tell what is the question you are asking (and please do not use inappropriate acronyms in here.)

    Hartti

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: SeekControl

    Hi hartti

    im calling Manager.createPlayer(DataSource) with my DataSource classed that implement all the abstracts of DataSource.
    among those abstracts are 2 methods that deal with control getControl("controlname").

    my DataSource class receive a call to getControl("SeekControl") after calling player.start() with the player returned from my Manager.createPlayer(DataSource) call.

    the "SeekControl" is totaly undocumented and it is unclear as to what i need to return to that call.
    even more this call is being made after the player has consumed all the data from my SourceStream from the DataSource which kind of defeat the purpose of him asking for "SeekControl".

  5. #5
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: SeekControl

    Got it.
    I have asked the dev team for more information. I have no other information as of now.

    Hartti

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: SeekControl

    any answer ?

  7. #7
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: SeekControl

    Not yet. Unfortunately as it is vacation season in Finland, the response might get delayed quite a bit...

    I'll ask again though.

    Hartti

  8. #8
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: SeekControl

    Hi,
    any news?

  9. #9
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Barcelona, Spain
    Posts
    55

    Re: SeekControl

    After er.. 'taking a look' to some classes in the emulator and I think that this control is only used to reset the position of the stream at the begining. Take a look at this code so you could get the idea:

    Code:
    SourceStreamReader:
    
       javax.microedition.media.Control control = iControllable.getControl("SeekControl");
       if(control != null)
          (new SeekThread(iWaitObject, (SeekControl)control)).start();
    
    
    SeekThread:
    
       try {
          iSeekControl.seek(0);
       } catch(Exception exception) { }
    Also the getControl("SeekControl") is called when the stream is closed to close the control so this is why are you getting a call after consuming all the data on the stream.

    Code:
       javax.microedition.media.Control control = iControllable.getControl("SeekControl");
       if(control != null) {
          SeekControl sc = (SeekControl)control;
          sc.close();
       }
    and the interface:

    Code:
       public interface SeekControl extends Control {
          public abstract void seek(int i) throws IOException;
          public abstract void close();
       }
    I do not know how accurate is this information but is what I found digging a bit.

  10. #10
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: SeekControl

    Hi rrafols

    10x for your "taking a look"
    i dont use nokia sdk so i didnt had class to decompile nor would i wanna get into that...
    i still dont understand how they expect me to return such object when i cant even create one... since i dont know in which package it reside (and if its system package then no chance) etc...

    any chance u can post the full code of the SeekThread?
    or is that all the code?

    BR
    shai

  11. #11
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Barcelona, Spain
    Posts
    55

    Re: SeekControl

    I hope Nokia won't sue me for this

    Code:
    package com.nokia.microedition.media.protocol;
    
    import com.nokia.microedition.media.SeekControl;
    
    class SeekThread extends Thread {
        public SeekThread(Object aWaitObject, SeekControl aSeekControl) {
            iWaitObject = aWaitObject;
            iSeekControl = aSeekControl;
        }
    
        public void run() {
            try {
                iSeekControl.seek(0);
            }  catch(Exception exception) {}
    
            synchronized(iWaitObject) {
                iWaitObject.notify();
            }
        }
    
        private final SeekControl iSeekControl;
        private final Object iWaitObject;
    }
    I do not know if you could extend something from com.nokia.microedition.media.SeekControl but give it a try and let me know

  12. #12
    Registered User
    Join Date
    Aug 2007
    Posts
    5

    Re: SeekControl

    Where does the DataSource.getControl("SeekControl") get called? You just need to extend a class from the abstract DataSource class as specified in the MMAPI-JSR135 spec. Nothing more needs to be done. Please let me know where DataSource.getControl("SeekControl") gets called and where exactly you are stuck.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×