change_camera not working with internal macbook camera

Hi, i have this function that i usually use in my programs for selecting between cameras conected to the computer.

I been trying with a macbook pro and it doesnt work with the internal camera of the laptop.

It only works if i first start the app withouth any connected cameras to the computer so it uses the internal camera, then i can conect my second usb camera and i can switch to that camera with the function , but i cannot switch it back to the internal camera.

any idea why is this?

is there special way of recognizing the internal camera of the macbook pro? why is not working?

thanks!

here is the function:

  
  
  
  
void testApp::changeCamera(int num){    
      
  
    videoIn.close();    
    videoIn.setDeviceID(num);    
  
    videoIn.initGrabber(camWidth,camHeight, GL_RGB);  
}   

Please forget it , i just make it work .

when you solve your own problem, you should post about how you fixed it :slight_smile:

1 Like

Yes, sorry it was a stupid mistake, i needed to select option 4 instead of 3

:stuck_out_tongue:

Does anyone know if this method works for android? I tried it and it didn’t seem to work for me. It gave me an error at the last line saying the grabber was already initialized and the screen stayed showing the old camera