×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    5

    Executing function exactly during exposure time

    Hi,
    I am working on a Lumia 520 mobile. I wish to execute a particular function exactly during the exposure time of the camera. For this, I have used the following capture function(I have modified the code from "Advanced photo capture for Windows Phone 8" ):
    Code:
    public async void capture()
            {
                // Take a picture. Flag busy meanwhile.
                cam_busy = true;
                await _camsequence.StartCaptureAsync();
                cam_busy = false;
                transmit = true;
                imstream.Seek(0, SeekOrigin.Begin);
            }
    In the MainPage class, I check for cam_busy and then run the program. However, the cam_busy is true for time longer than the exposure time. Is there any better way to do it?

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    548

    Re: Executing function exactly during exposure time

    Just so I understand this correctly, you want to run other code while await _camsequence.StartCaptureAsync() or await capture() is running?
    Last edited by theothernt; 2014-01-09 at 19:12.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    511

    Re: Executing function exactly during exposure time

    The capture is longer than the exposure time (e.g. calculations, transfer of data from the camera chip to the OS memory, etc.). What exactlly is the use case for needing to do something exactlly for the duration of the exposure?

  4. #4
    Registered User
    Join Date
    Oct 2013
    Posts
    5

    Re: Executing function exactly during exposure time

    Hi,
    @theotherent: I wish to run the code during await _camsequence.StartCaptureAsync() . But more specifically, I want to run the other code only during the exposure time.
    @SB Dev: I am recording the motion of the camera through the accelerometer during the exposure time. Hence I would need precisely the exposure time duration.

    Further, I have set the exposure time to 200ms using the know camera properties.

    Thanks in advance.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    511

    Re: Executing function exactly during exposure time

    I fear the APIs won't allow you to exactlly measure that time. I'd guess that the exposure time will start rather soon after the call to StartCaptureAsync if the FocusAsync has been called before (otherwise the device might still do the focus operation before actually snapping the picture). So you could start your operation immediately but stop it after the configured exposure time has expired (using a timer) rather than waiting for the capture operation to finish.

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    548

    Re: Executing function exactly during exposure time

    I would second what SB Dev has said - it'll be tricky to do as the timing might not be exact, and you have no guarantee when certain events will happen unless the camera API has callbacks.

    Also, I'd guess that not all the phone expose, focus, etc at the same speed - SB Dev has a camera app in the store and should be able to give more practical advice than me.

Similar Threads

  1. 5800 camera exposure time
    By yrdawson in forum General Development Questions
    Replies: 1
    Last Post: 2010-11-10, 15:26
  2. Executing callback methods at specified time
    By chandran.biju007 in forum Symbian
    Replies: 6
    Last Post: 2010-01-12, 21:10
  3. Replies: 4
    Last Post: 2008-12-03, 20:15
  4. Replies: 3
    Last Post: 2008-02-09, 13:05
  5. How to call a function while dialog RunDL() is executing?
    By danparks in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-09-30, 04:50

Posting Permissions

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