summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2017-12-27 18:08:15 -0200
committerDaniel Bermond2017-12-27 19:02:23 -0200
commita5f1b7160edf1ff1e7c2da03cd6ada11488d3050 (patch)
treea7b3361aadaf1915a9f920780415c9015029c7df
parent6b32b2f07c2dc519844cc760414593b45cf11c82 (diff)
downloadaur-a5f1b7160edf1ff1e7c2da03cd6ada11488d3050.tar.gz
Change to the open source Intel MediaSDK
This is an important change. Package now uses the open source Intel MediaSDK from https://github.com/Intel-Media-SDK/MediaSDK/. If for some reason you want the binary and proprietary files provided by Intel, use the package intel-media-server-studio.
-rw-r--r--.SRCINFO42
-rwxr-xr-x[-rw-r--r--]PKGBUILD196
-rw-r--r--intel-media-sdk-add-runtime-libraries.patch24
-rw-r--r--intel-media-sdk-change-gcc-version.patch14
-rw-r--r--intel-media-sdk-compatibility-with-upstream-libva.patch239
-rw-r--r--intel-media-sdk-detect-intel-opencl.patch57
-rw-r--r--intel-media-sdk-gcc5-fix.patch1132
7 files changed, 1611 insertions, 93 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0a4db6ac3ace..ecbdf0e04529 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,37 @@
# Generated by mksrcinfo v8
-# Wed Dec 27 13:11:35 UTC 2017
+# Wed Dec 27 21:02:06 UTC 2017
pkgbase = intel-media-sdk
- pkgdesc = Intel Media SDK (only SDK files, no kernel patches, no system modifications)
- pkgver = 2017.R3
- pkgrel = 2
- url = https://software.intel.com/en-us/intel-media-server-studio/
+ pkgdesc = API to access hardware-accelerated video decode, encode and filtering on Intel platforms with integrated graphics
+ pkgver = 1.2a
+ pkgrel = 1
+ url = https://github.com/Intel-Media-SDK/MediaSDK/
+ arch = i686
arch = x86_64
- license = custom
- makedepends = poppler
- options = !strip
- options = staticlibs
- source = http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11800/MediaServerStudioEssentials2017R3.tar.gz
- sha256sums = 3037eabad6621c43e1b4ba3e85a06fafd7d494924e0c3b94fbaf3bc675852960
+ license = MIT
+ makedepends = perl
+ makedepends = cmake
+ makedepends = gcc5
+ depends = libva-git
+ depends = intel-media-driver-git
+ provides = libmfx
+ conflicts = intel-media-sdk-git
+ conflicts = libmfx
+ conflicts = libmfx-git
+ options = !emptydirs
+ source = intel-media-sdk-1.2a.tar.gz::https://github.com/Intel-Media-SDK/MediaSDK/archive/1.2a.tar.gz
+ source = intel-media-sdk-gcc5-fix.patch
+ source = intel-media-sdk-change-gcc-version.patch
+ source = intel-media-sdk-detect-intel-opencl.patch
+ source = intel-media-sdk-add-runtime-libraries.patch
+ source = intel-media-sdk-support-libva-v2.0-branch-next.patch::https://github.com/Intel-Media-SDK/MediaSDK/commit/934c36b9d0f01af04de23c35d63b5916ee7b3102.patch
+ source = intel-media-sdk-compatibility-with-upstream-libva.patch
+ sha256sums = 04b11524c9e25dba95524bdcb07bd02b6833277c03ab7c3b83acfec9f83ce8d5
+ sha256sums = e8687d509fcdefe0b9d01f12c7437425aa12791795046506fb13483dcca924ab
+ sha256sums = 1e87af43f125b37b1ed12f5fd9f87a0260fe05204d12ac29567eeb389284de31
+ sha256sums = 689ebc270532c0e1e5132d39898ff2a93fe3483a5a2673aea396a24fc07ad24c
+ sha256sums = a4e02e01fbb289503be58006a3ddfdf4a1e4a1e127bcb64c5b539b94c53700cf
+ sha256sums = 9899560bf50d999e830786d874ebb36d2b1c4a85c6dc978fa8716876873fdeb6
+ sha256sums = 7e565f73d7d998d2f580ffa1e9159c4285fe5826a8c446812fdb5ebe9393780f
pkgname = intel-media-sdk
diff --git a/PKGBUILD b/PKGBUILD
index 29a14f6c1e57..9b5d937a1a01 100644..100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,96 +1,128 @@
# Maintainer: Daniel Bermond < yahoo-com: danielbermond >
-# NOTE:
-# This package provides only the files for Intel Media SDK.
-# The proper installation requires a specific (older) Linux kernel version,
-# kernel patches and other system modifications. For the sake of the system
-# this package will not touch the kernel or system libraries. Only the SDK
-# files will be provided in '/opt'.
+_commit='934c36b9d0f01af04de23c35d63b5916ee7b3102'
-_year=2017
-_release=R3
-_sdkver=16.5.2
+_srcname=MediaSDK
pkgname=intel-media-sdk
-pkgver="${_year}.${_release}"
-pkgrel=2
-pkgdesc='Intel Media SDK (only SDK files, no kernel patches, no system modifications)'
-arch=('x86_64')
-url='https://software.intel.com/en-us/intel-media-server-studio/'
-license=('custom')
-makedepends=('poppler')
-options=('!strip' 'staticlibs')
-source=("http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11800/MediaServerStudioEssentials${_year}${_release}.tar.gz")
-sha256sums=('3037eabad6621c43e1b4ba3e85a06fafd7d494924e0c3b94fbaf3bc675852960')
+pkgver=1.2a
+pkgrel=1
+pkgdesc='API to access hardware-accelerated video decode, encode and filtering on Intel platforms with integrated graphics'
+arch=('i686' 'x86_64')
+url='https://github.com/Intel-Media-SDK/MediaSDK/'
+license=('MIT')
+depends=(
+ # AUR:
+ 'libva-git' 'intel-media-driver-git'
+)
+makedepends=(
+ # official repositories:
+ 'perl' 'cmake'
+ # AUR:
+ 'gcc5'
+)
+provides=('libmfx')
+conflicts=('intel-media-sdk-git' 'libmfx' 'libmfx-git')
+options=('!emptydirs')
+source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/Intel-Media-SDK/MediaSDK/archive/${pkgver}.tar.gz"
+ 'intel-media-sdk-gcc5-fix.patch'
+ 'intel-media-sdk-change-gcc-version.patch'
+ 'intel-media-sdk-detect-intel-opencl.patch'
+ 'intel-media-sdk-add-runtime-libraries.patch'
+ 'intel-media-sdk-support-libva-v2.0-branch-next.patch'::"https://github.com/Intel-Media-SDK/MediaSDK/commit/${_commit}.patch"
+ 'intel-media-sdk-compatibility-with-upstream-libva.patch')
+sha256sums=('04b11524c9e25dba95524bdcb07bd02b6833277c03ab7c3b83acfec9f83ce8d5'
+ 'e8687d509fcdefe0b9d01f12c7437425aa12791795046506fb13483dcca924ab'
+ '1e87af43f125b37b1ed12f5fd9f87a0260fe05204d12ac29567eeb389284de31'
+ '689ebc270532c0e1e5132d39898ff2a93fe3483a5a2673aea396a24fc07ad24c'
+ 'a4e02e01fbb289503be58006a3ddfdf4a1e4a1e127bcb64c5b539b94c53700cf'
+ '9899560bf50d999e830786d874ebb36d2b1c4a85c6dc978fa8716876873fdeb6'
+ '7e565f73d7d998d2f580ffa1e9159c4285fe5826a8c446812fdb5ebe9393780f')
prepare() {
- cd "MediaServerStudioEssentials${_year}${_release}"
- bsdtar -xf "SDK${_year}Production${_sdkver}.tar.gz"
-
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic"
- bsdtar -xf intel-linux-media_generic_"$_sdkver"-*_64bit.tar.gz
- bsdtar -xf intel-opencl-cpu-*.x86_64.tar.xz
- bsdtar -xf intel-opencl-devel-*.x86_64.tar.xz
- bsdtar -xf intel-opencl-r*.x86_64.tar.xz
+ cd "${_srcname}-${pkgver}"
+
+ # support upstream libva from 01org (currently needs libva-git)
+ patch -Np1 -i "${srcdir}/intel-media-sdk-support-libva-v2.0-branch-next.patch"
+ patch -Np1 -i "${srcdir}/intel-media-sdk-compatibility-with-upstream-libva.patch"
+
+ # build fixes
+ patch -Np1 -i "${srcdir}/intel-media-sdk-gcc5-fix.patch"
+ patch -Np1 -i "${srcdir}/intel-media-sdk-change-gcc-version.patch"
+ patch -Np1 -i "${srcdir}/intel-media-sdk-detect-intel-opencl.patch"
+ patch -Np1 -i "${srcdir}/intel-media-sdk-add-runtime-libraries.patch"
+}
+
+build() {
+ cd "${_srcname}-${pkgver}"
+
+ export MFX_HOME="$(pwd)"
+
+ export CFLAGS="$( printf '%s' "$CFLAGS" | sed 's/-fno-plt//')"
+ export CXXFLAGS="$(printf '%s' "$CXXFLAGS" | sed 's/-fno-plt//')"
+
+ perl tools/builder/build_mfx.pl \
+ --cmake='intel64.make.release' \
+ --prefix='/usr' \
+
+ make -C __cmake/intel64.make.release
}
package() {
- mkdir -p "$pkgdir"/etc/OpenCL
- mkdir -p "$pkgdir"/opt/intel/mediasdk/{doc,include/mfx,lib/lin_x64,lib64,plugins,tools}
- mkdir -p "$pkgdir"/usr/{include,lib}/"$pkgname"
-
- # copy SDK files
- cd "MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic/opt/intel/mediasdk"
- install -D -m644 doc/* "${pkgdir}/opt/intel/mediasdk/doc"
- install -D -m644 include/* "${pkgdir}/opt/intel/mediasdk/include/mfx"
- install -D -m777 lib/lin_x64/* "${pkgdir}/opt/intel/mediasdk/lib/lin_x64"
- install -D -m777 lib64/* "${pkgdir}/opt/intel/mediasdk/lib64"
- install -D -m777 plugins/*.so "${pkgdir}/opt/intel/mediasdk/plugins"
- install -D -m644 plugins/plugins.cfg "${pkgdir}/opt/intel/mediasdk/plugins/plugins.cfg"
- cp -af tools/* "${pkgdir}/opt/intel/mediasdk/tools"
-
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic/opt/intel/common"
- install -D -m777 mdf/lib64/* "${pkgdir}/opt/intel/mediasdk/lib64"
-
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic/usr"
- cp -af include/* "${pkgdir}/usr/include/${pkgname}"
- cp -af lib64/* "${pkgdir}/usr/lib/${pkgname}"
-
- cd "${pkgdir}/opt/intel/mediasdk/include/mfx"
- for _file in *
+ cd "${_srcname}-${pkgver}"
+
+ make \
+ -C __cmake/intel64.make.release \
+ DESTDIR="$pkgdir" \
+ install
+
+ [ "$CARCH" = 'x86_64' ] && _arch='x64' && _libarch='64'
+ [ "$CARCH" = 'i686' ] && _arch='x86' && _libarch='32'
+
+ mkdir -p "${pkgdir}/usr/"{include/mfx,lib/pkgconfig,share/"$pkgname"}
+
+ # remove unneeded directory '/usb/lib64' (or '/usr/lib32')
+ mv -f "${pkgdir}/usr/lib${_libarch}"/* "${pkgdir}/usr/lib"
+ rm -rf "${pkgdir}/usr/lib${_libarch}"
+
+ # move samples to a better place
+ mv -f "${pkgdir}/usr/samples" "${pkgdir}/usr/share/${pkgname}"
+
+ # bellow are fixes for building ffmpeg
+ # (use symlinks to preserve compatibility with binary-only Intel products)
+
+ # includes
+ cd "${pkgdir}/usr/include"
+ for _header in *.h
do
- cd ..
- ln -sf "mfx/${_file}" "$_file"
cd mfx
+ ln -sf ../"$_header" "$_header"
+ cd ..
+ done
+
+ # libraries
+ cd "${pkgdir}/usr/lib/lin_${_arch}"
+ for _lib in *.a
+ do
+ cd ..
+ ln -sf "lin_${_arch}/$_lib" "$_lib"
+ cd "lin_${_arch}"
+ done
+
+ # pkgconfig files
+ cd "${pkgdir}/usr/lib/lin_${_arch}/pkgconfig"
+ ln -sf mfx.pc libmfx.pc
+ cd "${pkgdir}/usr/lib/pkgconfig"
+ ln -sf ../"lin_${_arch}/pkgconfig/mfx.pc" mfx.pc
+ ln -sf ../"lin_${_arch}/pkgconfig/libmfx.pc" libmfx.pc
+
+ # plugins
+ cd "${pkgdir}/usr/plugins"
+ for _plugin in *
+ do
+ ln -sf ../plugins/"$_plugin" ../lib/"$_plugin"
done
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic/opt/intel"
- cp -af opencl "${pkgdir}/opt/intel"
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}/SDK${_year}Production${_sdkver}/Generic/etc/OpenCL"
- cp -af vendors "${pkgdir}/etc/OpenCL"
-
- # copy license files
- cd "${srcdir}/MediaServerStudioEssentials${_year}${_release}"
- pdftotext -layout 'Intel(R)_Media_Server_Studio_EULA.pdf'
- install -D -m644 'Intel(R)_Media_Server_Studio_EULA.txt' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -D -m644 'redist.txt' "${pkgdir}/usr/share/licenses/${pkgname}/redist.txt"
- mv "${pkgdir}/opt/intel/opencl/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-opencl"
- mv "${pkgdir}/opt/intel/opencl/NOTICES" "${pkgdir}/usr/share/licenses/${pkgname}/NOTICES-opencl"
-
- # create a pkgconfig file for libmfx
- local _mfxver_major="$(grep '#define MFX_VERSION_MAJOR' "${pkgdir}/opt/intel/mediasdk/include/mfx/mfxvideo.h" | awk '{ print $3 }')"
- local _mfxver_minor="$(grep '#define MFX_VERSION_MINOR' "${pkgdir}/opt/intel/mediasdk/include/mfx/mfxvideo.h" | awk '{ print $3 }')"
- local _mfxver="${_mfxver_major}.${_mfxver_minor}"
- mkdir -p "${pkgdir}/opt/intel/mediasdk/lib/pkgconfig"
- touch "${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- chmod 644 "${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'prefix=/opt/intel/mediasdk' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'exec_prefix=${prefix}' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'libdir=${prefix}/lib/lin_x64' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'includedir=${prefix}/include' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'Name: libmfx' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'Description: Intel Media SDK dispatcher library' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' "Version: ${_mfxver}" >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'Libs: -L${libdir} -lmfx -lva -lstdc++ -ldl -lva-drm -ldrm' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
- printf '%s\n' 'Cflags: -I${includedir} -I/usr/include/libdrm' >>"${pkgdir}/opt/intel/mediasdk/lib/pkgconfig/libmfx.pc"
+ # license
+ cd "${srcdir}/${_srcname}-${pkgver}"
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/intel-media-sdk-add-runtime-libraries.patch b/intel-media-sdk-add-runtime-libraries.patch
new file mode 100644
index 000000000000..6be9f15cc8e3
--- /dev/null
+++ b/intel-media-sdk-add-runtime-libraries.patch
@@ -0,0 +1,24 @@
+From d82d3760800881b62e7d8614cf477d4e3f35896c Mon Sep 17 00:00:00 2001
+From: Ruiling Song <ruiling.song@intel.com>
+Date: Thu, 7 Dec 2017 10:48:40 +0800
+Subject: [PATCH] Add runtime library that we depend on.
+
+so that MediaSDK users like FFmpeg can easily use pkg_config
+to detect MediaSDK and link against mfx correctly.
+
+Signed-off-by: Ruiling Song <ruiling.song@intel.com>
+---
+ api/opensource/mfx_dispatch/pkg-config.pc.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/api/opensource/mfx_dispatch/pkg-config.pc.cmake b/api/opensource/mfx_dispatch/pkg-config.pc.cmake
+index 73e2e9d..7996228 100644
+--- a/api/opensource/mfx_dispatch/pkg-config.pc.cmake
++++ b/api/opensource/mfx_dispatch/pkg-config.pc.cmake
+@@ -5,5 +5,5 @@ Version: @MFX_VERSION_MAJOR@.@MFX_VERSION_MINOR@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_PATH@
+ includedir=@CMAKE_INSTALL_PREFIX@/include
+-Libs: -L${libdir} -lmfx
++Libs: -L${libdir} -lmfx -lstdc++ -ldl
+ Cflags: -I${includedir}
diff --git a/intel-media-sdk-change-gcc-version.patch b/intel-media-sdk-change-gcc-version.patch
new file mode 100644
index 000000000000..62c08a4a741f
--- /dev/null
+++ b/intel-media-sdk-change-gcc-version.patch
@@ -0,0 +1,14 @@
+diff -Naurp a/tools/builder/build_mfx.pl b/tools/builder/build_mfx.pl
+--- a/tools/builder/build_mfx.pl 2017-12-26 01:43:24.000000000 -0200
++++ b/tools/builder/build_mfx.pl 2017-12-27 14:13:24.387394916 -0200
+@@ -33,8 +33,8 @@ my $run_build = 0;
+ my $clean = 0;
+ my $no_warn_as_error = 0;
+ my %build = (
+- 'cc' => '',
+- 'cxx' => '',
++ 'cc' => '/usr/bin/gcc-5',
++ 'cxx' => '/usr/bin/g++-5',
+ 'ipp' => '',
+ 'trace' => '',
+ 'prefix' => '',
diff --git a/intel-media-sdk-compatibility-with-upstream-libva.patch b/intel-media-sdk-compatibility-with-upstream-libva.patch
new file mode 100644
index 000000000000..237caf3f8199
--- /dev/null
+++ b/intel-media-sdk-compatibility-with-upstream-libva.patch
@@ -0,0 +1,239 @@
+From 1340575fffa39ba0ff1f58ed762f7d6fde672f9c Mon Sep 17 00:00:00 2001
+From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+Date: Tue, 21 Nov 2017 08:38:53 -0500
+Subject: [PATCH] Provide compatibility with upstream libva
+
+This change makes mediasdk compatible with the following libva:
+git clone https://github.com/01org/libva.git
+git reset --hard df544cd5a31e54d4cbd33a391795a8747ddaf789
+
+ commit df544cd5a31e54d4cbd33a391795a8747ddaf789
+ Author: U. Artie Eoff <ullysses.a.eoff@intel.com>
+ Date: Mon Nov 27 09:47:02 2017 -0800
+
+ Revert "configure: set strict default compiler flags"
+
+Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+---
+ _studio/mfx_lib/shared/src/mfx_h264_fei_vaapi.cpp | 30 +++++++++++-----------
+ _studio/shared/src/mfx_vpp_vaapi.cpp | 31 +++++++++++++++--------
+ 2 files changed, 35 insertions(+), 26 deletions(-)
+ mode change 100644 => 100755 _studio/shared/src/mfx_vpp_vaapi.cpp
+
+diff --git a/_studio/mfx_lib/shared/src/mfx_h264_fei_vaapi.cpp b/_studio/mfx_lib/shared/src/mfx_h264_fei_vaapi.cpp
+index 91edb71..c2b3fd1 100644
+--- a/_studio/mfx_lib/shared/src/mfx_h264_fei_vaapi.cpp
++++ b/_studio/mfx_lib/shared/src/mfx_h264_fei_vaapi.cpp
+@@ -328,7 +328,7 @@ mfxStatus VAAPIFEIPREENCEncoder::Execute(
+
+ mfxStatus mfxSts = MFX_ERR_NONE;
+ VAStatus vaSts;
+- VAPictureFEI past_ref, future_ref;
++ VAPictureStats past_ref, future_ref;
+ VASurfaceID *inputSurface = (VASurfaceID*) surface;
+
+ std::vector<VABufferID> configBuffers(MAX_CONFIG_BUFFERS_COUNT + m_slice.size() * 2);
+@@ -433,24 +433,24 @@ mfxStatus VAAPIFEIPREENCEncoder::Execute(
+ mfxSts = m_core->GetExternalFrameHDL(feiCtrl->RefFrame[0]->Data.MemId, &handle);
+ MFX_CHECK_STS(mfxSts);
+
+- VAPictureFEI* l0surfs = &past_ref;
++ VAPictureStats* l0surfs = &past_ref;
+ l0surfs->picture_id = *(VASurfaceID*)handle;
+
+ switch (feiCtrl->RefPictureType[0])
+ {
+ case MFX_PICTYPE_TOPFIELD:
+- l0surfs->flags = VA_PICTURE_FEI_TOP_FIELD;
++ l0surfs->flags = VA_PICTURE_STATS_TOP_FIELD;
+ break;
+ case MFX_PICTYPE_BOTTOMFIELD:
+- l0surfs->flags = VA_PICTURE_FEI_BOTTOM_FIELD;
++ l0surfs->flags = VA_PICTURE_STATS_BOTTOM_FIELD;
+ break;
+ case MFX_PICTYPE_FRAME:
+- l0surfs->flags = VA_PICTURE_FEI_PROGRESSIVE;
++ l0surfs->flags = VA_PICTURE_STATS_PROGRESSIVE;
+ break;
+ }
+
+ if (IsOn(feiCtrl->DownsampleReference[0]))
+- l0surfs->flags |= VA_PICTURE_FEI_CONTENT_UPDATED;
++ l0surfs->flags |= VA_PICTURE_STATS_CONTENT_UPDATED;
+
+ statParams.stats_params.past_references = l0surfs;
+ // statParams.stats_params.past_ref_stat_buf = IsOn(feiCtrl->DownsampleReference[0]) ? &m_statOutId[surfPastIndexInList] : NULL;
+@@ -468,24 +468,24 @@ mfxStatus VAAPIFEIPREENCEncoder::Execute(
+ mfxSts = m_core->GetExternalFrameHDL(feiCtrl->RefFrame[1]->Data.MemId, &handle);
+ MFX_CHECK_STS(mfxSts);
+
+- VAPictureFEI* l1surfs = &future_ref;
++ VAPictureStats* l1surfs = &future_ref;
+ l1surfs->picture_id = *(VASurfaceID*)handle;
+
+ switch (feiCtrl->RefPictureType[1])
+ {
+ case MFX_PICTYPE_TOPFIELD:
+- l1surfs->flags = VA_PICTURE_FEI_TOP_FIELD;
++ l1surfs->flags = VA_PICTURE_STATS_TOP_FIELD;
+ break;
+ case MFX_PICTYPE_BOTTOMFIELD:
+- l1surfs->flags = VA_PICTURE_FEI_BOTTOM_FIELD;
++ l1surfs->flags = VA_PICTURE_STATS_BOTTOM_FIELD;
+ break;
+ case MFX_PICTYPE_FRAME:
+- l1surfs->flags = VA_PICTURE_FEI_PROGRESSIVE;
++ l1surfs->flags = VA_PICTURE_STATS_PROGRESSIVE;
+ break;
+ }
+
+ if (IsOn(feiCtrl->DownsampleReference[1]))
+- l1surfs->flags |= VA_PICTURE_FEI_CONTENT_UPDATED;
++ l1surfs->flags |= VA_PICTURE_STATS_CONTENT_UPDATED;
+
+ statParams.stats_params.future_references = l1surfs;
+ // statParams.stats_params.future_ref_stat_buf = IsOn(feiCtrl->DownsampleReference[1]) ? &m_statOutId[surfFutureIndexInList] : NULL;
+@@ -535,20 +535,20 @@ mfxStatus VAAPIFEIPREENCEncoder::Execute(
+ switch (feiCtrl->PictureType)
+ {
+ case MFX_PICTYPE_TOPFIELD:
+- statParams.stats_params.input.flags = VA_PICTURE_FEI_TOP_FIELD;
++ statParams.stats_params.input.flags = VA_PICTURE_STATS_TOP_FIELD;
+ break;
+
+ case MFX_PICTYPE_BOTTOMFIELD:
+- statParams.stats_params.input.flags = VA_PICTURE_FEI_BOTTOM_FIELD;
++ statParams.stats_params.input.flags = VA_PICTURE_STATS_BOTTOM_FIELD;
+ break;
+
+ case MFX_PICTYPE_FRAME:
+- statParams.stats_params.input.flags = VA_PICTURE_FEI_PROGRESSIVE;
++ statParams.stats_params.input.flags = VA_PICTURE_STATS_PROGRESSIVE;
+ break;
+ }
+
+ if (!IsOff(feiCtrl->DownsampleInput) && (0 == feiFieldId))
+- statParams.stats_params.input.flags |= VA_PICTURE_FEI_CONTENT_UPDATED;
++ statParams.stats_params.input.flags |= VA_PICTURE_STATS_CONTENT_UPDATED;
+
+ /* Link output VA buffers */
+ statParams.stats_params.outputs = &outBuffers[0]; //bufIDs for outputs
+diff --git a/_studio/shared/src/mfx_vpp_vaapi.cpp b/_studio/shared/src/mfx_vpp_vaapi.cpp
+old mode 100644
+new mode 100755
+index 237f68c..5317ea8
+--- a/_studio/shared/src/mfx_vpp_vaapi.cpp
++++ b/_studio/shared/src/mfx_vpp_vaapi.cpp
+@@ -1016,18 +1016,17 @@ mfxStatus VAAPIVideoProcessing::Execute(mfxExecuteParams *pParams)
+ #define ENABLE_VPP_VIDEO_SIGNAL(X)
+ #endif
+
+-
+ mfxU32 refFourcc = pRefSurf->frameInfo.FourCC;
+ switch (refFourcc)
+ {
+ case MFX_FOURCC_RGB4:
+ m_pipelineParam[0].surface_color_standard = VAProcColorStandardNone;
+- ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].input_surface_flag = VA_SOURCE_RANGE_FULL);
++ ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].input_color_properties.color_range = VA_SOURCE_RANGE_FULL);
+ break;
+ case MFX_FOURCC_NV12:
+ default:
+ m_pipelineParam[0].surface_color_standard = VAProcColorStandardBT601;
+- ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].input_surface_flag = VA_SOURCE_RANGE_REDUCED);
++ ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].input_color_properties.color_range = VA_SOURCE_RANGE_REDUCED);
+ break;
+ }
+
+@@ -1036,15 +1035,18 @@ mfxStatus VAAPIVideoProcessing::Execute(mfxExecuteParams *pParams)
+ {
+ case MFX_FOURCC_RGB4:
+ m_pipelineParam[0].output_color_standard = VAProcColorStandardNone;
+- ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].output_surface_flag = VA_SOURCE_RANGE_FULL);
++ ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].output_color_properties.color_range = VA_SOURCE_RANGE_FULL);
+ break;
+ case MFX_FOURCC_NV12:
+ default:
+ m_pipelineParam[0].output_color_standard = VAProcColorStandardBT601;
+- ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].output_surface_flag = VA_SOURCE_RANGE_REDUCED);
++ ENABLE_VPP_VIDEO_SIGNAL(m_pipelineParam[0].output_color_properties.color_range = VA_SOURCE_RANGE_REDUCED);
+ break;
+ }
+
++ m_pipelineParam[0].input_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++ m_pipelineParam[0].output_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++
+ /* It needs interlaced flag passed only for
+ * deinterlacing and scaling. All other filters must
+ * use progressive even for interlaced content.
+@@ -1098,7 +1100,7 @@ mfxStatus VAAPIVideoProcessing::Execute(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfo[index].NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[0].input_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[index].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[0].input_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[index].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ }
+
+@@ -1111,13 +1113,16 @@ mfxStatus VAAPIVideoProcessing::Execute(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfoOut.NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[0].output_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[0].output_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ #else
+ return MFX_ERR_UNSUPPORTED;
+ #endif // #ifdef MFX_ENABLE_VPP_VIDEO_SIGNAL
+ }
+
++ m_pipelineParam[0].input_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++ m_pipelineParam[0].output_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++
+ /* Scaling params */
+ switch (pParams->scalingMode)
+ {
+@@ -1835,7 +1840,7 @@ mfxStatus VAAPIVideoProcessing::Execute_Composition(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfo[refIdx-1].NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[refIdx].input_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[refIdx-1].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[refIdx].input_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[refIdx-1].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ }
+
+@@ -1848,9 +1853,11 @@ mfxStatus VAAPIVideoProcessing::Execute_Composition(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfoOut.NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[refIdx].output_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[refIdx].output_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ }
++ m_pipelineParam[refIdx].input_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++ m_pipelineParam[refIdx].output_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
+
+ switch (pRefSurf->frameInfo.PicStruct)
+ {
+@@ -1996,7 +2003,7 @@ mfxStatus VAAPIVideoProcessing::Execute_Composition(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfo[refIdx-1].NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[refIdx].input_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[refIdx-1].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[refIdx].input_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfo[refIdx-1].NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ }
+
+@@ -2009,9 +2016,11 @@ mfxStatus VAAPIVideoProcessing::Execute_Composition(mfxExecuteParams *pParams)
+
+ if(pParams->VideoSignalInfoOut.NominalRange != MFX_NOMINALRANGE_UNKNOWN)
+ {
+- m_pipelineParam[refIdx].output_surface_flag = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
++ m_pipelineParam[refIdx].output_color_properties.color_range = (MFX_NOMINALRANGE_0_255 == pParams->VideoSignalInfoOut.NominalRange) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
+ }
+ }
++ m_pipelineParam[refIdx].input_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
++ m_pipelineParam[refIdx].output_color_properties.chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
+
+ /* to process input parameters of sub stream:
+ * crop info and original size*/
diff --git a/intel-media-sdk-detect-intel-opencl.patch b/intel-media-sdk-detect-intel-opencl.patch
new file mode 100644
index 000000000000..0a27405971a5
--- /dev/null
+++ b/intel-media-sdk-detect-intel-opencl.patch
@@ -0,0 +1,57 @@
+From f16a0707bf8db4d9078af3b1f0f50f9d64532911 Mon Sep 17 00:00:00 2001
+From: Ruiling Song <ruiling.song@intel.com>
+Date: Tue, 5 Dec 2017 14:31:00 +0800
+Subject: [PATCH] Detect Intel OpenCL SDK exactly.
+
+the rotate_opencl sample tries to access "CL/va_ext.h".
+which is Intel OpenCL SDK specific extension.
+So let's try to only build the sample if user has installed
+Intel OpenCL SDK.
+
+v2:
+slight update the cmake to move make_library under INTEL_OPENCL_SDK.
+
+Signed-off-by: Ruiling Song <ruiling.song@intel.com>
+---
+ builder/FindOpenCL.cmake | 8 ++++++++
+ samples/sample_plugins/rotate_opencl/CMakeLists.txt | 6 +++---
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/builder/FindOpenCL.cmake b/builder/FindOpenCL.cmake
+index f763155..7fcd552 100644
+--- a/builder/FindOpenCL.cmake
++++ b/builder/FindOpenCL.cmake
+@@ -23,6 +23,14 @@ find_library( OPENCL_LIBRARY libOpenCL.so PATHS /usr/lib /opt/intel/opencl/)
+
+ set( OCL_LIBS "" )
+
++if ( EXISTS /etc/OpenCL/vendors/intel.icd )
++ message( STATUS "Intel OpenCL SDK found")
++ set ( INTEL_OPENCL_SDK TRUE )
++else ()
++ message( STATUS "Intel OpenCL SDK not found")
++ set ( INTEL_OPENCL_SDK FALSE )
++endif()
++
+ if ( NOT OPENCL_INCLUDE MATCHES NOTFOUND )
+ if ( NOT OPENCL_LIBRARY MATCHES NOTFOUND )
+ set ( OPENCL_FOUND TRUE )
+diff --git a/samples/sample_plugins/rotate_opencl/CMakeLists.txt b/samples/sample_plugins/rotate_opencl/CMakeLists.txt
+index d06400c..1818c87 100644
+--- a/samples/sample_plugins/rotate_opencl/CMakeLists.txt
++++ b/samples/sample_plugins/rotate_opencl/CMakeLists.txt
+@@ -17,11 +17,11 @@ list( APPEND LIBS_VARIANT sample_common )
+ list(APPEND sources.plus "${PLUGINS_COMMON_PATH}/mfx_plugin_module.cpp")
+
+ set(DEPENDENCIES opencl libva libmfx dl)
+-make_library( sample_plugin_opencl none shared "nosafestring" )
+
+-install( TARGETS ${target} LIBRARY DESTINATION ${MFX_SAMPLES_INSTALL_LIB_DIR} )
++if ( INTEL_OPENCL_SDK )
++ make_library( sample_plugin_opencl none shared "nosafestring" )
+
+-if ( DEFINED OPENCL_FOUND )
++ install( TARGETS ${target} LIBRARY DESTINATION ${MFX_SAMPLES_INSTALL_LIB_DIR} )
+ # copy .cl file into build directory
+ execute_process( COMMAND ${CMAKE_COMMAND} -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/ocl_rotate.cl"
diff --git a/intel-media-sdk-gcc5-fix.patch b/intel-media-sdk-gcc5-fix.patch
new file mode 100644
index 000000000000..3984cee81d39
--- /dev/null
+++ b/intel-media-sdk-gcc5-fix.patch
@@ -0,0 +1,1132 @@
+From 2d8fe1c38b3ca3f46afdf55d31b48af292194aff Mon Sep 17 00:00:00 2001
+From: Ruiling Song <ruiling.song@intel.com>
+Date: Tue, 5 Dec 2017 14:35:59 +0800
+Subject: [PATCH] Fix build against gcc 5.4 (ubuntu 16.04).
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+mainly fix below compile errors:
+- auto_ptr is deprecated.
+- invalid suffix on literal; C++11 requires a space between literal and
+ string macro [-Werror=literal-suffix]
+- call of overloaded ‘unique_ptr(int)’ is ambiguous
+
+Signed-off-by: Ruiling Song <ruiling.song@intel.com>
+---
+ _studio/hevce_hw/h265/include/mfx_h265_encode_hw.h | 2 +-
+ .../hevce_hw/h265/src/mfx_h265_encode_hw_ddi.cpp | 2 +-
+ .../decode/h265/include/mfx_h265_dec_decode.h | 4 +--
+ .../decode/mpeg2/include/mfx_mpeg2_decode.h | 4 +--
+ .../mfx_lib/decode/vc1/include/mfx_vc1_decode.h | 4 +--
+ _studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp | 2 +-
+ .../decode/vp8/include/mfx_vp8_dec_decode_hw.h | 2 +-
+ .../encode_hw/mjpeg/include/mfx_mjpeg_encode_hw.h | 2 +-
+ .../mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | 2 +-
+ _studio/mfx_lib/fei/h264_la/mfx_h264_la.h | 2 +-
+ _studio/mfx_lib/fei/h264_pak/mfx_h264_fei_pak.h | 2 +-
+ _studio/mfx_lib/fei/h264_preenc/mfx_h264_preenc.h | 2 +-
+ _studio/mfx_lib/plugin/include/mfx_h264la_plugin.h | 2 +-
+ .../mfx_lib/plugin/include/mfx_hevc_dec_plugin.h | 2 +-
+ .../mfx_lib/plugin/include/mfx_hevc_enc_plugin.h | 2 +-
+ .../mfx_lib/plugin/include/mfx_vp8_dec_plugin.h | 2 +-
+ _studio/mfx_lib/plugin/include/mfx_vpp_plugin.h | 2 +-
+ _studio/mfx_lib/shared/include/mfx_brc_common.h | 2 +-
+ .../mfx_lib/shared/src/mfx_mpeg2_enc_common_hw.cpp | 2 +-
+ _studio/mfx_lib/vpp/include/mfx_vpp_hw.h | 2 +-
+ _studio/mfx_lib/vpp/include/mfx_vpp_sw.h | 2 +-
+ _studio/shared/include/mfx_vpp_interface.h | 4 +--
+ .../codec/h264_dec/include/umc_h264_au_splitter.h | 2 +-
+ .../include/umc_h264_segment_decoder_dxva.h | 2 +-
+ .../h264_dec/include/umc_h264_task_supplier.h | 7 ++--
+ .../codec/h264_dec/src/umc_h264_task_supplier.cpp | 14 ++++++++
+ .../jpeg_dec/include/umc_mjpeg_mfx_decode_base.h | 2 +-
+ api/opensource/mfx_dispatch/CMakeLists.txt | 2 +-
+ .../mfx_dispatch/include/mfx_dispatcher_log.h | 2 +-
+ api/opensource/mfx_dispatch/src/main.cpp | 18 +++++-----
+ .../mfx_dispatch/src/mfx_load_plugin.cpp | 6 ++--
+ .../mfx_dispatch/src/mfx_plugin_hive_linux.cpp | 4 +--
+ contrib/SafeStringStaticLibrary/CMakeLists.txt | 2 +-
+ samples/sample_common/include/avc_spl.h | 4 +--
+ samples/sample_common/include/base_allocator.h | 2 +-
+ samples/sample_common/include/brc_routines.h | 2 +-
+ samples/sample_common/include/general_allocator.h | 4 +--
+ samples/sample_common/include/plugin_loader.h | 6 ++--
+ samples/sample_common/include/sample_utils.h | 4 +--
+ samples/sample_decode/include/pipeline_decode.h | 6 ++--
+ samples/sample_decode/src/pipeline_decode.cpp | 2 +-
+ samples/sample_encode/include/pipeline_encode.h | 4 +--
+ samples/sample_encode/src/pipeline_encode.cpp | 4 +--
+ samples/sample_encode/src/sample_encode.cpp | 2 +-
+ samples/sample_fei/src/sample_fei.cpp | 2 +-
+ .../include/pipeline_transcode.h | 38 +++++++++++-----------
+ .../include/sample_multi_transcode.h | 4 +--
+ .../src/pipeline_transcode.cpp | 14 ++++----
+ .../src/sample_multi_transcode.cpp | 8 ++---
+ .../rotate_opencl/include/d3d_utils.h | 2 +-
+ .../rotate_opencl/include/sample_opencl_plugin.h | 4 +--
+ .../vpp_plugin/include/mfx_vpp_plugin.h | 2 +-
+ samples/sample_vpp/include/sample_vpp_pts.h | 2 +-
+ samples/sample_vpp/include/sample_vpp_utils.h | 4 +--
+ samples/sample_vpp/src/sample_vpp.cpp | 2 +-
+ samples/sample_vpp/src/sample_vpp_pts.cpp | 4 +--
+ 56 files changed, 128 insertions(+), 111 deletions(-)
+
+diff --git a/_studio/hevce_hw/h265/include/mfx_h265_encode_hw.h b/_studio/hevce_hw/h265/include/mfx_h265_encode_hw.h
+index 1a1ddb8..c997b78 100644
+--- a/_studio/hevce_hw/h265/include/mfx_h265_encode_hw.h
++++ b/_studio/hevce_hw/h265/include/mfx_h265_encode_hw.h
+@@ -140,7 +140,7 @@ class Plugin : public MFXEncoderPlugin
+ mfxStatus FreeTask(Task& task);
+ mfxStatus WaitForQueringTask(Task& task);
+
+- std::auto_ptr<DriverEncoder> m_ddi;
++ std::unique_ptr<DriverEncoder> m_ddi;
+ MFXCoreInterface m_core;
+
+ MfxVideoParam m_vpar;
+diff --git a/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_ddi.cpp b/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_ddi.cpp
+index b864ed4..4774870 100644
+--- a/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_ddi.cpp
++++ b/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_ddi.cpp
+@@ -76,7 +76,7 @@ mfxStatus HardcodeCaps(ENCODE_CAPS_HEVC& caps, MFXCoreInterface* core)
+
+ mfxStatus QueryHwCaps(MFXCoreInterface* core, GUID guid, ENCODE_CAPS_HEVC & caps)
+ {
+- std::auto_ptr<DriverEncoder> ddi;
++ std::unique_ptr<DriverEncoder> ddi;
+
+ ddi.reset(CreatePlatformH265Encoder(core));
+ MFX_CHECK(ddi.get(), MFX_ERR_UNSUPPORTED);
+diff --git a/_studio/mfx_lib/decode/h265/include/mfx_h265_dec_decode.h b/_studio/mfx_lib/decode/h265/include/mfx_h265_dec_decode.h
+index 5edfec7..4a1f620 100644
+--- a/_studio/mfx_lib/decode/h265/include/mfx_h265_dec_decode.h
++++ b/_studio/mfx_lib/decode/h265/include/mfx_h265_dec_decode.h
+@@ -126,10 +126,10 @@ class VideoDECODEH265 : public VideoDECODE
+ // Get original Surface corresponding to OpaqueSurface
+ mfxFrameSurface1 * GetOriginalSurface(mfxFrameSurface1 *surface);
+
+- std::auto_ptr<MFXTaskSupplier_H265> m_pH265VideoDecoder;
++ std::unique_ptr<MFXTaskSupplier_H265> m_pH265VideoDecoder;
+ mfx_UMC_MemAllocator m_MemoryAllocator;
+
+- std::auto_ptr<mfx_UMC_FrameAllocator> m_FrameAllocator;
++ std::unique_ptr<mfx_UMC_FrameAllocator> m_FrameAllocator;
+
+ mfxVideoParamWrapper m_vInitPar;
+ mfxVideoParamWrapper m_vFirstPar;
+diff --git a/_studio/mfx_lib/decode/mpeg2/include/mfx_mpeg2_decode.h b/_studio/mfx_lib/decode/mpeg2/include/mfx_mpeg2_decode.h
+index e9156b8..20ab733 100644
+--- a/_studio/mfx_lib/decode/mpeg2/include/mfx_mpeg2_decode.h
++++ b/_studio/mfx_lib/decode/mpeg2/include/mfx_mpeg2_decode.h
+@@ -175,7 +175,7 @@ class VideoDECODEMPEG2InternalBase : public MfxCriticalErrorHandler
+ int32_t m_InitH;
+ int32_t m_InitPicStruct;
+
+- std::auto_ptr<UMC::MPEG2VideoDecoderBase> m_implUmc;
++ std::unique_ptr<UMC::MPEG2VideoDecoderBase> m_implUmc;
+
+ bool m_isSWBuf;
+ bool m_isOpaqueMemory;
+@@ -301,7 +301,7 @@ class VideoDECODEMPEG2 : public VideoDECODE
+ {
+
+ public:
+- std::auto_ptr<VideoDECODEMPEG2InternalBase> internalImpl;
++ std::unique_ptr<VideoDECODEMPEG2InternalBase> internalImpl;
+
+ static mfxStatus Query(VideoCORE *core, mfxVideoParam *in, mfxVideoParam *out);
+ static mfxStatus QueryIOSurf(VideoCORE *core, mfxVideoParam *par, mfxFrameAllocRequest *request);
+diff --git a/_studio/mfx_lib/decode/vc1/include/mfx_vc1_decode.h b/_studio/mfx_lib/decode/vc1/include/mfx_vc1_decode.h
+index 713a11b..e8fa166 100644
+--- a/_studio/mfx_lib/decode/vc1/include/mfx_vc1_decode.h
++++ b/_studio/mfx_lib/decode/vc1/include/mfx_vc1_decode.h
+@@ -173,8 +173,8 @@ class MFXVideoDECODEVC1 : public VideoDECODE, public MfxCriticalErrorHandler
+
+ mfx_UMC_MemAllocator m_MemoryAllocator;
+ // TBD
+- std::auto_ptr<mfx_UMC_FrameAllocator> m_pFrameAlloc;
+- std::auto_ptr<UMC::VC1VideoDecoder> m_pVC1VideoDecoder;
++ std::unique_ptr<mfx_UMC_FrameAllocator> m_pFrameAlloc;
++ std::unique_ptr<UMC::VC1VideoDecoder> m_pVC1VideoDecoder;
+
+ UMC::vc1_frame_constructor* m_frame_constructor;
+ uint8_t* m_pReadBuffer;
+diff --git a/_studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp b/_studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp
+index 83319b9..5e75263 100644
+--- a/_studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp
++++ b/_studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp
+@@ -79,7 +79,7 @@ void MFXVideoDECODEVC1::FillVideoSignalInfo(mfxExtVideoSignalInfo *pVideoSignal)
+ MFXVideoDECODEVC1::MFXVideoDECODEVC1(VideoCORE *core, mfxStatus* mfxSts):VideoDECODE(),
+ m_VideoParams(NULL),
+ m_pInternMediaDataIn(NULL),
+-m_pVC1VideoDecoder(NULL),
++m_pVC1VideoDecoder(nullptr),
+ m_frame_constructor(NULL),
+ m_RBufID((UMC::MemID)-1),
+ m_BufSize(1024*1024),
+diff --git a/_studio/mfx_lib/decode/vp8/include/mfx_vp8_dec_decode_hw.h b/_studio/mfx_lib/decode/vp8/include/mfx_vp8_dec_decode_hw.h
+index 33a1949..e09a401 100644
+--- a/_studio/mfx_lib/decode/vp8/include/mfx_vp8_dec_decode_hw.h
++++ b/_studio/mfx_lib/decode/vp8/include/mfx_vp8_dec_decode_hw.h
+@@ -268,7 +268,7 @@ class VideoDECODEVP8_HW : public VideoDECODE, public MfxCriticalErrorHandler
+ mfxDecodeStat m_stat;
+ mfxFrameAllocRequest m_request;
+
+- std::auto_ptr<mfx_UMC_FrameAllocator> m_p_frame_allocator;
++ std::unique_ptr<mfx_UMC_FrameAllocator> m_p_frame_allocator;
+ UMC::VideoAccelerator *m_p_video_accelerator;
+
+ };
+diff --git a/_studio/mfx_lib/encode_hw/mjpeg/include/mfx_mjpeg_encode_hw.h b/_studio/mfx_lib/encode_hw/mjpeg/include/mfx_mjpeg_encode_hw.h
+index 1f91d49..5c4c90e 100644
+--- a/_studio/mfx_lib/encode_hw/mjpeg/include/mfx_mjpeg_encode_hw.h
++++ b/_studio/mfx_lib/encode_hw/mjpeg/include/mfx_mjpeg_encode_hw.h
+@@ -129,7 +129,7 @@ class MFXVideoENCODEMJPEG_HW : public VideoENCODE {
+ VideoCORE* m_pCore;
+ mfxVideoParam m_vFirstParam;
+ mfxVideoParam m_vParam;
+- std::auto_ptr<DriverEncoder> m_ddi;
++ std::unique_ptr<DriverEncoder> m_ddi;
+
+ bool m_bInitialized;
+ bool m_deviceFailed;
+diff --git a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
+index 6fb137d..af140df 100644
+--- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
++++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
+@@ -43,7 +43,7 @@ mfxStatus MfxHwMJpegEncode::QueryHwCaps(VideoCORE * core, JpegEncCaps & hwCaps)
+ if (core && core->GetVAType() == MFX_HW_VAAPI && core->GetHWType() < MFX_HW_CHT)
+ return MFX_ERR_UNSUPPORTED;
+
+- std::auto_ptr<DriverEncoder> ddi;
++ std::unique_ptr<DriverEncoder> ddi;
+ ddi.reset( CreatePlatformMJpegEncoder(core) );
+ if (ddi.get() == 0)
+ return MFX_ERR_NULL_PTR;
+diff --git a/_studio/mfx_lib/fei/h264_la/mfx_h264_la.h b/_studio/mfx_lib/fei/h264_la/mfx_h264_la.h
+index b97d5fc..ca3bfa6 100644
+--- a/_studio/mfx_lib/fei/h264_la/mfx_h264_la.h
++++ b/_studio/mfx_lib/fei/h264_la/mfx_h264_la.h
+@@ -299,7 +299,7 @@ class VideoENC_LA: public VideoENC_Ext
+ private:
+
+ MfxHwH264Encode::CmDevicePtr m_cmDevice;
+- std::auto_ptr<MfxEncLA::CmContextLA> m_cmCtx;
++ std::unique_ptr<MfxEncLA::CmContextLA> m_cmCtx;
+ MfxHwH264Encode::MfxVideoParam m_video;
+ std::vector<MfxHwH264Encode::VmeData> m_vmeDataStorage;
+
+diff --git a/_studio/mfx_lib/fei/h264_pak/mfx_h264_fei_pak.h b/_studio/mfx_lib/fei/h264_pak/mfx_h264_fei_pak.h
+index 3e93c31..5378fd1 100644
+--- a/_studio/mfx_lib/fei/h264_pak/mfx_h264_fei_pak.h
++++ b/_studio/mfx_lib/fei/h264_pak/mfx_h264_fei_pak.h
+@@ -89,7 +89,7 @@ class VideoPAK_PAK: public VideoPAK_Ext
+ VideoCORE* m_core;
+
+
+- std::auto_ptr<MfxHwH264Encode::DriverEncoder> m_ddi;
++ std::unique_ptr<MfxHwH264Encode::DriverEncoder> m_ddi;
+ std::vector<mfxU32> m_recFrameOrder; // !!! HACK !!!
+ ENCODE_CAPS m_caps;
+
+diff --git a/_studio/mfx_lib/fei/h264_preenc/mfx_h264_preenc.h b/_studio/mfx_lib/fei/h264_preenc/mfx_h264_preenc.h
+index a168da3..be7f175 100644
+--- a/_studio/mfx_lib/fei/h264_preenc/mfx_h264_preenc.h
++++ b/_studio/mfx_lib/fei/h264_preenc/mfx_h264_preenc.h
+@@ -72,7 +72,7 @@ class VideoENC_PREENC: public VideoENC_Ext
+
+ std::list <mfxFrameSurface1*> m_SurfacesForOutput;
+
+- std::auto_ptr<MfxHwH264Encode::DriverEncoder> m_ddi;
++ std::unique_ptr<MfxHwH264Encode::DriverEncoder> m_ddi;
+ ENCODE_CAPS m_caps;
+
+ MfxHwH264Encode::MfxVideoParam m_video;
+diff --git a/_studio/mfx_lib/plugin/include/mfx_h264la_plugin.h b/_studio/mfx_lib/plugin/include/mfx_h264la_plugin.h
+index a5fb4ec..272c1ce 100644
+--- a/_studio/mfx_lib/plugin/include/mfx_h264la_plugin.h
++++ b/_studio/mfx_lib/plugin/include/mfx_h264la_plugin.h
+@@ -122,7 +122,7 @@ class MFXH264LAPlugin : public MFXEncPlugin
+ mfxSession m_session;
+ mfxPluginParam m_PluginParam;
+ bool m_createdByDispatcher;
+- std::auto_ptr<MFXPluginAdapter<MFXEncPlugin> > m_adapter;
++ std::unique_ptr<MFXPluginAdapter<MFXEncPlugin> > m_adapter;
+ };
+ #endif //#if defined( AS_H264LA_PLUGIN )
+
+diff --git a/_studio/mfx_lib/plugin/include/mfx_hevc_dec_plugin.h b/_studio/mfx_lib/plugin/include/mfx_hevc_dec_plugin.h
+index 69be43f..d728547 100644
+--- a/_studio/mfx_lib/plugin/include/mfx_hevc_dec_plugin.h
++++ b/_studio/mfx_lib/plugin/include/mfx_hevc_dec_plugin.h
+@@ -139,7 +139,7 @@ class MFXHEVCDecoderPlugin : public MFXDecoderPlugin
+ mfxSession m_session;
+ mfxPluginParam m_PluginParam;
+ bool m_createdByDispatcher;
+- std::auto_ptr<MFXPluginAdapter<MFXDecoderPlugin> > m_adapter;
++ std::unique_ptr<MFXPluginAdapter<MFXDecoderPlugin> > m_adapter;
+ };
+ #endif //#if defined( AS_HEVCD_PLUGIN )
+
+diff --git a/_studio/mfx_lib/plugin/include/mfx_hevc_enc_plugin.h b/_studio/mfx_lib/plugin/include/mfx_hevc_enc_plugin.h
+index f9963e8..1cf0869 100644
+--- a/_studio/mfx_lib/plugin/include/mfx_hevc_enc_plugin.h
++++ b/_studio/mfx_lib/plugin/include/mfx_hevc_enc_plugin.h
+@@ -154,7 +154,7 @@ class MFXHEVCEncoderPlugin : public MFXEncoderPlugin
+
+ mfxPluginParam m_PluginParam;
+ bool m_createdByDispatcher;
+- std::auto_ptr<MFXPluginAdapter<MFXEncoderPlugin> > m_adapter;
++ std::unique_ptr<MFXPluginAdapter<MFXEncoderPlugin> > m_adapter;
+ };
+ #endif //#if defined( AS_HEVCE_PLUGIN )
+
+diff --git a/_studio/mfx_lib/plugin/include/mfx_vp8_dec_plugin.h b/_studio/mfx_lib/plugin/include/mfx_vp8_dec_plugin.h
+index ec8b888..c53d8a1 100644
+--- a/_studio/mfx_lib/plugin/include/mfx_vp8_dec_plugin.h
++++ b/_studio/mfx_lib/plugin/include/mfx_vp8_dec_plugin.h
+@@ -140,7 +140,7 @@ class MFXVP8DecoderPlugin : public MFXDecoderPlugin
+ mfxSession m_session;
+ mfxPluginParam m_PluginParam;
+ bool m_createdByDispatcher;
+- std::auto_ptr<MFXPluginAdapter<MFXDecoderPlugin> > m_adapter;
++ std::unique_ptr<MFXPluginAdapter<MFXDecoderPlugin> > m_adapter;
+ };
+ #endif //#if defined( AS_VP8D_PLUGIN )
+
+diff --git a/_studio/mfx_lib/plugin/include/mfx_vpp_plugin.h b/_studio/mfx_lib/plugin/include/mfx_vpp_plugin.h
+index 36b50a3..c49082f 100644
+--- a/_studio/mfx_lib/plugin/include/mfx_vpp_plugin.h
++++ b/_studio/mfx_lib/plugin/include/mfx_vpp_plugin.h
+@@ -124,7 +124,7 @@ class MFXVPP_Plugin : public MFXVPPPlugin
+ mfxSession m_session;
+ mfxPluginParam m_PluginParam;
+ bool m_createdByDispatcher;
+- std::auto_ptr<MFXPluginAdapter<MFXVPPPlugin> > m_adapter;
++ std::unique_ptr<MFXPluginAdapter<MFXVPPPlugin> > m_adapter;
+ };
+ #endif //#if defined( AS_VPP_PLUGIN )
+
+diff --git a/_studio/mfx_lib/shared/include/mfx_brc_common.h b/_studio/mfx_lib/shared/include/mfx_brc_common.h
+index e17934b..87a5c55 100644
+--- a/_studio/mfx_lib/shared/include/mfx_brc_common.h
++++ b/_studio/mfx_lib/shared/include/mfx_brc_common.h
+@@ -324,7 +324,7 @@ class ExtBRC
+ cHRD m_hrd;
+ bool m_bInit;
+ BRC_Ctx m_ctx;
+- std::auto_ptr<AVGBitrate> m_avg;
++ std::unique_ptr<AVGBitrate> m_avg;
+
+ public:
+ ExtBRC():
+diff --git a/_studio/mfx_lib/shared/src/mfx_mpeg2_enc_common_hw.cpp b/_studio/mfx_lib/shared/src/mfx_mpeg2_enc_common_hw.cpp
+index a81d124..0e1f164 100644
+--- a/_studio/mfx_lib/shared/src/mfx_mpeg2_enc_common_hw.cpp
++++ b/_studio/mfx_lib/shared/src/mfx_mpeg2_enc_common_hw.cpp
+@@ -58,7 +58,7 @@ mfxStatus MfxHwMpeg2Encode::QueryHwCaps(VideoCORE* pCore, ENCODE_CAPS & hwCaps)
+ return MFX_ERR_NONE;
+ }
+
+- std::auto_ptr<DriverEncoder> ddi;
++ std::unique_ptr<DriverEncoder> ddi;
+
+ ddi.reset( CreatePlatformMpeg2Encoder(pCore) );
+ if(ddi.get() == NULL)
+diff --git a/_studio/mfx_lib/vpp/include/mfx_vpp_hw.h b/_studio/mfx_lib/vpp/include/mfx_vpp_hw.h
+index 3fee17c..05860c8 100644
+--- a/_studio/mfx_lib/vpp/include/mfx_vpp_hw.h
++++ b/_studio/mfx_lib/vpp/include/mfx_vpp_hw.h
+@@ -834,7 +834,7 @@ namespace MfxHwVideoProcessing
+ mfxU32 m_frame_num;
+ mfxStatus m_critical_error;
+
+- // Not an auto_ptr anymore since core owns create/delete semantic now.
++ // Not an unique_ptr anymore since core owns create/delete semantic now.
+ VPPHWResMng * m_ddi;
+ bool m_bMultiView;
+
+diff --git a/_studio/mfx_lib/vpp/include/mfx_vpp_sw.h b/_studio/mfx_lib/vpp/include/mfx_vpp_sw.h
+index 1909cd7..6ae4d23 100644
+--- a/_studio/mfx_lib/vpp/include/mfx_vpp_sw.h
++++ b/_studio/mfx_lib/vpp/include/mfx_vpp_sw.h
+@@ -119,7 +119,7 @@ class VideoVPPBase
+ //
+ // HW VPP Support
+ //
+- std::auto_ptr<MfxHwVideoProcessing::VideoVPPHW> m_pHWVPP;
++ std::unique_ptr<MfxHwVideoProcessing::VideoVPPHW> m_pHWVPP;
+ };
+
+ class VideoVPP_HW : public VideoVPPBase
+diff --git a/_studio/shared/include/mfx_vpp_interface.h b/_studio/shared/include/mfx_vpp_interface.h
+index 97312e5..e93b734 100755
+--- a/_studio/shared/include/mfx_vpp_interface.h
++++ b/_studio/shared/include/mfx_vpp_interface.h
+@@ -393,7 +393,7 @@ namespace MfxHwVideoProcessing
+ class VPPHWResMng
+ {
+ public:
+- VPPHWResMng(): m_ddi(0), m_caps() {};
++ VPPHWResMng(): m_ddi(nullptr), m_caps() {};
+
+ ~VPPHWResMng() { Close(); };
+
+@@ -433,7 +433,7 @@ class VPPHWResMng
+ VPPHWResMng(const VPPHWResMng &);
+ VPPHWResMng &operator=(const VPPHWResMng &);
+
+- std::auto_ptr<MfxHwVideoProcessing::DriverVideoProcessing> m_ddi;
++ std::unique_ptr<MfxHwVideoProcessing::DriverVideoProcessing> m_ddi;
+ MfxHwVideoProcessing::mfxVppCaps m_caps;
+ };
+
+diff --git a/_studio/shared/umc/codec/h264_dec/include/umc_h264_au_splitter.h b/_studio/shared/umc/codec/h264_dec/include/umc_h264_au_splitter.h
+index 2c1f117..0915cd5 100644
+--- a/_studio/shared/umc/codec/h264_dec/include/umc_h264_au_splitter.h
++++ b/_studio/shared/umc/codec/h264_dec/include/umc_h264_au_splitter.h
+@@ -177,7 +177,7 @@ class AU_Splitter
+
+ //Status DecodeHeaders(MediaDataEx *nalUnit);
+
+- std::auto_ptr<NALUnitSplitter> m_pNALSplitter;
++ std::unique_ptr<NALUnitSplitter> m_pNALSplitter;
+ };
+
+ } // namespace UMC
+diff --git a/_studio/shared/umc/codec/h264_dec/include/umc_h264_segment_decoder_dxva.h b/_studio/shared/umc/codec/h264_dec/include/umc_h264_segment_decoder_dxva.h
+index 018667f..729c44b 100644
+--- a/_studio/shared/umc/codec/h264_dec/include/umc_h264_segment_decoder_dxva.h
++++ b/_studio/shared/umc/codec/h264_dec/include/umc_h264_segment_decoder_dxva.h
+@@ -78,7 +78,7 @@ class H264_DXVA_SegmentDecoder : public H264_DXVA_SegmentDecoderCommon
+
+ protected:
+
+- std::auto_ptr<Packer> m_Packer;
++ std::unique_ptr<Packer> m_Packer;
+
+ private:
+ H264_DXVA_SegmentDecoder & operator = (H264_DXVA_SegmentDecoder &)
+diff --git a/_studio/shared/umc/codec/h264_dec/include/umc_h264_task_supplier.h b/_studio/shared/umc/codec/h264_dec/include/umc_h264_task_supplier.h
+index e04eea0..53c32de 100644
+--- a/_studio/shared/umc/codec/h264_dec/include/umc_h264_task_supplier.h
++++ b/_studio/shared/umc/codec/h264_dec/include/umc_h264_task_supplier.h
+@@ -268,6 +268,9 @@ struct ViewItem
+ // Copy constructor
+ ViewItem(const ViewItem &src);
+
++ // Copy assignment
++ ViewItem &operator =(const ViewItem &src);
++
+ ~ViewItem();
+
+ // Initialize th view, allocate resources
+@@ -296,10 +299,10 @@ struct ViewItem
+ int32_t viewId;
+
+ // Pointer to the view's DPB
+- mutable std::auto_ptr<H264DBPList> pDPB[MAX_NUM_LAYERS];
++ mutable std::unique_ptr<H264DBPList> pDPB[MAX_NUM_LAYERS];
+
+ // Pointer to the POC processing object
+- mutable std::auto_ptr<POCDecoder> pPOCDec[MAX_NUM_LAYERS];
++ mutable std::unique_ptr<POCDecoder> pPOCDec[MAX_NUM_LAYERS];
+
+ bool m_isDisplayable;
+
+diff --git a/_studio/shared/umc/codec/h264_dec/src/umc_h264_task_supplier.cpp b/_studio/shared/umc/codec/h264_dec/src/umc_h264_task_supplier.cpp
+index cdf1fd3..ba6f58e 100644
+--- a/_studio/shared/umc/codec/h264_dec/src/umc_h264_task_supplier.cpp
++++ b/_studio/shared/umc/codec/h264_dec/src/umc_h264_task_supplier.cpp
+@@ -1802,6 +1802,20 @@ ViewItem::ViewItem(const ViewItem &src)
+
+ } // ViewItem::ViewItem(const ViewItem &src)
+
++ViewItem &ViewItem::operator =(const ViewItem &src)
++{
++ Reset();
++
++ viewId = src.viewId;
++ for (uint32_t i = 0; i < MAX_NUM_LAYERS; i++) {
++ pDPB[i].reset(src.pDPB[i].release());
++ pPOCDec[i].reset(src.pPOCDec[i].release());
++ MaxLongTermFrameIdx[i] = src.MaxLongTermFrameIdx[i];
++ }
++ maxDecFrameBuffering = src.maxDecFrameBuffering;
++ return *this;
++}
++
+ ViewItem::~ViewItem()
+ {
+ Close();
+diff --git a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
+index 21d4bcb..3446e68 100644
+--- a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
++++ b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
+@@ -105,7 +105,7 @@ class MJPEGVideoDecoderBaseMFX
+ int m_frameSampling;
+
+ // JPEG decoders allocated
+- std::auto_ptr<CJPEGDecoderBase> m_decoder;
++ std::unique_ptr<CJPEGDecoderBase> m_decoder;
+ CJPEGDecoderBase * m_decBase;
+
+ FrameAllocator * m_frameAllocator;
+diff --git a/api/opensource/mfx_dispatch/CMakeLists.txt b/api/opensource/mfx_dispatch/CMakeLists.txt
+index ded78f6..d742917 100644
+--- a/api/opensource/mfx_dispatch/CMakeLists.txt
++++ b/api/opensource/mfx_dispatch/CMakeLists.txt
+@@ -64,7 +64,7 @@ else( )
+
+ set(no_warnings "-Wno-unknown-pragmas -Wno-unused")
+
+- set(CMAKE_CXX_FLAGS "-pipe -fPIC")
++ set(CMAKE_CXX_FLAGS "-pipe -fPIC -std=c++11")
+ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall ${no_warnings} -g -D_DEBUG" CACHE STRING "" FORCE)
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wall ${no_warnings} -DNDEBUG" CACHE STRING "" FORCE)
+
+diff --git a/api/opensource/mfx_dispatch/include/mfx_dispatcher_log.h b/api/opensource/mfx_dispatch/include/mfx_dispatcher_log.h
+index 0637e46..7491651 100644
+--- a/api/opensource/mfx_dispatch/include/mfx_dispatcher_log.h
++++ b/api/opensource/mfx_dispatch/include/mfx_dispatcher_log.h
+@@ -172,7 +172,7 @@ class DSSingleTone
+ //if obj != NULL then it store obj
+ inline static T * store_or_load(T * obj = NULL)
+ {
+- static std::auto_ptr<T> instance;
++ static std::unique_ptr<T> instance;
+ if (NULL != obj)
+ {
+ instance.reset(obj);
+diff --git a/api/opensource/mfx_dispatch/src/main.cpp b/api/opensource/mfx_dispatch/src/main.cpp
+index 98ebe83..a75c6bd 100644
+--- a/api/opensource/mfx_dispatch/src/main.cpp
++++ b/api/opensource/mfx_dispatch/src/main.cpp
+@@ -610,7 +610,7 @@ mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
+ DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: uid=NULL\n")));
+ return MFX_ERR_NULL_PTR;
+ }
+- DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: uid="MFXGUIDTYPE()" version=%d\n")
++ DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: uid=" MFXGUIDTYPE() " version=%d\n")
+ , MFXGUIDTOHEX(uid)
+ , version))
+ size_t pluginsChecked = 0;
+@@ -624,7 +624,7 @@ mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
+ //check rest in records
+ if (i->PluginVersion < version)
+ {
+- DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: registered \"Plugin Version\" for GUID="MFXGUIDTYPE()" is %d, that is smaller that requested\n")
++ DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE() " is %d, that is smaller that requested\n")
+ , MFXGUIDTOHEX(uid)
+ , i->PluginVersion))
+ continue;
+@@ -691,7 +691,7 @@ mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, m
+ return MFX_ERR_NULL_PTR;
+ }
+
+- DISPATCHER_LOG_INFO((("MFXVideoUSER_LoadByPath: %S uid="MFXGUIDTYPE()" version=%d\n")
++ DISPATCHER_LOG_INFO((("MFXVideoUSER_LoadByPath: %S uid=" MFXGUIDTYPE() " version=%d\n")
+ , MSDK2WIDE(path)
+ , MFXGUIDTOHEX(uid)
+ , version))
+@@ -744,10 +744,10 @@ mfxStatus MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
+ bool bDestroyed = rHandle.pluginFactory.Destroy(*uid);
+ if (bDestroyed)
+ {
+- DISPATCHER_LOG_INFO((("MFXVideoUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
++ DISPATCHER_LOG_INFO((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE() " unloaded\n"), MFXGUIDTOHEX(uid)));
+ } else
+ {
+- DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
++ DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE() " not found\n"), MFXGUIDTOHEX(uid)));
+ }
+
+ return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND;
+@@ -766,7 +766,7 @@ mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
+ DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: uid=NULL\n")));
+ return MFX_ERR_NULL_PTR;
+ }
+- DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: uid="MFXGUIDTYPE()" version=%d\n")
++ DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: uid=" MFXGUIDTYPE() " version=%d\n")
+ , MFXGUIDTOHEX(uid)
+ , version))
+ size_t pluginsChecked = 0;
+@@ -784,7 +784,7 @@ mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
+ //check rest in records
+ if (i->PluginVersion < version)
+ {
+- DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: registered \"Plugin Version\" for GUID="MFXGUIDTYPE()" is %d, that is smaller that requested\n")
++ DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE() " is %d, that is smaller that requested\n")
+ , MFXGUIDTOHEX(uid)
+ , i->PluginVersion))
+ continue;
+@@ -832,10 +832,10 @@ mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
+ bool bDestroyed = rHandle.pluginFactory.Destroy(*uid);
+ if (bDestroyed)
+ {
+- DISPATCHER_LOG_INFO((("MFXAudioUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
++ DISPATCHER_LOG_INFO((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE() " unloaded\n"), MFXGUIDTOHEX(uid)));
+ } else
+ {
+- DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
++ DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE() " not found\n"), MFXGUIDTOHEX(uid)));
+ }
+
+ return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND;
+diff --git a/api/opensource/mfx_dispatch/src/mfx_load_plugin.cpp b/api/opensource/mfx_dispatch/src/mfx_load_plugin.cpp
+index 4fa19c9..bb48e7d 100644
+--- a/api/opensource/mfx_dispatch/src/mfx_load_plugin.cpp
++++ b/api/opensource/mfx_dispatch/src/mfx_load_plugin.cpp
+@@ -150,7 +150,7 @@ bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const Plugin
+ {
+ if (!dsc.onlyVersionRegistered && pluginParams.CodecId != dsc.CodecId)
+ {
+- TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned CodecId="MFXFOURCCTYPE()", but registration has CodecId="MFXFOURCCTYPE()"\n"
++ TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned CodecId=" MFXFOURCCTYPE() ", but registration has CodecId=" MFXFOURCCTYPE() "\n"
+ , MFXU32TOFOURCC(pluginParams.CodecId), MFXU32TOFOURCC(dsc.CodecId));
+ return false;
+ }
+@@ -163,7 +163,7 @@ bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const Plugin
+
+ if (pluginParams.PluginUID != dsc.PluginUID)
+ {
+- TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned UID="MFXGUIDTYPE()", but registration has UID="MFXGUIDTYPE()"\n"
++ TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned UID=" MFXGUIDTYPE() ", but registration has UID=" MFXGUIDTYPE() "\n"
+ , MFXGUIDTOHEX(&pluginParams.PluginUID), MFXGUIDTOHEX(&dsc.PluginUID));
+ return false;
+ }
+@@ -445,4 +445,4 @@ void MFX::MFXPluginFactory::DestroyPlugin( FactoryRecord & record)
+ sts = MFXVideoUSER_Unregister(mSession, record.plgParams.Type);
+ TRACE_PLUGIN_INFO(" MFXVideoUSER_Unregister for Type=%d, returned %d\n", record.plgParams.Type, sts);
+ }
+-}
+\ No newline at end of file
++}
+diff --git a/api/opensource/mfx_dispatch/src/mfx_plugin_hive_linux.cpp b/api/opensource/mfx_dispatch/src/mfx_plugin_hive_linux.cpp
+index 7ae422e..c5a1ce8 100644
+--- a/api/opensource/mfx_dispatch/src/mfx_plugin_hive_linux.cpp
++++ b/api/opensource/mfx_dispatch/src/mfx_plugin_hive_linux.cpp
+@@ -95,7 +95,7 @@ static bool CheckPluginRecord(PluginDescriptionRecord & descriptionRecord, mfxU3
+
+ if (isFieldMissed(foundFields, requiredFields, PluginConfigParser::PARSED_CODEC_ID))
+ {
+- TRACE_HIVE_INFO(alignStr()" : "MFXFOURCCTYPE()" \n", CodecIDKeyName, MFXU32TOFOURCC(descriptionRecord.CodecId));
++ TRACE_HIVE_INFO(alignStr() " : " MFXFOURCCTYPE() " \n", CodecIDKeyName, MFXU32TOFOURCC(descriptionRecord.CodecId));
+ }
+ else
+ {
+@@ -106,7 +106,7 @@ static bool CheckPluginRecord(PluginDescriptionRecord & descriptionRecord, mfxU3
+ {
+ return false;
+ }
+- TRACE_HIVE_INFO(alignStr()" : "MFXGUIDTYPE()"\n", GUIDKeyName, MFXGUIDTOHEX(&descriptionRecord.PluginUID));
++ TRACE_HIVE_INFO(alignStr()" : " MFXGUIDTYPE() "\n", GUIDKeyName, MFXGUIDTOHEX(&descriptionRecord.PluginUID));
+
+ if (isFieldMissed(foundFields, requiredFields, PluginConfigParser::PARSED_PATH))
+ {
+diff --git a/contrib/SafeStringStaticLibrary/CMakeLists.txt b/contrib/SafeStringStaticLibrary/CMakeLists.txt
+index 933aeb9..e525b19 100644
+--- a/contrib/SafeStringStaticLibrary/CMakeLists.txt
++++ b/contrib/SafeStringStaticLibrary/CMakeLists.txt
+@@ -32,7 +32,7 @@ else( )
+
+ set(no_warnings "-Wno-unknown-pragmas -Wno-unused")
+
+- set(CMAKE_CXX_FLAGS "-pipe -fPIC")
++ set(CMAKE_CXX_FLAGS "-pipe -fPIC -std=c++11")
+ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall ${no_warnings} -Wformat -Wformat-security -g -D_DEBUG")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wall ${no_warnings} -Wformat -Wformat-security -DNDEBUG")
+
+diff --git a/samples/sample_common/include/avc_spl.h b/samples/sample_common/include/avc_spl.h
+index 27a44fd..33d3ca1 100644
+--- a/samples/sample_common/include/avc_spl.h
++++ b/samples/sample_common/include/avc_spl.h
+@@ -94,7 +94,7 @@ class AVC_Spl : public AbstractSplitter
+ void ResetCurrentState();
+
+ protected:
+- std::auto_ptr<NALUnitSplitter> m_pNALSplitter;
++ std::unique_ptr<NALUnitSplitter> m_pNALSplitter;
+
+ mfxStatus Init();
+
+@@ -118,7 +118,7 @@ class AVC_Spl : public AbstractSplitter
+ bool m_WaitForIDR;
+
+ AVCHeaders m_headers;
+- std::auto_ptr<AVCFrameInfo> m_AUInfo;
++ std::unique_ptr<AVCFrameInfo> m_AUInfo;
+ AVCFrameInfo * m_currentInfo;
+ AVCSlice * m_pLastSlice;
+
+diff --git a/samples/sample_common/include/base_allocator.h b/samples/sample_common/include/base_allocator.h
+index be0b7a8..0fa74fb 100644
+--- a/samples/sample_common/include/base_allocator.h
++++ b/samples/sample_common/include/base_allocator.h
+@@ -81,7 +81,7 @@ class BaseFrameAllocator: public MFXFrameAllocator
+ virtual mfxStatus FreeFrames(mfxFrameAllocResponse *response);
+
+ protected:
+- std::auto_ptr<MSDKMutex> mtx;
++ std::unique_ptr<MSDKMutex> mtx;
+ typedef std::list<mfxFrameAllocResponse>::iterator Iter;
+ static const mfxU32 MEMTYPE_FROM_MASK = MFX_MEMTYPE_FROM_ENCODE | MFX_MEMTYPE_FROM_DECODE | \
+ MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT | \
+diff --git a/samples/sample_common/include/brc_routines.h b/samples/sample_common/include/brc_routines.h
+index 25e2531..b8b4694 100644
+--- a/samples/sample_common/include/brc_routines.h
++++ b/samples/sample_common/include/brc_routines.h
+@@ -324,7 +324,7 @@ class ExtBRC
+ cHRD m_hrd;
+ bool m_bInit;
+ BRC_Ctx m_ctx;
+- std::auto_ptr<AVGBitrate> m_avg;
++ std::unique_ptr<AVGBitrate> m_avg;
+
+ public:
+ ExtBRC():
+diff --git a/samples/sample_common/include/general_allocator.h b/samples/sample_common/include/general_allocator.h
+index 7ec9566..4af69d5 100644
+--- a/samples/sample_common/include/general_allocator.h
++++ b/samples/sample_common/include/general_allocator.h
+@@ -51,8 +51,8 @@ class GeneralAllocator : public BaseFrameAllocator
+ bool isD3DMid(mfxHDL mid);
+
+ std::map<mfxHDL, bool> m_Mids;
+- std::auto_ptr<BaseFrameAllocator> m_D3DAllocator;
+- std::auto_ptr<SysMemFrameAllocator> m_SYSAllocator;
++ std::unique_ptr<BaseFrameAllocator> m_D3DAllocator;
++ std::unique_ptr<SysMemFrameAllocator> m_SYSAllocator;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GeneralAllocator);
+
+diff --git a/samples/sample_common/include/plugin_loader.h b/samples/sample_common/include/plugin_loader.h
+index 138db68..e30fa93 100644
+--- a/samples/sample_common/include/plugin_loader.h
++++ b/samples/sample_common/include/plugin_loader.h
+@@ -27,7 +27,7 @@ or https://software.intel.com/en-us/media-client-solutions-support.
+ //#include "mfx_plugin_module.h"
+ #include <iostream>
+ #include <iomanip> // for std::setfill, std::setw
+-#include <memory> // for std::auto_ptr
++#include <memory> // for std::unique_ptr
+
+ class MsdkSoModule
+ {
+@@ -234,12 +234,12 @@ class PluginLoader : public MFXPlugin
+ };
+
+ inline MFXPlugin * LoadPluginByType(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version, const mfxChar *pluginName, mfxU32 len) {
+- std::auto_ptr<PluginLoader> plg(new PluginLoader (type, session, uid, version, pluginName, len));
++ std::unique_ptr<PluginLoader> plg(new PluginLoader (type, session, uid, version, pluginName, len));
+ return plg->IsOk() ? plg.release() : NULL;
+ }
+
+ inline MFXPlugin * LoadPluginByGUID(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version) {
+- std::auto_ptr<PluginLoader> plg(new PluginLoader (type, session, uid, version));
++ std::unique_ptr<PluginLoader> plg(new PluginLoader (type, session, uid, version));
+ return plg->IsOk() ? plg.release() : NULL;
+ }
+
+diff --git a/samples/sample_common/include/sample_utils.h b/samples/sample_common/include/sample_utils.h
+index b948e82..773ae31 100644
+--- a/samples/sample_common/include/sample_utils.h
++++ b/samples/sample_common/include/sample_utils.h
+@@ -196,14 +196,14 @@ class CH264FrameReader : public CSmplBitstreamReader
+ private:
+ mfxBitstream *m_processedBS;
+ // input bit stream
+- std::auto_ptr<mfxBitstream> m_originalBS;
++ std::unique_ptr<mfxBitstream> m_originalBS;
+
+ mfxStatus PrepareNextFrame(mfxBitstream *in, mfxBitstream **out);
+
+ // is stream ended
+ bool m_isEndOfStream;
+
+- std::auto_ptr<AbstractSplitter> m_pNALSplitter;
++ std::unique_ptr<AbstractSplitter> m_pNALSplitter;
+ FrameSplitterInfo *m_frame;
+ mfxU8 *m_plainBuffer;
+ mfxU32 m_plainBufferSize;
+diff --git a/samples/sample_decode/include/pipeline_decode.h b/samples/sample_decode/include/pipeline_decode.h
+index a523a16..b99807e 100644
+--- a/samples/sample_decode/include/pipeline_decode.h
++++ b/samples/sample_decode/include/pipeline_decode.h
+@@ -215,7 +215,7 @@ class CDecodingPipeline:
+
+ protected: // variables
+ CSmplYUVWriter m_FileWriter;
+- std::auto_ptr<CSmplBitstreamReader> m_FileReader;
++ std::unique_ptr<CSmplBitstreamReader> m_FileReader;
+ mfxBitstream m_mfxBS; // contains encoded data
+
+ MFXVideoSession m_mfxSession;
+@@ -224,8 +224,8 @@ class CDecodingPipeline:
+ MFXVideoVPP* m_pmfxVPP;
+ mfxVideoParam m_mfxVideoParams;
+ mfxVideoParam m_mfxVppVideoParams;
+- std::auto_ptr<MFXVideoUSER> m_pUserModule;
+- std::auto_ptr<MFXPlugin> m_pPlugin;
++ std::unique_ptr<MFXVideoUSER> m_pUserModule;
++ std::unique_ptr<MFXPlugin> m_pPlugin;
+ std::vector<mfxExtBuffer *> m_ExtBuffers;
+ std::vector<mfxExtBuffer *> m_ExtBuffersMfxBS;
+ mfxExtDecVideoProcessing m_DecoderPostProcessing;
+diff --git a/samples/sample_decode/src/pipeline_decode.cpp b/samples/sample_decode/src/pipeline_decode.cpp
+index b07420e..cc21f42 100644
+--- a/samples/sample_decode/src/pipeline_decode.cpp
++++ b/samples/sample_decode/src/pipeline_decode.cpp
+@@ -1271,7 +1271,7 @@ void CDecodingPipeline::SetMultiView()
+ template <typename Buffer>
+ mfxStatus CDecodingPipeline::AllocateExtBuffer()
+ {
+- std::auto_ptr<Buffer> pExtBuffer (new Buffer());
++ std::unique_ptr<Buffer> pExtBuffer (new Buffer());
+ if (!pExtBuffer.get())
+ return MFX_ERR_MEMORY_ALLOC;
+
+diff --git a/samples/sample_encode/include/pipeline_encode.h b/samples/sample_encode/include/pipeline_encode.h
+index 4f84587..eed505b 100644
+--- a/samples/sample_encode/include/pipeline_encode.h
++++ b/samples/sample_encode/include/pipeline_encode.h
+@@ -241,8 +241,8 @@ class CEncodingPipeline
+
+ mfxU32 m_InputFourCC;
+
+- std::auto_ptr<MFXVideoUSER> m_pUserModule;
+- std::auto_ptr<MFXPlugin> m_pPlugin;
++ std::unique_ptr<MFXVideoUSER> m_pUserModule;
++ std::unique_ptr<MFXPlugin> m_pPlugin;
+
+ MFXFrameAllocator* m_pMFXAllocator;
+ mfxAllocatorParams* m_pmfxAllocatorParams;
+diff --git a/samples/sample_encode/src/pipeline_encode.cpp b/samples/sample_encode/src/pipeline_encode.cpp
+index dd0b566..73dd28f 100644
+--- a/samples/sample_encode/src/pipeline_encode.cpp
++++ b/samples/sample_encode/src/pipeline_encode.cpp
+@@ -1147,7 +1147,7 @@ mfxStatus CEncodingPipeline::InitFileWriters(sInputParams *pParams)
+ // ViewOutput mode: 3 bitstreams - 2 separate & 1 merged
+ else if ( (MVC_VIEWOUTPUT & pParams->MVC_flags) && (pParams->dstFileBuff.size() <= 3))
+ {
+- std::auto_ptr<CSmplBitstreamDuplicateWriter> first(new CSmplBitstreamDuplicateWriter);
++ std::unique_ptr<CSmplBitstreamDuplicateWriter> first(new CSmplBitstreamDuplicateWriter);
+
+ // init first duplicate writer
+ MSDK_CHECK_POINTER(first.get(), MFX_ERR_MEMORY_ALLOC);
+@@ -1157,7 +1157,7 @@ mfxStatus CEncodingPipeline::InitFileWriters(sInputParams *pParams)
+ MSDK_CHECK_STATUS(sts, "first->InitDuplicate failed");
+
+ // init second duplicate writer
+- std::auto_ptr<CSmplBitstreamDuplicateWriter> second(new CSmplBitstreamDuplicateWriter);
++ std::unique_ptr<CSmplBitstreamDuplicateWriter> second(new CSmplBitstreamDuplicateWriter);
+ MSDK_CHECK_POINTER(second.get(), MFX_ERR_MEMORY_ALLOC);
+ sts = second->Init(pParams->dstFileBuff[1]);
+ MSDK_CHECK_STATUS(sts, "second->Init failed");
+diff --git a/samples/sample_encode/src/sample_encode.cpp b/samples/sample_encode/src/sample_encode.cpp
+index 36241e9..540efce 100644
+--- a/samples/sample_encode/src/sample_encode.cpp
++++ b/samples/sample_encode/src/sample_encode.cpp
+@@ -1069,7 +1069,7 @@ CEncodingPipeline* CreatePipeline(const sInputParams& params)
+ int main(int argc, char *argv[])
+ {
+ sInputParams Params = {}; // input parameters from command line
+- std::auto_ptr<CEncodingPipeline> pPipeline;
++ std::unique_ptr<CEncodingPipeline> pPipeline;
+
+ mfxStatus sts = MFX_ERR_NONE; // return value check
+
+diff --git a/samples/sample_fei/src/sample_fei.cpp b/samples/sample_fei/src/sample_fei.cpp
+index 84b9bda..3441443 100644
+--- a/samples/sample_fei/src/sample_fei.cpp
++++ b/samples/sample_fei/src/sample_fei.cpp
+@@ -1130,7 +1130,7 @@ mfxStatus ParseInputString(msdk_char* strInput[], mfxU8 nArgNum, AppConfig* pCon
+ int main(int argc, char *argv[])
+ {
+ AppConfig Config; // input parameters from command line
+- std::auto_ptr<CEncodingPipeline> pPipeline;
++ std::unique_ptr<CEncodingPipeline> pPipeline;
+
+ mfxStatus sts = MFX_ERR_NONE; // return value check
+
+diff --git a/samples/sample_multi_transcode/include/pipeline_transcode.h b/samples/sample_multi_transcode/include/pipeline_transcode.h
+index b07ee1e..75cb5a6 100644
+--- a/samples/sample_multi_transcode/include/pipeline_transcode.h
++++ b/samples/sample_multi_transcode/include/pipeline_transcode.h
+@@ -471,9 +471,9 @@ namespace TranscodingSample
+ public:
+ FileBitstreamProcessor();
+ virtual ~FileBitstreamProcessor();
+- virtual mfxStatus SetReader(std::auto_ptr<CSmplBitstreamReader>& reader);
+- virtual mfxStatus SetReader(std::auto_ptr<CSmplYUVReader>& reader);
+- virtual mfxStatus SetWriter(std::auto_ptr<CSmplBitstreamWriter>& writer);
++ virtual mfxStatus SetReader(std::unique_ptr<CSmplBitstreamReader>& reader);
++ virtual mfxStatus SetReader(std::unique_ptr<CSmplYUVReader>& reader);
++ virtual mfxStatus SetWriter(std::unique_ptr<CSmplBitstreamWriter>& writer);
+ virtual mfxStatus GetInputBitstream(mfxBitstream **pBitstream);
+ virtual mfxStatus GetInputFrame(mfxFrameSurface1 *pSurface);
+ virtual mfxStatus ProcessOutputBitstream(mfxBitstream* pBitstream);
+@@ -481,10 +481,10 @@ namespace TranscodingSample
+ virtual mfxStatus ResetOutput();
+
+ protected:
+- std::auto_ptr<CSmplBitstreamReader> m_pFileReader;
+- std::auto_ptr<CSmplYUVReader> m_pYUVFileReader;
++ std::unique_ptr<CSmplBitstreamReader> m_pFileReader;
++ std::unique_ptr<CSmplYUVReader> m_pYUVFileReader;
+ // for performance options can be zero
+- std::auto_ptr<CSmplBitstreamWriter> m_pFileWriter;
++ std::unique_ptr<CSmplBitstreamWriter> m_pFileWriter;
+ mfxBitstream m_Bitstream;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FileBitstreamProcessor);
+@@ -604,17 +604,17 @@ namespace TranscodingSample
+
+ mfxVersion m_Version; // real API version with which library is initialized
+
+- std::auto_ptr<MFXVideoSession> m_pmfxSession;
+- std::auto_ptr<MFXVideoDECODE> m_pmfxDEC;
+- std::auto_ptr<MFXVideoENCODE> m_pmfxENC;
+- std::auto_ptr<MFXVideoMultiVPP> m_pmfxVPP; // either VPP or VPPPlugin which wraps [VPP]-Plugin-[VPP] pipeline
+- std::auto_ptr<MFXVideoENC> m_pmfxPreENC;
+- std::auto_ptr<MFXVideoUSER> m_pUserDecoderModule;
+- std::auto_ptr<MFXVideoUSER> m_pUserEncoderModule;
+- std::auto_ptr<MFXVideoUSER> m_pUserEncModule;
+- std::auto_ptr<MFXPlugin> m_pUserDecoderPlugin;
+- std::auto_ptr<MFXPlugin> m_pUserEncoderPlugin;
+- std::auto_ptr<MFXPlugin> m_pUserEncPlugin;
++ std::unique_ptr<MFXVideoSession> m_pmfxSession;
++ std::unique_ptr<MFXVideoDECODE> m_pmfxDEC;
++ std::unique_ptr<MFXVideoENCODE> m_pmfxENC;
++ std::unique_ptr<MFXVideoMultiVPP> m_pmfxVPP; // either VPP or VPPPlugin which wraps [VPP]-Plugin-[VPP] pipeline
++ std::unique_ptr<MFXVideoENC> m_pmfxPreENC;
++ std::unique_ptr<MFXVideoUSER> m_pUserDecoderModule;
++ std::unique_ptr<MFXVideoUSER> m_pUserEncoderModule;
++ std::unique_ptr<MFXVideoUSER> m_pUserEncModule;
++ std::unique_ptr<MFXPlugin> m_pUserDecoderPlugin;
++ std::unique_ptr<MFXPlugin> m_pUserEncoderPlugin;
++ std::unique_ptr<MFXPlugin> m_pUserEncPlugin;
+
+ mfxFrameAllocResponse m_mfxDecResponse; // memory allocation response for decoder
+ mfxFrameAllocResponse m_mfxEncResponse; // memory allocation response for encoder
+@@ -727,7 +727,7 @@ namespace TranscodingSample
+
+ bool isHEVCSW;
+
+- std::auto_ptr<ExtendedBSStore> m_pBSStore;
++ std::unique_ptr<ExtendedBSStore> m_pBSStore;
+
+ mfxU32 m_FrameNumberPreference;
+ mfxU32 m_MaxFramesForTranscode;
+@@ -775,7 +775,7 @@ namespace TranscodingSample
+ struct ThreadTranscodeContext
+ {
+ // Pointer to the session's pipeline
+- std::auto_ptr<CTranscodingPipeline> pPipeline;
++ std::unique_ptr<CTranscodingPipeline> pPipeline;
+ // Pointer to bitstream handling object
+ FileBitstreamProcessor *pBSProcessor;
+ // Session implementation type
+diff --git a/samples/sample_multi_transcode/include/sample_multi_transcode.h b/samples/sample_multi_transcode/include/sample_multi_transcode.h
+index cc605b2..b3348c0 100644
+--- a/samples/sample_multi_transcode/include/sample_multi_transcode.h
++++ b/samples/sample_multi_transcode/include/sample_multi_transcode.h
+@@ -73,8 +73,8 @@ namespace TranscodingSample
+ std::vector<SafetySurfaceBuffer*> m_pBufferArray;
+
+ std::vector<FileBitstreamProcessor*> m_pExtBSProcArray;
+- std::auto_ptr<mfxAllocatorParams> m_pAllocParam;
+- std::auto_ptr<CHWDevice> m_hwdev;
++ std::unique_ptr<mfxAllocatorParams> m_pAllocParam;
++ std::unique_ptr<CHWDevice> m_hwdev;
+ msdk_tick m_StartTime;
+ // need to work with HW pipeline
+ mfxHandleType m_eDevType;
+diff --git a/samples/sample_multi_transcode/src/pipeline_transcode.cpp b/samples/sample_multi_transcode/src/pipeline_transcode.cpp
+index a993f41..617703b 100644
+--- a/samples/sample_multi_transcode/src/pipeline_transcode.cpp
++++ b/samples/sample_multi_transcode/src/pipeline_transcode.cpp
+@@ -3749,7 +3749,7 @@ mfxStatus CTranscodingPipeline::LoadGenericPlugin()
+ {
+ mfxStatus sts = MFX_ERR_NONE;
+
+- std::auto_ptr<MFXVideoVPPPlugin> pVPPPlugin(new MFXVideoVPPPlugin(*m_pmfxSession.get()));
++ std::unique_ptr<MFXVideoVPPPlugin> pVPPPlugin(new MFXVideoVPPPlugin(*m_pmfxSession.get()));
+ MSDK_CHECK_POINTER(pVPPPlugin.get(), MFX_ERR_NULL_PTR);
+
+ sts = pVPPPlugin->LoadDLL((msdk_char*)m_sGenericPluginPath.c_str());
+@@ -4255,25 +4255,25 @@ FileBitstreamProcessor::~FileBitstreamProcessor()
+ WipeMfxBitstream(&m_Bitstream);
+ } // FileBitstreamProcessor::~FileBitstreamProcessor()
+
+-mfxStatus FileBitstreamProcessor::SetReader(std::auto_ptr<CSmplYUVReader>& reader)
++mfxStatus FileBitstreamProcessor::SetReader(std::unique_ptr<CSmplYUVReader>& reader)
+ {
+- m_pYUVFileReader = reader;
++ m_pYUVFileReader = std::move(reader);
+
+ return MFX_ERR_NONE;
+ }
+
+-mfxStatus FileBitstreamProcessor::SetReader(std::auto_ptr<CSmplBitstreamReader>& reader)
++mfxStatus FileBitstreamProcessor::SetReader(std::unique_ptr<CSmplBitstreamReader>& reader)
+ {
+- m_pFileReader = reader;
++ m_pFileReader = std::move(reader);
+ mfxStatus sts = InitMfxBitstream(&m_Bitstream, 1024 * 1024);
+ MSDK_CHECK_STATUS(sts, "InitMfxBitstream failed");
+
+ return MFX_ERR_NONE;
+ }
+
+-mfxStatus FileBitstreamProcessor::SetWriter(std::auto_ptr<CSmplBitstreamWriter>& writer)
++mfxStatus FileBitstreamProcessor::SetWriter(std::unique_ptr<CSmplBitstreamWriter>& writer)
+ {
+- m_pFileWriter = writer;
++ m_pFileWriter = std::move(writer);
+
+ return MFX_ERR_NONE;
+ }
+diff --git a/samples/sample_multi_transcode/src/sample_multi_transcode.cpp b/samples/sample_multi_transcode/src/sample_multi_transcode.cpp
+index 249496d..6119164 100644
+--- a/samples/sample_multi_transcode/src/sample_multi_transcode.cpp
++++ b/samples/sample_multi_transcode/src/sample_multi_transcode.cpp
+@@ -182,7 +182,7 @@ mfxStatus Launcher::Init(int argc, msdk_char *argv[])
+ MSDK_CHECK_STATUS(sts, "pAllocator->Init failed");
+ m_pAllocArray.push_back(pAllocator);
+
+- std::auto_ptr<ThreadTranscodeContext> pThreadPipeline(new ThreadTranscodeContext);
++ std::unique_ptr<ThreadTranscodeContext> pThreadPipeline(new ThreadTranscodeContext);
+ // extend BS processing init
+ m_pExtBSProcArray.push_back(new FileBitstreamProcessor);
+
+@@ -190,8 +190,8 @@ mfxStatus Launcher::Init(int argc, msdk_char *argv[])
+
+ pThreadPipeline->pBSProcessor = m_pExtBSProcArray.back();
+
+- std::auto_ptr<CSmplBitstreamReader> reader;
+- std::auto_ptr<CSmplYUVReader> yuvreader;
++ std::unique_ptr<CSmplBitstreamReader> reader;
++ std::unique_ptr<CSmplYUVReader> yuvreader;
+ if (m_InputParamsArray[i].DecodeId == MFX_CODEC_VP9)
+ {
+ reader.reset(new CIVFFrameReader());
+@@ -223,7 +223,7 @@ mfxStatus Launcher::Init(int argc, msdk_char *argv[])
+ MSDK_CHECK_STATUS(sts, "m_pExtBSProcArray.back()->SetReader failed");
+ }
+
+- std::auto_ptr<CSmplBitstreamWriter> writer(new CSmplBitstreamWriter());
++ std::unique_ptr<CSmplBitstreamWriter> writer(new CSmplBitstreamWriter());
+ sts = writer->Init(m_InputParamsArray[i].strDstFile);
+
+ sts = m_pExtBSProcArray.back()->SetWriter(writer);
+diff --git a/samples/sample_plugins/rotate_opencl/include/d3d_utils.h b/samples/sample_plugins/rotate_opencl/include/d3d_utils.h
+index 7f12f4b..fe737f1 100644
+--- a/samples/sample_plugins/rotate_opencl/include/d3d_utils.h
++++ b/samples/sample_plugins/rotate_opencl/include/d3d_utils.h
+@@ -28,7 +28,7 @@ or https://software.intel.com/en-us/media-client-solutions-support.
+
+ #define D3DFMT_NV12 (D3DFORMAT)MAKEFOURCC('N','V','1','2')
+
+-// auto_ptr-like behavior
++// unique_ptr-like behavior
+ class LockedD3DDevice
+ {
+ private:
+diff --git a/samples/sample_plugins/rotate_opencl/include/sample_opencl_plugin.h b/samples/sample_plugins/rotate_opencl/include/sample_opencl_plugin.h
+index b92f298..af9766a 100644
+--- a/samples/sample_plugins/rotate_opencl/include/sample_opencl_plugin.h
++++ b/samples/sample_plugins/rotate_opencl/include/sample_opencl_plugin.h
+@@ -198,8 +198,8 @@ class Rotate : public MFXGenericPlugin
+ bool m_bIsInOpaque;
+ bool m_bIsOutOpaque;
+
+- std::auto_ptr<OpenCLFilterVA> m_OpenCLFilter;
+- std::auto_ptr<OpenCLRotator180Context> m_pOpenCLRotator180Context;
++ std::unique_ptr<OpenCLFilterVA> m_OpenCLFilter;
++ std::unique_ptr<OpenCLRotator180Context> m_pOpenCLRotator180Context;
+ mfxHDL m_device;
+
+ mfxCoreInterface *m_pmfxCore;
+diff --git a/samples/sample_plugins/vpp_plugin/include/mfx_vpp_plugin.h b/samples/sample_plugins/vpp_plugin/include/mfx_vpp_plugin.h
+index 7b5f1ac..b98d2fd 100644
+--- a/samples/sample_plugins/vpp_plugin/include/mfx_vpp_plugin.h
++++ b/samples/sample_plugins/vpp_plugin/include/mfx_vpp_plugin.h
+@@ -113,7 +113,7 @@ class MFXVideoVPPPlugin : public MFXVideoMultiVPP
+ SurfacePool m_SurfacePool2;
+ mfxSession m_session2; //for two vpp case
+
+- std::auto_ptr<mfxFrameAllocResponse> m_allocResponses[2];
++ std::unique_ptr<mfxFrameAllocResponse> m_allocResponses[2];
+ mfxStatus AllocateFrames(mfxVideoParam *par, mfxVideoParam *par1, mfxVideoParam *par2);
+
+ // pipeline implementation
+diff --git a/samples/sample_vpp/include/sample_vpp_pts.h b/samples/sample_vpp/include/sample_vpp_pts.h
+index 499a418..02da062 100644
+--- a/samples/sample_vpp/include/sample_vpp_pts.h
++++ b/samples/sample_vpp/include/sample_vpp_pts.h
+@@ -50,7 +50,7 @@ class PTSMaker
+ // FRC based on pts
+ bool CheckAdvancedPTS(mfxFrameSurface1 *pSurface);
+
+- std::auto_ptr<BaseFRCChecker> m_pFRCChecker;
++ std::unique_ptr<BaseFRCChecker> m_pFRCChecker;
+
+ mfxU32 m_FRateExtN_In;
+ mfxU32 m_FRateExtD_In;
+diff --git a/samples/sample_vpp/include/sample_vpp_utils.h b/samples/sample_vpp/include/sample_vpp_utils.h
+index 246a079..0ccb2b0 100644
+--- a/samples/sample_vpp/include/sample_vpp_utils.h
++++ b/samples/sample_vpp/include/sample_vpp_utils.h
+@@ -287,7 +287,7 @@ struct sMemoryAllocator
+ #endif
+
+ #ifdef LIBVA_SUPPORT
+- std::auto_ptr<CLibVA> libvaKeeper;
++ std::unique_ptr<CLibVA> libvaKeeper;
+ #endif*/
+ };
+
+@@ -387,7 +387,7 @@ public :
+ mfxFrameSurface1* pSurface);
+
+ private:
+- std::auto_ptr<CRawVideoWriter> m_ofile[8];
++ std::unique_ptr<CRawVideoWriter> m_ofile[8];
+
+ bool m_svcMode;
+ };
+diff --git a/samples/sample_vpp/src/sample_vpp.cpp b/samples/sample_vpp/src/sample_vpp.cpp
+index 4bc9623..c0c7ae6 100644
+--- a/samples/sample_vpp/src/sample_vpp.cpp
++++ b/samples/sample_vpp/src/sample_vpp.cpp
+@@ -291,7 +291,7 @@ int main(int argc, msdk_char *argv[])
+
+ SurfaceVPPStore surfStore;
+
+- auto_ptr<PTSMaker> ptsMaker;
++ unique_ptr<PTSMaker> ptsMaker;
+
+ /* generators for ROI testing */
+ ROIGenerator inROIGenerator;
+diff --git a/samples/sample_vpp/src/sample_vpp_pts.cpp b/samples/sample_vpp/src/sample_vpp_pts.cpp
+index 011c777..047b358 100644
+--- a/samples/sample_vpp/src/sample_vpp_pts.cpp
++++ b/samples/sample_vpp/src/sample_vpp_pts.cpp
+@@ -27,7 +27,7 @@ or https://software.intel.com/en-us/media-client-solutions-support.
+
+ mfxF64 MaxTimeDifference = 0.015; // 15 ms is an edge
+
+-PTSMaker::PTSMaker():m_pFRCChecker(0),
++PTSMaker::PTSMaker():m_pFRCChecker(nullptr),
+ m_FRateExtN_In(0),
+ m_FRateExtD_In(1),
+ m_FRateExtN_Out(0),
+@@ -215,4 +215,4 @@ void PTSMaker::PrintDumpInfo()
+
+
+
+-/***************************************************************************/
+\ No newline at end of file
++/***************************************************************************/