Using the canonical JSJ splitting, we describe the outer automorphism group \Out(G) of a one-ended word hyperbolic group G. In particular, we discuss to what extent \Out(G) is virtually a direct product of mapping class groups and a free abelian group, and we determine for which groups \Out(G) is infinite. We also show that there are only finitely many conjugacy classes of torsion elements in \Out(G), for G any torsion-free hyperbolic group. More generally, let Γ be a finite graph of groups decomposition of an arbitrary group G such that edge groups Ge are rigid (i.e\. \Out(Ge) is finite). We describe the group of automorphisms of G preserving Γ, by comparing it to direct products of suitably defined mapping class groups of vertex groups.