Distributed media-aware scheduling for P2P streaming with network coding