×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    29

    Question mmapi getSnapshot function :(

    mmapi

    hi,

    i made a small mmapi program to capture photo. it worked well on sonyerricson emulator but when i run it on nokia 6280 it gives MediaException when i call method mybyte = videoControl.getSnapshot(null);

    im not giving any argument to getShapshot() that mean default is png file. And what is the format of writing String to use specific encoding. such as jpeg etc....

    thanks

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: mmapi getSnapshot function :(

    Hello aqibarain,

    what's the MediaException in detail? Does the following provide any help?:

    http://discussion.forum.nokia.com/fo...mediaexception

    Regards,
    r2j7

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    29

    Re: mmapi getSnapshot function :(

    thanks r2j7

    this is teh exception im getting.

    // javax.microeditin.media.MediaException: only capture:// image Locator supports getSnapshot();


    and the code to get snap is simple...

    try{
    byteImage = videoControl.getSnapshot("encoding=jpeg");
    parent.useImage(byteImage);

    }catch(MediaException me){
    parent.showInformation("Media Exception ",me.toString());

    me.printStackTrace();
    }


    i used null also instead of jpeg but still same result and im using Nokia 6280

    thanks for ur help

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: mmapi getSnapshot function :(

    Hello aqibarain,

    I've tested this problem with Nokia 6280, I used getSnapShot(null) with my camera MIDlet and didn't encounter any exceptions.

    In addition, I discovered that supported snapshot encoding to be JPEG for Nokia 6280 as you've previously pointed out. You can use the following System Properties MIDlet to verify if this is the case with your phone:

    http://www.forum.nokia.com/info/sw.n..._2_en.zip.html

    In my case, the prev app returns JPEG for video.snapshot.encodings property string. The app manual says following regarding video.snapshot.encodings:

    "Supported video snapshot formats for the getSnapshot method in VideoControl. The string returned specifies the supported capture image formats. Each format is specified in a special syntax. The formats are delimited by at least one space. For example, “encoding=png”."

    Btw: what's the sw version of your phone (enter *#0000#)? Is your phone an operator/carrier branded phone?

    Regards,
    r2j7

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

    Re: mmapi getSnapshot function :(

    yes my phone is carrier branded phone but what do u mean by software version????

    how do i get my software version?? and i tried the link u gave me its working fine and shows that my phone supports Snapshots and jpeg images....

  6. #6
    Registered User
    Join Date
    Aug 2007
    Posts
    29

    Re: mmapi getSnapshot function :(

    the exect exception is...

    // javax.microeditin.media.MediaException: only capture:// image Locator supports getSnapshot();

    i changed
    Manager.createPlayer("capture://video");

    to

    Manager.createPlayer("capture://image");

    then it gave me exception in this code of block...


    try{
    player = Manager.createPlayer("capture://image");
    player.addPlayerListener(this);
    player.realize();

    videoControl = (VideoControl) player.getControl("VideoControl");
    videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);

    videoControl.setDisplayLocation(0, 0);
    videoControl.setDisplaySize(getWidth(), getHeight());

    player.start();
    }
    catch(Exception excep){
    excep.printStackTrace();
    }


    and the exception came as....

    javax.microedition.media.MediaException: Player cannot be created for capture://image

  7. #7
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: mmapi getSnapshot function :(

    Hello aqibarain,

    sw version can be obtained by entering *#0000# when you've your idle screen on.

    I've tested your latest code snippet, no problems there. Regarding locators: Using capture://image as instead of capture://video with getSnapshot() as you've previously done is the way to go (and should work OK) with Nokia 6280.

    Since this appears to be operator branded phone (btw: which operator?), it's possible that the problems are due to this. Afaik with some of such phones MIDlets may need to be signed by operator before they can be used. Regarding the problem, you should contact the operator and confirm if this is their policy too.

    Related discussion:

    http://discussion.forum.nokia.com/fo...d.php?t=112070

    Regards,
    r2j7

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    24

    Re: mmapi getSnapshot function :(

    Code:
    private void doSnapshot() {
            new Thread() {
                public void run() {
                    try {
                        byte [] snap = vidc.getSnapshot("encoding=jpeg");
                        if (snap != null) {
    			Image im = Image.createImage(snap, 0, snap.length);
    			ImageItem imi = new ImageItem("", im, 0, "");
    			append(imi);
                        }
                    } catch (MediaException me) {
                        System.err.println(me);
                    }
                }
            }.start();
        }
    -Praveen Saini
    Catalytic Software
    praveen.saini@catalytic.com

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    3

    Unhappy Re: mmapi getSnapshot function :(

    Manager.createPlayer("capture://image");

    then camera on capture anything

    any one help?
    Last edited by hitesh171285; 2010-05-14 at 13:43.

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. Replies: 0
    Last Post: 2007-04-11, 05:23
  3. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  4. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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