msdk: don't share context between msdkvpp and msdkenc
authorHaihao Xiang <haihao.xiang@intel.com>
Mon, 24 Jun 2019 05:33:54 +0000 (13:33 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 30 Jun 2019 06:08:31 +0000 (06:08 +0000)
commit98e4967337198805afdff10ddeb34040f214bd71
treed5103b6d102327a84577c144b653b9f5989933ea
parentb756b13ee2541e9899536c0594475dee6026488a
msdk: don't share context between msdkvpp and msdkenc

msdkenc supports CSC implicitly, so it is possible that two VPP
processes are required when a pipeline contains msdkvpp and msdkenc.
Before this fix, msdkvpp and msdkenc may share the same context, hence
the same mfx session, which results in MFX_ERR_UNDEFINED_BEHAVIOR
in MSDK because a mfx session has at most one VPP process only

This fixes the broken pipelines below:

gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! msdkh264enc ! \
msdkh264dec ! msdkvpp ! video/x-raw,format=YUY2 ! fakesink

gst-launch-1.0 videotestsrc ! msdkvpp ! video/x-raw,format=YUY2 ! \
msdkh264enc ! fakesink
sys/msdk/gstmsdkenc.c
sys/msdk/gstmsdkvpp.c