<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Robby, in Media (Intel® Video Processing Library, Intel Media SDK)</title>
    <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076498#M9090</link>
    <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;For run OpenCL sample on Linux. You can try following command line.&lt;/P&gt;

&lt;P&gt;$ ./sample_encode_drm h264&amp;nbsp; -hw -i input.yuv -o output.h264 -w 720 -h 480 -angle 180 -opencl&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;$ ./sample_multi_transcode_drm -hw -i::h264 input.h264 -o::h264 output.h264&amp;nbsp; -angle 180 -opencl&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2015 07:55:21 GMT</pubDate>
    <dc:creator>Jiandong_Z_Intel</dc:creator>
    <dc:date>2015-11-20T07:55:21Z</dc:date>
    <item>
      <title>MFX/MSDK and OpenCL interop on Linux ?</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076497#M9089</link>
      <description>&lt;P&gt;Hi, I am planning to optimize one of my modules with OpenCL.&lt;/P&gt;

&lt;P&gt;I am using CentOS 7.1 and MSDK 2015R6. I looked up the example/sample codes provided by Intel. Two examples that deal with MSDK and OpenCL interop are all for Windows, as they both depend on the function clEnqueueAcquireDX9MediaSurfacesKHR()&amp;nbsp;to use media surfaces as OpenCL memory objects, and that function only works with the DX9 adapter API.&lt;/P&gt;

&lt;P&gt;Two other examples (motion estimation) that do work on Linux appear to be just OpenCL. I don't see MSDK and OpenCL interop in them.&lt;/P&gt;

&lt;P&gt;Is&amp;nbsp;MFX/MSDK and OpenCL interop currently supported on Linux ?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Robby&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 19:58:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076497#M9089</guid>
      <dc:creator>Robby_S</dc:creator>
      <dc:date>2015-11-19T19:58:01Z</dc:date>
    </item>
    <item>
      <title>Hi Robby,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076498#M9090</link>
      <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;For run OpenCL sample on Linux. You can try following command line.&lt;/P&gt;

&lt;P&gt;$ ./sample_encode_drm h264&amp;nbsp; -hw -i input.yuv -o output.h264 -w 720 -h 480 -angle 180 -opencl&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;$ ./sample_multi_transcode_drm -hw -i::h264 input.h264 -o::h264 output.h264&amp;nbsp; -angle 180 -opencl&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 07:55:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076498#M9090</guid>
      <dc:creator>Jiandong_Z_Intel</dc:creator>
      <dc:date>2015-11-20T07:55:21Z</dc:date>
    </item>
    <item>
      <title>Thanks Zachary. It looks like</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076499#M9091</link>
      <description>&lt;P&gt;Thanks Zachary. It looks like MSDK - OpenCL interop is supported on CentOS, though I have been unable to run the samples.&amp;nbsp;pVPPPlugin-&amp;gt;LoadDLL is giving me errors although both libsample_rotate_plugin.so and libsample_plugin_opencl.so are in the same directory. That's not important yet. Don't worry about it for now.&lt;/P&gt;

&lt;P&gt;The real issue is, these two examples need the library sample_plugin_opencl to work. The source code does not show exactly how MSDK and OpenCL inter-operate. W&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;hat I really need is an example like ocl_media_sdk_interop for the Windows version, which shows how my OpenCL code can get hold of the frame surface buffer from MSDK, manipulate the frame buffer, and return it to MSDK.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Do we have something like that for CentOS? Or maybe the source code for libsample_plugin_opencl.so (the source code may or may not be exactly what I am looking for)?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Robby&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 18:48:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076499#M9091</guid>
      <dc:creator>Robby_S</dc:creator>
      <dc:date>2015-11-20T18:48:36Z</dc:date>
    </item>
    <item>
      <title>Hi Robby,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076500#M9092</link>
      <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;You can refer to the source code&amp;nbsp;of libsample_plugin_opencl.so, under MSDK samples\sample_user_modules\rotate_opencl folder.&lt;/P&gt;

&lt;P&gt;OpenCLFilterVA::InitSurfaceSharingExtension&lt;/P&gt;

&lt;P&gt;OpenCLFilterVA::PrepareSharedSurfaces&lt;/P&gt;

&lt;P&gt;OpenCLFilterVA::ProcessSurface&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 06:50:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076500#M9092</guid>
      <dc:creator>Jiandong_Z_Intel</dc:creator>
      <dc:date>2015-11-23T06:50:29Z</dc:date>
    </item>
    <item>
      <title>Hi Zachary, </title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076501#M9093</link>
      <description>&lt;P&gt;Hi Zachary,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks for pointing me to the source code.&lt;/P&gt;

&lt;P&gt;One more question: Is it possible to use opaque memory when sharing a frame surface between MFX/MSDK and OpenCL? I am doubtful, but would like to get a confirmation.&lt;/P&gt;

&lt;P&gt;Thanks again,&lt;/P&gt;

&lt;P&gt;Robby&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 00:54:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076501#M9093</guid>
      <dc:creator>Robby_S</dc:creator>
      <dc:date>2015-12-09T00:54:03Z</dc:date>
    </item>
    <item>
      <title>Hi Robby,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076502#M9094</link>
      <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;Thanks for you asked this question.&lt;/P&gt;

&lt;P&gt;First, we should understand opaque memory, following can be found in page 30 in &amp;lt;MSDK root&amp;gt;/doc/mediasdk-man.pdf.&lt;/P&gt;

