Giants broadcaster Dave Flemming promised he would not fly the coop to become a national star, and he has kept his word.

Flemming said Thursday that he and the Giants have agreed to a four-year contract that will keep him in the booth at China Basin through the 2022 season.

Moreover, Flemming said, starting in 2020, he will increase the number of Giants games he broadcasts each year from 130 to 140.

This season will be Flemming’s 16th full-time in the Giants booth, working primarily on KNBR radio alongside Jon Miller. Flemming was the Giants’ only broadcaster whose contract was up after 2018, and he will continue to work alongside Miller, Mike Krukow and Duane Kuiper in their traditional roles.

Fans long have feared that Flemming, 42, would leave the Giants to work for ESPN or another national broadcaster because of high demand for his services. He already calls some Major League Baseball and college sports for ESPN, primarily in the baseball offseason.

Flemming acknowledged that he had such choices.

“Clearly, I had other options,” he said. “This time, because of my age and length of my career, maybe this was a year where I had to do some more serious thinking about that long-term stuff.”

In an interview with The Chronicle last February, Flemming said he felt a “gratification” doing local games that one cannot enjoy on a national level.

He also said he loves San Francisco, where he, wife Jessica and their three children reside.

“Hopefully,” he said Thursday, “for everybody who’s always asking me if I’m leaving, the fact that I want do more games should answer that question. I’m really excited. I didn’t want to be anywhere else.”

Flemming will continue to do some national work, rearranging that schedule to account for the extra Giants games he plans to broadcast starting in 2020.

Henry Schulman is a San Francisco Chronicle staff writer. Email: hschulman@sfchronicle.com Twitter: @hankschulman