| 1 |
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation |
| 2 |
.. |
| 3 |
.. SPDX-License-Identifier: CC-BY-4.0 |
| 4 |
|
| 5 |
.. _surface-sharing: |
| 6 |
|
| 7 |
======================================= |
| 8 |
Importing and Exporting Shared Surfaces |
| 9 |
======================================= |
| 10 |
|
| 11 |
|vpl_short_name| API 2.10 introduces new interfaces for sharing surfaces between |
| 12 |
|vpl_short_name| runtime and other applications, frameworks, and graphics |
| 13 |
APIs. This functionality is only supported when using the :ref:`internal memory |
| 14 |
management<internal-mem-manage>` model. |
| 15 |
|
| 16 |
**Importing** a surface enables |vpl_short_name| to access raw video data as input to encode or VPP |
| 17 |
operations without first mapping the data to system memory and then copying it to |
| 18 |
a surface allocated by |vpl_short_name| runtime using :cpp:member:`mfxFrameSurfaceInterface::Map`. |
| 19 |
|
| 20 |
**Exporting** a surface similarly enables the application to access raw video |
| 21 |
data which is the output of decode or VPP operations and which was allocated by |
| 22 |
|vpl_short_name| runtime, without first mapping to system memory using |
| 23 |
:cpp:member:`mfxFrameSurfaceInterface::Map`. |
| 24 |
|
| 25 |
-------------- |
| 26 |
Import Example |
| 27 |
-------------- |
| 28 |
|
| 29 |
The following code snippet shows an example of importing a shared surface. |
| 30 |
|
| 31 |
.. literalinclude:: ../snippets/prg_surface_sharing.cpp |
| 32 |
:language: c++ |
| 33 |
:start-after: /*beg1*/ |
| 34 |
:end-before: /*end1*/ |
| 35 |
:lineno-start: 1 |
| 36 |
|
| 37 |
-------------- |
| 38 |
Export Example |
| 39 |
-------------- |
| 40 |
|
| 41 |
The following code snippet shows an example of exporting a shared surface. |
| 42 |
|
| 43 |
.. literalinclude:: ../snippets/prg_surface_sharing.cpp |
| 44 |
:language: c++ |
| 45 |
:start-after: /*beg2*/ |
| 46 |
:end-before: /*end2*/ |
| 47 |
:lineno-start: 1 |
| 48 |
|