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, 16 Nov 2012 15:50:30 +0000 (16:50 +0100)
commit275dec01caf146b1361ded13a0d1895f4bf556eb
tree5f19cd025022036b565eb1d2978d0239d759e8d4
parent37bf2adad9aab8a374ed1fe69446c182c7e88311
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