&lt;P&gt;Since the SDK manages the association of opaque surface to “real” surface types internally, &lt;STRONG&gt;the&lt;BR /&gt;
	application cannot read the content of opaque surfaces&lt;/STRONG&gt;. Also the application does not get any&lt;BR /&gt;
	opaque-type surface allocation requests if the application specifies an &lt;STRONG&gt;external frame allocator&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Then, we can found following in page 11 in &amp;lt;MSDK root&amp;gt;/doc/mediasdkusr-man.pdf&lt;/P&gt;

&lt;P&gt;Accessing Opaque Surfaces&lt;BR /&gt;
	If plug-in function works with opaque surfaces at input/output, the function needs to retrieve&lt;BR /&gt;
	the corresponding native surface by calling the &lt;STRONG&gt;GetRealSurface&lt;/STRONG&gt; function. Then &lt;STRONG&gt;this real surface&lt;BR /&gt;
	can be used as usual&lt;/STRONG&gt;. For example, to get access to surface data plug-in function should call&lt;BR /&gt;
	Lock function from FrameAllocator exposed by core interface.&lt;/P&gt;

&lt;P&gt;So, Opaque&amp;nbsp;memory can be used as usual in MSDK plugin. and can't be read content in application. I think the answer is Yes, but It only available in MSDK plugin, and usually &lt;STRONG&gt;external frame allocator &lt;/STRONG&gt;can be better control the surface.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 04:18:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076502#M9094</guid>
      <dc:creator>Jiandong_Z_Intel</dc:creator>
      <dc:date>2015-12-09T04:18:21Z</dc:date>
    </item>
    <item>
      <title>Thanks Zachary for the</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076503#M9095</link>
      <description>&lt;P&gt;Thanks Zachary for the explanation. That does not seem to be an easy task. Is there any example code demonstrating how it can be done?&lt;/P&gt;

&lt;P&gt;-Robby&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 18:19:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076503#M9095</guid>
      <dc:creator>Robby_S</dc:creator>
      <dc:date>2015-12-09T18:19:54Z</dc:date>
    </item>
    <item>
      <title>Hi Robby,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076504#M9096</link>
      <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;Actually I want to suggest you change &lt;STRONG&gt;opaque memory&lt;/STRONG&gt; to &lt;STRONG&gt;external frame allocator.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;no need create a MSDK plugin for read content of opaque memory &amp;nbsp;if the application specifies an &lt;STRONG&gt;external frame allocator&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;In MSDK sample code vaapiFrameAllocator(&amp;lt;MSDK samples&amp;gt;\sample_common\src\vaapi_allocator.cpp) is an &lt;STRONG&gt;external frame allocator.&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;mfxStatus CDecodingPipeline::CreateAllocator() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .............

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create VAAPI allocator
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pMFXAllocator = new vaapiFrameAllocator;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSDK_CHECK_POINTER(m_pMFXAllocator, MFX_ERR_MEMORY_ALLOC);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vaapiAllocatorParams *p_vaapiAllocParams = new vaapiAllocatorParams;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSDK_CHECK_POINTER(p_vaapiAllocParams, MFX_ERR_MEMORY_ALLOC);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_vaapiAllocParams-&amp;gt;m_dpy = va_dpy;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pmfxAllocatorParams = p_vaapiAllocParams;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* In case of video memory we must provide MediaSDK with external allocator
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thus we demonstrate "external allocator" usage model.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call SetAllocator to pass allocator to mediasdk */
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sts = m_mfxSession.SetFrameAllocator(m_pMFXAllocator);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ............
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 04:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076504#M9096</guid>
      <dc:creator>Jiandong_Z_Intel</dc:creator>
      <dc:date>2015-12-10T04:22:00Z</dc:date>
    </item>
    <item>
      <title>Hi Zachary,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076505#M9097</link>
      <description>&lt;P&gt;Hi Zachary,&lt;/P&gt;

&lt;P&gt;Correct me if I am wrong, but my understanding is that the advantage of the opaque memory is that an application developer does not need to worry about &lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;frame allocators&lt;/SPAN&gt;.&lt;/P&gt;

&lt;P&gt;Per our discussions so far, I see little point in trying to get MSDK and OpenCL to inter-operate using the opaque memory. In my case anyway, I need MSDK and OpenCL inter-operation so as to run OpenCL on the GPU. It probably makes more sense to simply use the video memory instead. Am I right ?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;(Actually I suspect that's the most common user scenarios.)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;Robby&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 18:18:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076505#M9097</guid>
      <dc:creator>Robby_S</dc:creator>
      <dc:date>2015-12-10T18:18:53Z</dc:date>
    </item>
    <item>
      <title>Hi Robby,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076506#M9098</link>
      <description>&lt;P&gt;Hi Robby,&lt;/P&gt;

&lt;P&gt;Yes, opaque has it's advantage.&amp;nbsp; but it also has shortcoming, for better control&amp;nbsp; and extend for software. my personal point is &lt;STRONG&gt;external frame allocator &lt;/STRONG&gt;can bring more benefit&lt;STRONG&gt;.&amp;nbsp;&lt;/STRONG&gt; Actually I thinking we are discussing the software designation, we always balance on software designation, more powerful or&amp;nbsp;more simply. Sometimes it depends on software complexion and&amp;nbsp;&amp;nbsp;it is hard to make a decision.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Zachary&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 02:30:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/MFX-MSDK-and-OpenCL-interop-on-Linux/m-p/1076506#M9098</guid>
      <dc:creator>Jiandong_Z_Intel</dc:creator>
      <dc:date>2015-12-14T02:30:50Z</dc:date>
    </item>
  </channel>
</rss>

