2C: hearts and another. If both majors at least 5S and 4H 2D: spades and another. If both majors usually 5H and 4S, but could be 4-4
Over either of these, the next step says "I dont have 4M, but will happily play here if this is your longer suit"
i.e. on the hand given, I'd bid 2D, because if partner has 5H, they'll rebid 2H (and I pass), if they're 5S4H they'll bid 2S (even better) and with 4H5D they'll pass and we'll be in a good fit. (Ideally if you have 4H and longer clubs, it should be 5C that are very good or 6 of them)
With the South hand I would have bid 2D not 2C because:
If partner has 4S, we play in 2S, great If partner does not have 4S, they'll probably bid 2H and we play there in that 4-3 fit instead of the other one
However, if partner has 3S and 2H they may now choose to bid 2H and we play in a 4-2 fit, not 4-3
But lets look at the other option of bidding 2C rather than 2D:
If partner has 4H we play in 2H, great
However, if partner has 4S and 3H (as above) they'll bid 2H and we may play in 4-3 heart fit when we had a 5-2 (or better) diamond fit or even have to play in 3C when there is a 4-4 spade fit
I think this makes the case for bidding 2D when 4-4 majors, but I'd only ever do it NV vs. NV in the pass out seat...