https://en.m.wikipedia.org/wiki/Miller_test
From that wikipedia page:
—-
The Miller test was developed in the 1973 case Miller v. California.[3] It has three parts:
Whether "the average person, applying contemporary community standards", would find that the work, taken as a whole, appeals to the prurient interest,
Whether the work depicts or describes, in a patently offensive way, sexual conduct or excretory functions[4] specifically defined by applicable state law,
Whether the work, taken as a whole, lacks serious literary, artistic, political, or scientific value.
The work is considered obscene only if all three conditions are satisfied. (this sentence has “citation needed” though)
—-
I don’t think regular porn fits there, but yeah I am not a lawyer
edit: reading more about that case, it was actually directly about porn, and the decision was directly used against porn producers.