You Are Here:

Community: Developer Discussion Boards

#1 Old Problem with Recording - 2006-07-25, 09:10

Join Date: Jan 2006
Posts: 37
Location: India
Ashish_J2ME's Avatar
Ashish_J2ME
Offline
Registered User
Hi Friends,

I m using camera on form for recording the video; if we don't use the run method and stop recoding manually. it works properly. while by using run method and call cameraOn() method and start recording; and call capture mathod. it records but use Thread.sleep(30 seconds ) and then call stop recording method
after this thread in code after completing thread application comes out.

=====================================================

public void run(){
cameraOn();

}

public void cameraOn() {
try {

// form.addCommand(capture) ;
player = Manager.createPlayer("capture://video");
player.realize();
if ((mVidc = (VideoControl) player.getControl("VideoControl")) != null) {
mVideoItem = (Item)
mVidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
form.deleteAll();
form.append(mVideoItem);
}
player.start();

midlet.display.setCurrent(form);
capture();



}catch (Throwable t) {
showException(t);
}
}

public void playRecord() {
try {
InputStream in = new ByteArrayInputStream(createConnection.outputRecord);
player = Manager.createPlayer(in,"video/3gpp");
player.realize();
if ((mVidc = (VideoControl) player.getControl("VideoControl")) != null) {
mVideoItem = (Item)
mVidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
form.deleteAll();
form.append(mVideoItem);
}
//Append back command during showing video
player.start();
midlet.display.setCurrent(form);



} catch (Throwable t) {
showException(t);
}
}
public void capture(){
try{
form.addCommand(stopRecord);
form.removeCommand(capture);
rc = (RecordControl)player.getControl("RecordControl");
output = new ByteArrayOutputStream();
rc.setRecordStream(output);
rc.startRecord();
Thread.sleep(13000);
stopRecord();
} catch (Throwable e) {
showException(e);
}
}
public void stopRecord(){
try {
form.removeCommand(stopRecord);
form.addCommand(playBack);
if(player != null) {
player.stop();
rc.commit () ;
player.close () ;
player = null ;
recordFlag = false ;
createConnection.outputRecord = output.toByteArray() ;
form.addCommand(upload);
form.addCommand(save);
}

} catch (Throwable t) {
showException(t);
}
}

=========================================================

Every solution will be appritiated.

Thanx and regards;
Ashish


Ashish Sharma
J2ME Developer
Reply With Quote

#2 Old Re: Problem with Recording - 2006-07-26, 00:06

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi,

have you tried to use Thread.currentThread() method to get correct thread into sleep?

regards,
Peter
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio rajkumar278 Symbian Media (Graphics & Sounds) 7 2006-01-29 21:46
A difficult recorder problem, Can any body help me? Symbian_david General Symbian C++ 2 2004-07-06 10:33
7210 Silent Problem MarkMckim Mobile Java General 1 2003-03-18 13:36
Sound example in Series 60 SDK: Recording format problem jjesus Symbian Tools & SDKs 1 2003-03-11 07:15
Stream audio recording problem abhishekmishra General Symbian C++ 0 2002-10-04 04:56

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