## Overview
The Parsec SDK allows your application to make interactive, low-latency peer-to-peer connections for the purpose of game streaming. The SDK handles the low level internals of peer-to-peer connectivity, networking, and hardware accelerated video/audio processing. It is lightweight, consisting of a [single header file](/sdk/parsec.h) and a shared object < 5MB.
#### Hosting
The `ParsecHost` portion of the SDK allows a host to accept incoming client connections (guests). There are two modes of operation: **game mode** and **desktop mode**.
Game mode allows your game to add multiplayer functionality to an otherwise local only game. This is achieved via a tight integration into your game's render loop. Game mode requires that the application call one of the `ParsecHostSubmitFrame` functions (supporting OpenGL, D3D9, and D3D11) and `ParsecHostSubmitAudio`. Input is polled via `ParsecHostPollInput`, exposing input events much like they would appear locally. In game mode, Parsec can only interact with your game and has no access to the OS or any other application.
Additionally, game mode can be used to make any game entirely headless from the host's point of view. The game window, rendering swap chain, and audio playback can be removed, leaving the game to accept input from and invisibly output data to Parsec connected guests.
Desktop mode shares the host's entire desktop (or any fullscreen application) and adds additional permissions/approval to the connection process.
#### Client
The `ParsecClient` portion of the SDK provides everything necessary to make a connection to a host, send gamepad/mouse/keyboard input, and receive video/audio output from the host. The `ParsecClientRender` family of functions allow the client application to efficiently render the incoming frames with OpenGL, D3D9, D3D11, or Metal.
## Examples
#### Game Mode Hosting with Unity
The Parsec SDK provides the [ParsecUnity](/sdk/ParsecUnity) module for easy integration in Unity games. See [examples/unity](/examples/unity) for details.
#### Windows, macOS, Linux Clients
The [client](/examples/client) example demonstrates the most complete implementation of the client SDK. It uses the cross platform [libmatoya](https://github.com/matoya/libmatoya) library to handle window creation, rendering, audio playback, and input handling. Windows, macOS, and x86-64 Linux are supported.
#### iOS and Android Clients
The [ios](/examples/ios) and [android](/examples/android) examples demonstrate audio playback, rendering, and basic input capabilities of the client SDK. The Android example provides a simple JNI bindings package to expose a subset of the C API in Java.
#### Desktop Mode Hosting
The [host](/examples/host) example is a succinct implementation of desktop hosting functionality. Desktop hosting is currently only available on Windows.
#### Web Client
The Parsec Web SDK provides a fully wrapped Parsec client interface only requiring a `<video>` and `<audio>` element for initialization. The performance is limited compared to the native SDK clients. See [examples/web](/examples/web) and [sdk/web](/sdk/web) for details.
## Documentation
Documentation is procedurally generated from the [parsec.h](/sdk/parsec.h) header file.
https://parsecgaming.com/docs/sdk
## Obtaining a `sessionID` and `peerID`
The SDK requires a `sessionID` and `peerID` obtained through the Parsec API to identify users and make secure connections. There are three methods of obtaining a `sessionID`:
- For quick start, testing, and personal use only, see [api/personal](/api/personal). The `/v1/auth` API call may NOT be used in any application distributed to the public or in any enterprise use case.
- For third party distribution intended for other Parsec users, see [api/third-party](/api/third-party) for OAuth style access delegation.
- For enterprise customers, see [api/enterprise](/api/enterprise).
## Sharing Private Hosts
The Parsec SDK supports a `secret` property on both the `ParsecHostConfig` and `ParsecClientConfig` structs. If the host sets a secret during `ParsecHostStart`, the client must also provide the same secret during `ParsecClientConnect` in order to make a connection. Your application may choose how to privately share both this `secret` and the host's `peerID` to facilitate features such as link sharing or private games.
For simple link sharing testing, you may use the URL template https://parsec.gg/g/{peerID}/{secret}/, however this template is used by the Parsec consumer application and may change without notice. It is highly recommended that your application uses a custom method for sharing the `peerID` and `secret`.
## Using Runtime Linking (DSO)
If `PARSEC_DSO` is defined before including [parsec.h](/sdk/parsec.h), the header will export a `struct` containing function pointers for use with runtime linking. There is a convenience header which makes DSO easy to use called [parsec-dso.h](/sdk/parsec-dso.h) in the [sdk](/sdk) directory. The [client](/examples/client) and [host](/examples/host) examples use DSO. There are a few differences when using the [parsec-dso.h](/sdk/parsec-dso.h) header instead of [parsec.h](/sdk/parsec.h):
- The `Parsec *` context is now `ParsecDSO *`.
- All global functions that do not normally take a `Parsec *` context now need to take `ParsecDSO *` as their first argument, such as `ParsecSetLogCallback`.
- The signature for `ParsecInit` changes to to take an additional `char *` argument specifying the name of the shared object.
- `ParsecInit` may return `SO_ERR_OPEN` or `SO_ERR_SYMBOL` if runtime linking was unsuccessful.
## Bindings
Bindings are maintained by third party developers (thank you!). If you're interested in another language and would like to create a binding, please submit an issue or contact us via [sdk@parsecgaming.com](mailto:sdk@parsecgaming.com).
| Language | Maintainer | Repo |
|----------|------------|------|
| Java | [Richard Smith](https://github.com/electronstudio) | [electronstudio/parsec-java](https://github.com/electronstudio/parsec-java)
## Community
For questions, suggestions, concerns, and support, visit the [Parsec SDK Server on Discord](https://discord.gg/xQaTQt2).
没有合适的资源?快使用搜索试试~ 我知道了~
parsec-sdk:低延迟,点对点,交互式游戏流
共205个文件
asset:46个
meta:22个
md:14个
5星 · 超过95%的资源 需积分: 50 7 下载量 15 浏览量
2021-05-13
01:34:58
上传
评论
收藏 21.04MB ZIP 举报
温馨提示
概述 Parsec SDK允许您的应用程序进行交互式,低延迟的点对点连接,以进行游戏流传输。 SDK处理点对点连接,网络和硬件加速的视频/音频处理的低级内部。 它是轻量级的,由一个和一个共享对象<5MB组成。 代管 SDK的ParsecHost部分允许主机接受传入的客户端连接(来宾)。 有两种操作模式:游戏模式和桌面模式。 游戏模式允许您的游戏将多人游戏功能添加到其他本机仅限本地的游戏中。 这可以通过紧密集成到游戏的渲染循环中来实现。 游戏模式要求应用程序调用ParsecHostSubmitFrame函数之一(支持OpenGL,D3D9和D3D11)和ParsecHostSubmitAudio 。 通过ParsecHostPollInput轮询输入,从而像暴露在本地一样暴露输入事件。 在游戏模式下,Parsec只能与您的游戏进行交互,而无法访问操作系统或任何其他应用程序。 此外,从主机
资源详情
资源评论
资源推荐
收起资源包目录
parsec-sdk:低延迟,点对点,交互式游戏流 (205个子文件)
libmatoya.a 597KB
libmatoya.a 505KB
AnnotationManager 4KB
AnnotationManager 4KB
InputManager.asset 122KB
ProjectSettings.asset 18KB
ProjectSettings.asset 18KB
ProjectSettings.asset 18KB
ProjectSettings.asset 18KB
InputManager.asset 6KB
EditorUserBuildSettings.asset 5KB
EditorUserBuildSettings.asset 5KB
QualitySettings.asset 5KB
QualitySettings.asset 5KB
InspectorExpandedItems.asset 4KB
InspectorExpandedItems.asset 4KB
EditorUserSettings.asset 4KB
EditorUserSettings.asset 4KB
BuildSettings.asset 4KB
BuildSettings.asset 4KB
TilemapEditorUserSettings.asset 4KB
TilemapEditorUserSettings.asset 4KB
SpriteAtlasDatabase.asset 4KB
SpriteAtlasDatabase.asset 4KB
MonoManager.asset 4KB
MonoManager.asset 4KB
GraphicsSettings.asset 2KB
GraphicsSettings.asset 2KB
Physics2DSettings.asset 1KB
Physics2DSettings.asset 1KB
NavMeshAreas.asset 1KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
DynamicsManager.asset 1KB
UnityConnectSettings.asset 812B
UnityConnectSettings.asset 812B
EditorSettings.asset 632B
EditorSettings.asset 632B
TagManager.asset 378B
TagManager.asset 378B
AudioManager.asset 357B
AudioManager.asset 357B
TimeManager.asset 202B
TimeManager.asset 202B
NetworkManager.asset 151B
NetworkManager.asset 151B
EditorBuildSettings.asset 138B
EditorBuildSettings.asset 138B
ClusterInputManager.asset 114B
ClusterInputManager.asset 114B
assetDatabase3 8.16MB
assetDatabase3 6.68MB
AssetImportState 10B
AssetImportState 10B
gradlew.bat 2KB
runmefirst.bat 824B
bindings.c 5KB
main.c 5KB
implementation.c 5KB
audio.c 3KB
aaudio.c 2KB
main.c 2KB
GameManager.cs 6KB
GameManager.cs 4KB
PlayerMovement.cs 2KB
PlayerManager.cs 1KB
PlayerMovement.cs 1KB
PlayerManager.cs 815B
style.css 532B
parsec.dll 1.86MB
parsec32.dll 1.52MB
ParsecUnity46.dll 71KB
CurrentLayout.dwlt 18KB
CurrentLayout.dwlt 16KB
libparsec.dylib 1.75MB
expandedItems 4KB
expandedItems 4KB
ParsecSDK.framework 39B
.gitignore 1KB
GNUmakefile 960B
GNUmakefile 266B
build.gradle 1KB
build.gradle 534B
settings.gradle 15B
gradlew 5KB
matoya.h 145KB
parsec.h 81KB
parsec.h 81KB
parsec.h 81KB
parsec-dso.h 8KB
mtymap.h 5KB
aaudio.h 209B
AppDelegate.h 209B
audio.h 202B
index.html 808B
favicon.ico 108KB
gradle-wrapper.jar 53KB
MainActivity.java 2KB
ClientSurface.java 2KB
Parsec.java 1016B
共 205 条
- 1
- 2
- 3
清净平常心
- 粉丝: 37
- 资源: 4671
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10