×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    recordcontrol.setStream(out) throws NullPointerException

    hi all,
    i m developing a j2me application for video capture and recording. The application works good for video capture but for video recording it throws NullPointerException.
    My code is as follows :

    if(player != null)
    player.stop();
    if(ctrl != null)
    ctrl.commit();

    if (player==null) {

    player = Manager.createPlayer("capture://video?encoding=video/3gpp");
    }
    player.realize();
    player.prefetch();

    iss = new ByteArrayOutputStream();
    ctrl = (RecordControl)player.getControl("RecordControl");
    System.out.println(".........................");
    //ctrl.setRecordLocation("file:///0:/sounds/audio.3gpp");
    //ctrl.setRecordLocation("file:///C:/WTK25/appdb/DefaultColorPhone/filesystem/root1/promo.mpg");
    ctrl.setRecordStream(iss);
    System.out.println(".........................");
    ctrl.startRecord();
    player.start();


    the above code throws NullPointerException for ctrl.setRecordStream(iss);

    any suggession for the same is highly appriciated.

    thanks in advance

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: recordcontrol.setStream(out) throws NullPointerException

    hi,

    it would be rather that your ctrl is null while you're trying to access its method (setRecordStream(...)):
    Code:
    if(ctrl == null){
        throw new CustomException("RecordControl not supported");
    }
    regards,
    Peter

Similar Threads

  1. calling midlet from midlet throws SecurityException on 6600
    By brianpegan in forum Mobile Java General
    Replies: 3
    Last Post: 2010-10-25, 05:31
  2. Replies: 2
    Last Post: 2004-11-17, 11:20
  3. What can we learn from this ?
    By dtianx in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-04-28, 03:45
  4. Weird NullPointerException
    By baegsi in forum Mobile Java General
    Replies: 8
    Last Post: 2003-12-19, 12:12
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

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