You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Syphon is an open source Mac OS X technology that allows applications to share video and still images with one another in realtime.
2
+
3
+
See http://syphon.github.io for more information.
4
+
5
+
This project hosts the Syphon.framework for developers who want to integrate Syphon in their own software. If you are looking for the Syphon plugins for Quartz Composer, Max/Jitter, FFGL, etc, the project for the Syphon Implementations currently at http://github.com/Syphon
The documentation is available online at {\field{\*\fldinst{HYPERLINK "http://syphon.v002.info/FrameworkDocumentationCoreProfile/"}}{\fldrslt http://syphon.v002.info/FrameworkDocumentationCoreProfile/}}.
29
+
\b\
30
+
\
31
+
Core Profile OpenGL\
32
+
\
33
+
34
+
\b0 This is a trial release with support for Core Profile OpenGL. Legacy OpenGL is also supported. Please discuss issues with us on {\field{\*\fldinst{HYPERLINK "https://github.com/Syphon/Syphon-Framework/issues"}}{\fldrslt GitHub}}, or contact us directly via {\field{\*\fldinst{HYPERLINK "mailto:contact@v002.info"}}{\fldrslt contact@v002.info}}. We are particularly interested to hear of any usability or performance issues you run into.\
35
+
36
+
\b\
37
+
38
+
\b0 There were API changes to SyphonClient and SyphonServerDirectory in the previous release. Please read the changes notice carefully.\
\b0\cf0{\listtext\uc0\u8226}Servers can optionally use MSAA and have depth and stencil buffers\
54
+
{\listtext\uc0\u8226}Fix so servers are properly named in command-line applications\
55
+
{\listtext\uc0\u8226}AppNap is suspended for the lifetime of a SyphonServer\
56
+
{\listtext\uc0\u8226}Fix to properly honor publishing a sub-region of a texture\
57
+
{\listtext\uc0\u8226}SyphonClient is now associated with a single CGL context on initialization\
58
+
{\listtext\uc0\u8226}SyphonServerDirectory is better at noticing the disappearance of improperly ended servers\
59
+
{\listtext\uc0\u8226}SyphonServerDirectory\'92s notifications now set the SyphonServerDirectory instance as the notification object, and the dictionary as the associated user info object\
60
+
{\listtext\uc0\u8226}Remove support for deprecated Objective C garbage-collection
Please check the Syphon Framework Issues at {\field{\*\fldinst{HYPERLINK "https://github.com/Syphon/Syphon-Framework/issues"}}{\fldrslt https://github.com/Syphon/Syphon-Framework/issues}}
Syphon can be extended for any IOSurface-based technology using the Syphon Base classes without modifying the framework at all.
6
+
7
+
Import `<Syphon/SyphonSubclassing.h>` in your implementation files to gain access to essential methods for subclasses to use.
8
+
9
+
### Images
10
+
11
+
If your new format is not an Objective C class, implement a new image class by subclassing ``SyphonImageBase`` to expose the surface in your new format. This class should be a minimal wrapper to the contained type.
12
+
13
+
### Servers
14
+
15
+
Implement a server by subclassing ``SyphonServerBase``. Add methods to your subclass to publish frames. When needed, call ``SyphonServerBase/newSurfaceForWidth:height:options:`` to obtain an `IOSurfaceRef`. When you have updated the surface, call ``SyphonServerBase/publish``. Add a method named `-newFrameImage` which returns an instance of your ``SyphonImageBase`` subclass (or the new type directly).
16
+
17
+
### Clients
18
+
19
+
Implement a client by subclassing ``SyphonClientBase``. Add a method named `-newFrameImage` which returns an instance of your ``SyphonImageBase`` subclass. Implement the ``SyphonClientBase/invalidateFrame`` method, noting this may be called on a background thread.
20
+
21
+
### Other Considerations
22
+
23
+
If you override other Syphon Base class methods, be sure to pass them on to the superclass (eg if you override ``SyphonServerBase/stop``, call `[super stop]` from your implementation of ``SyphonServerBase/stop``).
24
+
25
+
If your changes are for a well-used API, please consider making a pull-request or otherwise reaching out to us so we can add them to the project.
The OpenGL server has a similar method, plus methods to bind and unbind the server to the OpenGL context, so you can draw into it directly.
30
+
You can publish new frames as often as you like, but if you only publish when you have a frame different from the previous one, then clients can do less work.
31
+
You must stop the server when you are finished with it:
32
+
33
+
```objc
34
+
[server stop];
35
+
```
36
+
37
+
### Finding Servers
38
+
39
+
Class documentation: ``SyphonServerDirectory``
40
+
41
+
``SyphonServerDirectory`` handles server discovery for you. You can get an array of dictionaries describing available servers:
The servers property can be observed for changes, or you can register to receive the notifications posted by ``SyphonServerDirectory``.
48
+
49
+
Server description dictionaries are used by Syphon when you create a client, and also contain information you can use to describe available servers in your UI:
// you could get the new frame here and update your view
68
+
}];
69
+
```
70
+
71
+
The new-frame handler is optional: you can pass in nil.
72
+
73
+
When you are ready to draw:
74
+
75
+
76
+
```objc
77
+
id<MTLTexture> *frame = [client newFrameImage];
78
+
if (frame)
79
+
{
80
+
// YOUR METAL DRAWING CODE HERE
81
+
82
+
[frame release]; // (if not using ARC)
83
+
}
84
+
```
85
+
86
+
As with servers, you must stop the client when you are finished with it:
87
+
88
+
```objc
89
+
[client stop];
90
+
```
91
+
92
+
### More examples
93
+
94
+
Example projects implementing a server and client are included with the Syphon SDK. You can also examine the source to some Syphon implementations on [GitHub](https://github.com/Syphon).
0 commit comments