On Friday morning, mourners filled the Barstow Church of God in Christ, a big sand-colored building on the outskirts of a desert city between Los Angeles and Las Vegas.

The church was holding a funeral for Diante Yarber, 26, who died in a police shooting on April 5. He was behind the wheel of a black Mustang in the parking lot of a Walmart in Barstow, Calif., with three passengers when officers arrived and told him to get out of the car.

Instead, the police said, Mr. Yarber accelerated in reverse, then forward and then in reverse again, striking patrol cars before four officers opened fire.

Protests erupted in Barstow after Mr. Yarber’s death, and video footage of the shooting was shared online by the activist Shaun King and has been viewed more than 200,000 times. The episode occurred just weeks after the police in Sacramento fatally shot another black man, Stephon Clark, whose death set off marches across that city.