Once you have a stream Format Context and its respective Codec, you can open it for decoding using the following code:
// The format context and codec, given - see Find a stream for how to get these
AVFormatContext *formatContext;
AVCodec* codec;
int streamIndex;
// Get the codec context
AVC...