Skip to content

Commit df312eb

Browse files
committed
refact: notify buffer format in context
Source buffer format can be reused in context.
1 parent f2feb7d commit df312eb

1 file changed

Lines changed: 46 additions & 21 deletions

File tree

xml/treeland-capture-unstable-v1.xml

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525

2626
<request name="start">
2727
<description summary="start session">
28-
Start session and keeps sending frame.
28+
Start session and keeps sending frame with the given buffer.
2929
</description>
30+
<arg name="buffer" type="object" interface="wl_buffer" allow-null=true summary="buffer to receive frame data, null for export dmabuf"/>
3031
</request>
3132

3233
<request name="frame_done">
@@ -41,9 +42,15 @@
4142
</request>
4243

4344
<event name="frame">
45+
<description summary="notify the client a new frame">
46+
Notify the client that a new frame is coming, client should copy or import dmabuf.
47+
</description>
48+
</event>
49+
50+
<event name="dmabuf_frame">
4451
<description summary="supply the client with information about the frame">
45-
Main event supplying the client with information about the frame. If the capture didn't fail, this event is always
46-
emitted first before any other events.
52+
Main event supplying the client with information about the dmabuf frame.
53+
If the capture didn't fail, this event is directly after the frame event.
4754
When mask is provided, x and y should be offset relative to mask surface origin. Otherwise offset_x and offset_y should always
4855
be zero.
4956
</description>
@@ -59,7 +66,7 @@
5966
<arg name="num_objects" type="uint"/>
6067
</event>
6168

62-
<event name="object">
69+
<event name="dmabuf_object">
6370
<description summary="supply the client with object fd">
6471
</description>
6572
<arg name="index" type="uint"/>
@@ -87,7 +94,6 @@
8794
</description>
8895
<arg name="reason" type="uint" enum="treeland_capture_session_v1.cancel_reason"/>
8996
</event>
90-
9197
</interface>
9298

9399
<interface name="treeland_capture_frame_v1" version="1">
@@ -100,22 +106,6 @@
100106
<entry name="y_inverted" value="0x1" summary="contents are y-inverted"/>
101107
</enum>
102108

103-
<event name="buffer">
104-
<description summary="inform client to prepare buffer">
105-
Inform client to prepare buffer.
106-
</description>
107-
<arg name="format" type="uint" enum="wl_shm.format"/>
108-
<arg name="width" type="uint"/>
109-
<arg name="height" type="uint"/>
110-
<arg name="stride" type="uint"/>
111-
</event>
112-
113-
<event name="buffer_done">
114-
<description summary="all buffer formats have done">
115-
Inform client that all buffer formats supported are emitted.
116-
</description>
117-
</event>
118-
119109
<request name="copy">
120110
<description summary="copy capture contents">
121111
Copy capture contents to provided buffer
@@ -190,6 +180,41 @@
190180
<arg name="source_type" type="uint" enum="source_type" summary="final capture source type"/>
191181
</event>
192182

183+
<event name="source_shm_buffer">
184+
<description summary="notify client the supported shm buffer format">
185+
This event notify the client what kind of shm buffer is supported. It may be sent several times after "source_ready".
186+
If client receives dmabuf notification, it should use dmabuf instead.
187+
</description>
188+
<arg name="format" type="uint" enum="wl_shm.format" summary="shm buffer format"/>
189+
<arg name="width" type="uint" summary="shm buffer width"/>
190+
<arg name="height" type="uint" summary="shm buffer height"/>
191+
<arg name="stride" type="uint" summary="shm buffer stride"/>
192+
</event>
193+
194+
<event name="source_dmabuf">
195+
<description summary="notify client the supported dmabuf format">
196+
This event notify the client what kind of dmabuf is supported. It may be sent several times after "source_ready".
197+
If client receives the notification, it should use dmabuf instead of shm buffer.
198+
</description>
199+
<arg name="format" type="uint" summary="fourcc pixel format"/>
200+
<arg name="width" type="uint" summary="dmabuf width"/>
201+
<arg name="height" type="uint" summary="dmabuf height"/>
202+
</event>
203+
204+
<event name="source_export_dmabuf">
205+
<description summary="notify client that compositor supports export dmabuf">
206+
This event notify the client that compositor supports export dmabuf. It should be sent just once
207+
after "source_ready". Client should prefer export dmabuf over dmabuf or shm buffer.
208+
</description>
209+
</event>
210+
211+
<event name="source_buffer_done">
212+
<description summary="notify client that all supported buffer formats are sent">
213+
This event indicates an end of source_shm_buffer, source_dmabuf and source_export_dmabuf event
214+
sequence.
215+
</description>
216+
</event>
217+
193218
<event name="source_failed">
194219
<description summary="notify client that source selection is failed">
195220
There could a lot of reasons but the most common one is that selector is busy

0 commit comments

Comments
 (0)