The self-driving car's first priority should be to protect those inside it. Anything else is more complicated. I read an article a little while ago about this topic and it posed a question along the lines of "should a self-driving car do the thing that'll kill its own passengers, yet save a larger number of others around it?" Think about how difficult it would be for a self-driving car to estimate this. Even more importantly, how would two self-driving cars cooperate in the event of an inevitable accident? Would we allow them to directly talk to each other, or are they only allowed to interpret each others' trajectories?
I think the simplest directive is "save your own passengers". That is what human drivers currently do, and I believe in the long run this would be effective at saving the optimal number of lives. Besides, if choosing between a car with this directive and a car that's programmed to sacrifice you to save someone else, which would you buy?