Screen Capturing Problem

Discussion in 'Mac Programming' started by nafidhaque, Dec 9, 2009.

  1. nafidhaque macrumors newbie

    Joined:
    Dec 9, 2009
    Location:
    Germany
    #1
    I am trying to capture a screen shot at regular interval. My code is able to do so however while running this program if I change the user (using fast user switching) to log in to a different account and after a while return back to the previous user running the screen capture program, I notice that my program failed from the point I switched to a different user. Upon further inspection and debugging I noticed that CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay) is giving an Invalid Value as one of the attributes for
    NSOpenGLPixelFormatAttribute. Could anyone here help me in solving this issue?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    It's a security feature.

    If any user could access every other user's screen, consider how that could be abused and cause harm.
     
  3. nafidhaque thread starter macrumors newbie

    Joined:
    Dec 9, 2009
    Location:
    Germany
    #3
    I do not want to access the screen of any other user, but my program should continue to capture the screen of my session (I am in background now and I started the capturing program in my session). The program fails when I log in to a different user keeping the previous user running in background.
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    You're using different users, as far as the OS knows, or can even detect. A different user account is a different user, with a different login process and graphics session. It may be the same person logging in under two user accounts, but there's no way to tell the OS that.

    Please explain why it's necessary to run the screen capture as a different user. Depending on what you're trying to accomplish, there may be other ways to do it.
     
  5. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #5
    Maybe so, but it should be possible--at least it was in older versions of OS X. I haven't checked in a year or so. It *was* possible to start a VNC server in one user account, switch to another user using FUS, and then log into the existing VNC account AND USE IT.

    While what I'm describing isn't *actually* feasible (I ran into serious keyboard issues when someone was pressing modifier keys on the local keyboard), it does show that a screen recorder doesn't necessarily have to die after a fast user switch.


    Since I wasn't involved in the coding part, I can't offer much help there, but you could look into the OSXvnc source code and see if you can find anything useful there.
     
  6. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #6
    To clarify, when I logged into the VNC server, it was the background user's session that was visible--not the foreground user's session. This didn't break anything security-wise.
     
  7. Consultant macrumors G5

    Consultant

    Joined:
    Jun 27, 2007
    #7
    So you have account A, started the screen cap with account A,

    switched to account B, but still want account A activities to be captured?
     
  8. nafidhaque thread starter macrumors newbie

    Joined:
    Dec 9, 2009
    Location:
    Germany
    #8
    Yes this is exactly what I am trying to do. Account A started the capture program. I move to account B but want the program in account A to keep capturing account A. This far when I make the switch from A to B I see that my program stops with an error. What I found is the displayID required to create the OpenGL context seems to be invalid from the point I made the switch.
     

Share This Page