×

Discussion Board

Results 1 to 8 of 8

Thread: Camera observer

  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    77

    Camera observer

    Hi all,

    i would to implement an observer for the built-in camera that notify me if some application (not the mine but whatever application in the device) is using the built-in camera.
    I'm using the MCameraObserver2 class on a SDK FP2 device to do this but my application is not working and i have some question.

    I wrote a class derived from MCameraObserver2 to get the notifications.
    Does this class also derive from the CActive or the asynchronous scheduler is implemented by the MCameraObserver2?

    I don't want to use the camera but only get notifications so logically my class (that derived from MCameraObserver2) has in its constructor the CCamera::New2L(*this, aCameraIndex, aPriority) method call where *this is a pointer to my own class.
    Is this necessary or i could also not to call the CCamera constructor as i don't want to use the viewFinder but only get notifications?

    Any help will be appreciated.

    Best regards

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Camera observer

    Yes, you need a running Active Scheduler loop. In Symbian C++ all kind of asynchronous callbacks are called by active objects.
    It is absolutely not sure that you will get any notifications, however it is sure that you have no chance without calling the constructor (how would the camera even know about the existence of your application otherwise?)

  3. #3
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    77

    Re: Camera observer

    ok thank you so much wizard_hu

  4. #4
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    258

    Re: Camera observer

    Quote Originally Posted by iit-developer View Post
    Hi all,

    i would to implement an observer for the built-in camera that notify me if some application (not the mine but whatever application in the device) is using the built-in camera.
    I'm using the MCameraObserver2 class on a SDK FP2 device to do this but my application is not working and i have some question.
    Hi,

    I'm not 100% sure, but I very much doubt that you can use MCameraObserver2 to get events from other applications, at least without their involvement.

    My impression is, that several different observers can observe camera events at the same time, but one of them is the "owner" (calls NewL/New2L) and others create a duplicate (NewDuplicateL/NewDuplicate2L) with the handle of the original CCamera. When creating a duplicate, you also need to know whether the original CCamera object was created with NewL or New2L and call the corresponding duplicate function.

    I'm not sure if it's possible to have a duplicate in a different process than the original instance, but if it is, one wild idea would be to try to find some kind of pattern in camera handles (always the same? always increasing by one) and then periodically trying to create a duplicate with the supposedly next handle. Of course this is not very usable in practice but might be interesting

    -TongMuan

  5. #5
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    77

    Re: Camera observer

    Can anybody confirm or deny what TongMuan is saying?
    Is possible with MCameraObserver2 to implement an observer for the built-in camera that notify me if some application (not the mine but whatever application in the device) is using the built-in camera?

    Thank's all
    Last edited by iit-developer; 2010-06-22 at 09:00.

  6. #6
    Nokia Developer Expert
    Join Date
    Dec 2003
    Posts
    148

    Re: Camera observer

    Hi,

    The behavior you describe is not directly supported by ECam.

    I think that you can reach similar functionality if you create CCamera using New2L() and use the lowest possible priority (-100). Then call CCamera::Reserve() - if this fails, someone is using camera already. If it succeeds you have reserved the camera for your use. Now when ever some application starts using the camera it will most likely have higher priority than your observer application your app will be pre-empted. You will receive event KUidECamEventCameraNoLongerReserved. If you still want to continue this observing you will need to successfully Reserve the camera again.
    janza

  7. #7
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    77

    Re: Camera observer

    Ok thank you so much janza,
    you show me an indirect way to get notified when some application running in the device is accessing the built-in camera.

    So do you think is not possible to receive in my application the notifications from other applications that are using the built-in camera , for example if i would receive a notification that a picture or a video has been taken by another application through the camera?

    Best regards

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Camera observer

    Quote Originally Posted by iit-developer View Post
    So do you think is not possible to receive in my application the notifications from other applications that are using the built-in camera , for example if i would receive a notification that a picture or a video has been taken by another application through the camera?

    Best regards
    if you search this forum you will find it has been discussed more then once with end to end solution. basically you can't get a notification of the camera capture but you can get a notification when a image is saved to a folder. after that you have to do the hard work of figuring out which file is "new captured file"

Similar Threads

  1. Observer query
    By pankaj gupta55 in forum Symbian
    Replies: 5
    Last Post: 2008-09-05, 20:41
  2. Process observer
    By songoku83 in forum Symbian
    Replies: 6
    Last Post: 2008-07-10, 10:07
  3. Observer class
    By songoku83 in forum Symbian
    Replies: 2
    Last Post: 2007-08-28, 04:03
  4. observer
    By nicholasgaye in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-04-04, 09:36
  5. More one Observer
    By CONTEMPO in forum Nokia M2M
    Replies: 6
    Last Post: 2005-01-10, 15:31

Posting Permissions

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