California Penal Code Sec. 647(j)(2) forbids placing a hidden camera for this purpose. http://law.onecle.com/california/penal/647.html
I have no idea if there is a similar federal law, but on Federal government property within California, the US Code provides that California state laws are enforced if there is no superceding federal law. This would apply, for example to a camera placed in a bathroom of a federal worksite, or in a bedroom in a military housing barracks.
The purely theoretical answer is to check the penal code which you will find in the count law library.
The above is not intended as legal advice. The response does not constitute the creation of an attorney client relationship as this forum does not provide for a confidential communication.
This is a complicated question under federal law. For federal law to apply, there has to be something that brings the matter within federal jurisdiction, such as use of interstate commerce. If the video is solely for private use it is probably not a federal crime. If it is disseminated in any way, or intended to be disseminated, it could well be a federal crime. In addition, as we just saw in the Rutgers case, if there is a bad outcome, the prosecutor will find a way to prosecute.
There are state laws, as well as, federal wire tapping laws that prohibit video taping or recording a person in situations where privacy is the expectation such as privately engaging in sexual activity. There are also laws about video taping and broadcasting, selling, or disseminating recordings of others in public forums without there knowledge or consent.
See California Penal Code Sec. 647