I don't think the effect on his campaign is going to be what you think it is, partially because I think the speed at which marriage equality is happening in this country is fairly rapid and at this point inevitable, and partially because I have too much/little (depending on how you look at it) faith in him making decisions based on well-researched political expediency to think he would have done it without the okay of his political advisers. I'm sure this was carefully planned. He's coming down on the right side of history; I used to think I'd be lucky to be able to legally marry a woman in my lifetime, and now I feel relatively certain that I'll be able to in most states by the time I'm ready to get married in five or ten years or so.
That said, politically expedient or not, whether he'd be able to make a difference or not, I think NOT supporting same-sex marriage is failing to stand up for the side of right, and I have serious concerns about the moral integrity of a president who would throw the entire LGBT community under the bus for the sake of his own reelection campaign, or one who didn't believe I should be allowed to get married to whomever I want until yesterday.
Naturally I know perfectly well that expecting more of a president is unrealistic, but I figure that's no reason to lower my expectations.