Namespaces
Variants
Actions

File size using RecordControl.setRecordSizeLimit(Integer.MAX VALUE) not set accordingly in Series 40 (Known Issue)

Jump to: navigation, search
SignpostIcon FilmReel 52.png
Article Metadata

Code Example
Tested with
Devices(s): Series 40 3rd Edition
Series 40 3rd Edition, FP1
Series 40 5th Edition

Compatibility
Platform(s): Series 40 3rd Edition
Series 40 3rd Edition, FP1
Series 40 5th Edition

Article
Keywords: RecordControl.setRecordSizeLimit
Created: User:Technical writer 1 (11 Nov 2008)
Last edited: lpvalente (19 Apr 2012)

Contents

Overview

File size is not set to the maximum size available in Series 40 when using RecordControl.setRecordSizeLimit(Integer.MAX_VALUE).

Description

When using RecordControl.setRecordSizeLimit(Integer.MAX_VALUE), the file size of the recorded video should be set to its maximum, enabling video recording longer than one minute. However, in Series 40 devices prior to Series 40 5th Edition, Feature Pack 1, the MMAPI player records only for a couple of seconds and exists then abruptly when the value Integer.MAX_VALUE is used.

How to reproduce

1. To reproduce this issue, implement the source code available at: File:Video recorder file size test MIDlet using MMAPI.zip

2. Install and launch the MIDlet in the test device. The MIDlet starts to record video and stops recording within a couple of seconds.

Solution

For the affected devices, the workaround is as follows:

1. Modify the example MIDlet's source code by removing the following lines:

  /***Replace part***/ 
 
rc.setRecordSizeLimit(Integer.MAX_VALUE);
 
vid.start();
rc.startRecord();
 
/***Replace part***/

Replace the removed lines with these lines:

  int size =  (int) fc.availableSize(); 
 
if(size < 100*1024) // if less than 100Kb available
{
Alert memoryAlert = new Alert("Error", "Not enough memory", null, AlertType.ERROR);
memoryAlert.setTimeout(2000);
Display.getDisplay(this).setCurrent(memoryAlert);
}
else{
rc.setRecordSizeLimit(size - 100*1024); /* set the record size limit
based on the free memory in the video folder, leave 100Kb available to the system */

 
vid.start();
rc.startRecord();
}

2. Install and launch the MIDlet using a test device. The MIDlet starts to record video and stops when it reaches the file size defined in the previous step.

This page was last modified on 19 April 2012, at 15:52.
110 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved