h264: fix activation order of picture and sequence parameters.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 26 Oct 2012 14:12:05 +0000 (16:12 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 26 Oct 2012 14:30:33 +0000 (16:30 +0200)
commite30a5182673c6b21b5d8ef223afa78cfd9405cd7
tree54db99750162be27a5bb5e7bd010b87420cb6398
parent015879cafe999e359881629705d2275f75d5c385
h264: fix activation order of picture and sequence parameters.

Delay ensure_context() until we actually need a VA context for allocating
new VA surfaces, and then GstVaapiPictures, but also when a real activation
of a new picture parameter set occurs, thus also implying an activation
of the related sequence parameter set.

The most important thing was to drop the global pps and sps pointers since
they may not have matched the currently activated picture parameter or
sequence parameter sets at the specified decode point.

Anoter positive side-effect is that this cleans up all occurrences of
decode_current_picture() to only keep those useful in decode_picture(),
before a new picture is allocated, or in decode_sequence_end() when
an end-of-stream or end-of-sequence condition occurred.
gst-libs/gst/vaapi/gstvaapidecoder_h264.c