• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.distributedsched.abilityConnectionManager (Cross-Device Connection Management) (System API)
2
3The **abilityConnectionManager** module provides APIs for cross-device connection management. After successful networking between devices (login with the same account and enabling of Bluetooth on the devices), a system application and third-party application can start a [UIAbility](../apis-ability-kit/js-apis-app-ability-uiAbility.md) of the same application across the devices. After a connection is successfully established, data can be transmitted across the devices, including strings, [ArrayBuffer](../../arkts-utils/arraybuffer-object.md) byte streams, images, and transport streams.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 18. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs provided by this module are system APIs.
10
11## Modules to Import
12
13```js
14import { abilityConnectionManager } from '@kit.DistributedServiceKit';
15```
16
17## abilityConnectionManager.on('collaborateEvent')
18
19on(type: 'collaborateEvent', sessionId: number, callback: Callback<CollaborateEventInfo>): void
20
21Registers a listener for the **collaborateEvent** events.
22
23**System capability**: SystemCapability.DistributedSched.AppCollaboration
24
25**System API**: This is a system API.
26
27**Parameters**
28
29| Name      | Type                                   | Mandatory  | Description   |
30| --------- | ------------------------------------- | ---- | ----- |
31| type | string  | Yes   |   Event type, which is **collaborateEvent**. This event is triggered when `collaborateEvent()` is called.  |
32| sessionId | number  | Yes   | Collaboration session ID.   |
33| callback | Callback<[CollaborateEventInfo](js-apis-distributed-abilityConnectionManager.md#CollaborateEventInfo)> | Yes   | Registered callback.   |
34
35**Error codes**
36
37For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
38
39| ID| Error Message|
40| ------- | -------------------------------- |
41| 201      | Permission verification failed. The application does not have the permission required to call the API.|
42| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
43
44**Example**
45
46  ```ts
47  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
48  import { hilog } from '@kit.PerformanceAnalysisKit';
49
50  let sessionId = 100;
51  abilityConnectionManager.on("collaborateEvent", sessionId, (callbackInfo) => {
52    hilog.info(0x0000, 'testTag', 'session collaborateEvent, eventType is', callbackInfo.eventType);
53  });
54  ```
55
56## abilityConnectionManager.on('receiveImage')
57
58on(type: 'receiveImage', sessionId: number, callback: Callback<EventCallbackInfo>): void
59
60Registers a listener for the **receiveImage** events.
61
62**System capability**: SystemCapability.DistributedSched.AppCollaboration
63
64**System API**: This is a system API.
65
66**Parameters**
67
68| Name      | Type                                   | Mandatory  | Description   |
69| --------- | ------------------------------------- | ---- | ----- |
70| type | string  | Yes   |   Event type, which is **receiveImage**. This event is triggered when `sendImage()` is called.  |
71| sessionId | number  | Yes   | Collaboration session ID.   |
72| callback | Callback<[EventCallbackInfo](js-apis-distributed-abilityConnectionManager.md#eventcallbackinfo)> | Yes   | Registered callback.   |
73
74**Error codes**
75
76For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
77
78| ID| Error Message|
79| ------- | -------------------------------- |
80| 201      | Permission verification failed. The application does not have the permission required to call the API.|
81| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
82
83**Example**
84
85  ```ts
86  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
87  import { hilog } from '@kit.PerformanceAnalysisKit';
88
89  abilityConnectionManager.on("receiveImage", sessionId, (callbackInfo) => {
90    hilog.info(0x0000, 'testTag', 'session receiveImage, sessionId is', callbackInfo.sessionId);
91  });
92  ```
93
94## abilityConnectionManager.off('collaborateEvent')
95
96off(type: 'collaborateEvent', sessionId: number, callback?: Callback<CollaborateEventInfo>): void
97
98Unregisters the listener for the **collaborateEvent** events.
99
100**System capability**: SystemCapability.DistributedSched.AppCollaboration
101
102**System API**: This is a system API.
103
104**Parameters**
105
106| Name      | Type                                   | Mandatory  | Description   |
107| --------- | ------------------------------------- | ---- | ----- |
108| type | string  | Yes   |   Event type, which is **collaborateEvent**.   |
109| sessionId | number  | Yes   | Collaboration session ID.   |
110| callback | Callback<[CollaborateEventInfo](js-apis-distributed-abilityConnectionManager.md#CollaborateEventInfo)> | No   | Registered callback. If a value is passed in, listening will be disabled for the specified event callback. If no value is passed in, listening will be disabled for all event callbacks.   |
111
112**Error codes**
113
114For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
115
116| ID| Error Message|
117| ------- | -------------------------------- |
118| 201      | Permission verification failed. The application does not have the permission required to call the API.|
119| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
120
121**Example**
122
123  ```ts
124  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
125  import { hilog } from '@kit.PerformanceAnalysisKit';
126
127  let sessionId = 100;
128  abilityConnectionManager.off("collaborateEvent", sessionId);
129  ```
130
131## abilityConnectionManager.off('receiveImage')
132
133off(type: 'receiveImage', sessionId: number, callback?: Callback<EventCallbackInfo>): void
134
135Unregisters the listener for the **receiveImage** events.
136
137**System capability**: SystemCapability.DistributedSched.AppCollaboration
138
139**System API**: This is a system API.
140
141**Parameters**
142
143| Name      | Type                                   | Mandatory  | Description   |
144| --------- | ------------------------------------- | ---- | ----- |
145| type | string  | Yes   |   Event type, which is **receiveImage**.   |
146| sessionId | number  | Yes   | Collaboration session ID.   |
147| callback | Callback<[EventCallbackInfo](js-apis-distributed-abilityConnectionManager.md#eventcallbackinfo)> | No   | Registered callback. If a value is passed in, listening will be disabled for the specified event callback. If no value is passed in, listening will be disabled for all event callbacks.   |
148
149**Error codes**
150
151For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
152
153| ID| Error Message|
154| ------- | -------------------------------- |
155| 201      | Permission verification failed. The application does not have the permission required to call the API.|
156| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
157
158**Example**
159
160  ```ts
161  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
162  import { hilog } from '@kit.PerformanceAnalysisKit';
163
164  let sessionId = 100;
165  abilityConnectionManager.off("receiveImage", sessionId);
166  ```
167
168## abilityConnectionManager.sendImage
169
170sendImage(sessionId: number, image: image.PixelMap, quality?: number): Promise<void>
171
172Sends images from one device to another after a connection is successfully established.
173
174**System capability**: SystemCapability.DistributedSched.AppCollaboration
175
176**System API**: This is a system API.
177
178**Parameters**
179
180| Name      | Type                                     | Mandatory  | Description   |
181| --------- | --------------------------------------- | ---- | ----- |
182| sessionId | number | Yes   | Collaboration session ID.|
183| image | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | Yes   | Image information.|
184| quality | number | No   | Image compression quality. The value ranges from 0 to 100. The default value is **30**.|
185
186**Return value**
187
188| Type                 | Description              |
189| ------------------- | ---------------- |
190| Promise<void> | Promise that returns no value.|
191
192**Error codes**
193
194For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
195
196| ID| Error Message|
197| ------- | -------------------------------- |
198| 201      | Permission verification failed. The application does not have the permission required to call the API.|
199| 202      | Permission verification failed. A non-system application calls a system API.|
200| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
201
202**Example**
203
204  ```ts
205  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
206  import { hilog } from '@kit.PerformanceAnalysisKit';
207  import { photoAccessHelper } from '@kit.MediaLibraryKit';
208  import { image } from '@kit.ImageKit';
209  import { fileIo as fs } from '@kit.CoreFileKit';
210
211  try {
212    let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
213    photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
214    photoSelectOptions.maxSelectNumber = 5;
215    let photoPicker = new photoAccessHelper.PhotoViewPicker();
216    photoPicker.select(photoSelectOptions).then((photoSelectResult) => {
217      if (!photoSelectResult) {
218        hilog.error(0x0000, 'testTag', 'photoSelectResult = null');
219      return;
220      }
221
222      let file = fs.openSync(photoSelectResult.photoUris[0], fs.OpenMode.READ_ONLY);
223      hilog.info(0x0000, 'testTag', 'file.fd:' + file.fd);
224
225      let sessionId = 100;
226      let imageSourceApi: image.ImageSource = image.createImageSource(file.fd);
227      if (imageSourceApi) {
228        imageSourceApi.createPixelMap().then((pixelMap) => {
229          abilityConnectionManager.sendImage(sessionId, pixelMap)
230        });
231      } else {
232        hilog.info(0x0000, 'testTag', 'imageSourceApi is undefined');
233      }
234    })
235  } catch (error) {
236    hilog.error(0x0000, 'testTag', 'photoPicker failed with error: ' + JSON.stringify(error));
237  }
238  ```
239
240## abilityConnectionManager.createStream
241
242createStream(sessionId: number, param: StreamParam): Promise<number>
243
244Creates transport streams to send images and videos from one device to another after a connection is successfully established.
245
246**System capability**: SystemCapability.DistributedSched.AppCollaboration
247
248**System API**: This is a system API.
249
250**Parameters**
251
252| Name      | Type                                     | Mandatory  | Description   |
253| --------- | --------------------------------------- | ---- | ----- |
254| sessionId | number | Yes   | Collaboration session ID.|
255| param | [StreamParam](#streamparam) | Yes   | Transport stream configuration.|
256
257**Return value**
258
259| Type                 | Description              |
260| ------------------- | ---------------- |
261| Promise<number> | Promise used to return the result. The number in the promise indicates the creation result.|
262
263**Error codes**
264
265For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Device Management Error Codes](./errorcode-device-manager.md).
266
267| ID| Error Message|
268| ------- | -------------------------------- |
269| 201      | Permission verification failed. The application does not have the permission required to call the API.|
270| 202      | Permission verification failed. A non-system application calls a system API.|
271| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
272| 32300001      | Only one stream can be created for the current session.|
273| 32300003      | Bitrate not supported.|
274| 32300004      | Color space not supported.|
275
276**Example**
277
278  ```ts
279  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
280  import { hilog } from '@kit.PerformanceAnalysisKit';
281
282  hilog.info(0x0000, 'testTag', 'startStream');
283  let sessionId = 100;
284  abilityConnectionManager.createStream(sessionId ,{name: 'receive', role: 0}).then(async (streamId) => {
285    let surfaceParam: abilityConnectionManager.SurfaceParam = {
286      width: 640,
287      height: 480,
288      format: 1
289    }
290    let surfaceId = abilityConnectionManager.getSurfaceId(streamId, surfaceParam);
291    hilog.info(0x0000, 'testTag', 'surfaceId is'+surfaceId);
292    AppStorage.setOrCreate<string>('surfaceId', surfaceId);
293    abilityConnectionManager.startStream(streamId);
294  })
295  ```
296
297## abilityConnectionManager.setSurfaceId
298
299setSurfaceId(sessionId:&nbsp;number,&nbsp;surfaceId:&nbsp;string,&nbsp;param:&nbsp;SurfaceParam):&nbsp;void
300
301Sets the binding relationship between transport streams and surfaces.
302
303**System capability**: SystemCapability.DistributedSched.AppCollaboration
304
305**System API**: This is a system API.
306
307**Parameters**
308
309| Name      | Type                                     | Mandatory  | Description   |
310| --------- | --------------------------------------- | ---- | ----- |
311| sessionId | number | Yes   | Collaboration session ID.|
312| surfaceId | string | Yes   | Unique surface ID.|
313| param | [SurfaceParam](#surfaceparam) | Yes   | Surface configuration.|
314
315**Error codes**
316
317For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
318
319| ID| Error Message|
320| ------- | -------------------------------- |
321| 202      | Permission verification failed. A non-system application calls a system API.|
322| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
323
324**Example**
325
326  ```ts
327  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
328  import { hilog } from '@kit.PerformanceAnalysisKit';
329
330  hilog.info(0x0000, 'testTag', 'setSurfaceId');
331  let sessionId = 100;
332  abilityConnectionManager.createStream(sessionId ,{name: 'receive', role: 0}).then(async (streamId) => {
333    let surfaceParam: abilityConnectionManager.SurfaceParam = {
334      width: 640,
335      height: 480,
336      format: 1
337    }
338    let surfaceId = abilityConnectionManager.getSurfaceId(streamId, surfaceParam);
339    abilityConnectionManager.setSurfaceId(streamId, surfaceId, surfaceParam);
340  })
341  ```
342
343## abilityConnectionManager.getSurfaceId
344
345getSurfaceId(sessionId:&nbsp;number,&nbsp;param:&nbsp;SurfaceParam):&nbsp;string
346
347Obtains the unique ID of the surface bound to the specified transport streams.
348
349**System capability**: SystemCapability.DistributedSched.AppCollaboration
350
351**System API**: This is a system API.
352
353**Parameters**
354
355| Name      | Type                                     | Mandatory  | Description   |
356| --------- | --------------------------------------- | ---- | ----- |
357| sessionId | number | Yes   | Collaboration session ID.|
358| param | [SurfaceParam](#surfaceparam) | Yes   | Surface configuration.|
359
360**Return value**
361
362| Type                 | Description              |
363| ------------------- | ---------------- |
364| string | Unique ID of the surface.|
365
366**Error codes**
367
368For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
369
370| ID| Error Message|
371| ------- | -------------------------------- |
372| 202      | Permission verification failed. A non-system application calls a system API.|
373| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
374
375**Example**
376
377  ```ts
378  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
379  import { hilog } from '@kit.PerformanceAnalysisKit';
380
381  hilog.info(0x0000, 'testTag', 'getSurfaceId');
382  let sessionId = 100;
383  abilityConnectionManager.createStream(sessionId ,{name: 'receive', role: 0}).then(async (streamId) => {
384    let surfaceParam: abilityConnectionManager.SurfaceParam = {
385      width: 640,
386      height: 480,
387      format: 1
388    }
389    let surfaceId = abilityConnectionManager.getSurfaceId(streamId, surfaceParam);
390  })
391  ```
392
393## abilityConnectionManager.updateSurfaceParam
394
395updateSurfaceParam(sessionId:&nbsp;number,&nbsp;param:&nbsp;SurfaceParam):&nbsp;void
396
397Updates the configuration of the surface bound to the specified transport streams.
398
399**System capability**: SystemCapability.DistributedSched.AppCollaboration
400
401**System API**: This is a system API.
402
403**Parameters**
404
405| Name      | Type                                     | Mandatory  | Description   |
406| --------- | --------------------------------------- | ---- | ----- |
407| sessionId | number | Yes   | Collaboration session ID.|
408| param | [SurfaceParam](#surfaceparam) | Yes   | Surface configuration.|
409
410**Error codes**
411
412For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
413
414| ID| Error Message|
415| ------- | -------------------------------- |
416| 202      | Permission verification failed. A non-system application calls a system API.|
417| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
418
419**Example**
420
421  ```ts
422  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
423  import { hilog } from '@kit.PerformanceAnalysisKit';
424
425  hilog.info(0x0000, 'testTag', 'updateSurfaceParam');
426  let sessionId = 100;
427  abilityConnectionManager.createStream(sessionId ,{name: 'receive', role: 0}).then(async (streamId) => {
428    let surfaceParam: abilityConnectionManager.SurfaceParam = {
429      width: 640,
430      height: 480,
431      format: 1
432    }
433    abilityConnectionManager.updateSurfaceParam(streamId, surfaceParam);
434  })
435  ```
436
437## abilityConnectionManager.destroyStream
438
439destroyStream(sessionId:&nbsp;number):&nbsp;void
440
441Destroys the transport streams after the sending of images and videos is complete.
442
443**System capability**: SystemCapability.DistributedSched.AppCollaboration
444
445**System API**: This is a system API.
446
447**Parameters**
448
449| Name      | Type                                     | Mandatory  | Description   |
450| --------- | --------------------------------------- | ---- | ----- |
451| sessionId | number | Yes   | Collaboration session ID.|
452
453**Error codes**
454
455For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
456
457| ID| Error Message|
458| ------- | -------------------------------- |
459| 201      | Permission verification failed. The application does not have the permission required to call the API.|
460| 202      | Permission verification failed. A non-system application calls a system API.|
461| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
462
463**Example**
464
465  ```ts
466  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
467  import { hilog } from '@kit.PerformanceAnalysisKit';
468
469  let sessionId = 100;
470  hilog.info(0x0000, 'testTag', 'destroyStream called');
471  abilityConnectionManager.destroyStream(sessionId)
472  ```
473
474## abilityConnectionManager.startStream
475
476startStream(sessionId:&nbsp;number):&nbsp;void
477
478Starts transmission of the specified transport streams.
479
480**System capability**: SystemCapability.DistributedSched.AppCollaboration
481
482**System API**: This is a system API.
483
484**Parameters**
485
486| Name      | Type                                     | Mandatory  | Description   |
487| --------- | --------------------------------------- | ---- | ----- |
488| sessionId | number | Yes   | Collaboration session ID.|
489
490**Error codes**
491
492For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Device Management Error Codes](./errorcode-device-manager.md).
493
494| ID| Error Message|
495| ------- | -------------------------------- |
496| 202      | Permission verification failed. A non-system application calls a system API.|
497| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
498| 32300002      | The stream at the receive end is not started. |
499
500**Example**
501
502  ```ts
503  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
504  import { hilog } from '@kit.PerformanceAnalysisKit';
505
506  let sessionId = 100;
507  hilog.info(0x0000, 'testTag', 'startStream called');
508  abilityConnectionManager.startStream(sessionId)
509  ```
510
511## abilityConnectionManager.stopStream
512
513stopStream(sessionId:&nbsp;number):&nbsp;void
514
515Stops transmission of the specified transport streams.
516
517**System capability**: SystemCapability.DistributedSched.AppCollaboration
518
519**System API**: This is a system API.
520
521**Parameters**
522
523| Name      | Type                                     | Mandatory  | Description   |
524| --------- | --------------------------------------- | ---- | ----- |
525| sessionId | number | Yes   | Collaboration session ID.|
526
527**Error codes**
528
529For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
530
531| ID| Error Message|
532| ------- | -------------------------------- |
533| 202      | Permission verification failed. A non-system application calls a system API.|
534| 401      | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
535
536**Example**
537
538  ```ts
539  import { abilityConnectionManager } from '@kit.DistributedServiceKit';
540  import { hilog } from '@kit.PerformanceAnalysisKit';
541
542  let sessionId = 100;
543  hilog.info(0x0000, 'testTag', 'stopStream called');
544  abilityConnectionManager.stopStream(sessionId)
545  ```
546
547## CollaborateEventInfo
548
549Defines the collaboration event information.
550
551**System capability**: SystemCapability.DistributedSched.AppCollaboration
552
553| Name      | Type  | Readable  | Writable  | Mandatory  | Description     |
554| -------- | ------ | ---- | ---- | ---- | ------- |
555| eventType | [CollaborateEventType](#collaborateeventtype) | Yes   | No   | Yes   | Collaboration event type.|
556| eventMsg | string | Yes   | No   | No   | Collaboration event message.|
557
558## StreamParam
559
560Defines stream transmission configuration parameters.
561
562**System capability**: SystemCapability.DistributedSched.AppCollaboration
563
564| Name      | Type   | Readable  | Writable  | Mandatory  | Description         |
565| -------- | ------ | ---- | ---- | ---- | ----------- |
566| name  | string   | Yes   | No   | Yes   |   Stream name. It must be the same on the TX end and RX end.|
567| role  | [StreamRole](#streamrole)     | Yes   | No   | Yes   |   Stream role, which can be TX stream or RX stream.|
568| bitrate  | number   | Yes   | No   | No   |   Video bit rate. It is valid only for the TX end. The default value is **80000**.|
569| colorSpaceConversionTarget  | [colorSpaceManager.ColorSpace](../apis-arkgraphics2d/js-apis-colorSpaceManager.md#colorspace)     | Yes   | No   | No   |  Target color space.|
570
571## SurfaceParam
572
573Defines the surface configuration.
574
575**System capability**: SystemCapability.DistributedSched.AppCollaboration
576
577| Name      | Type  | Readable  | Writable  | Mandatory  | Description     |
578| -------- | ------ | ---- | ---- | ---- | ------- |
579| width | number | Yes   | No   | Yes   | Encoding width. Set this parameter prior to stream transmission. Once stream transmission starts, the setting cannot be updated until the stream transmission ends. If you need to update the setting, stop stream transmission first.|
580| height | number | Yes   | No   | Yes  | Encoding length. Set this parameter prior to stream transmission. Once stream transmission starts, the setting cannot be updated until the stream transmission ends. If you need to update the setting, stop stream transmission first.|
581| format | [VideoPixelFormat](#videopixelformat) | Yes   | No   | No   | Video pixel format (valid only at the TX end).|
582| rotation | number | Yes   | No   | No   | Rotation angle of the video. The value range is {0, 90, 180, 270}. The default value is **0**.|
583| flip | [FlipOptions](#flipoptions) | Yes   | No   | No   | Video flip option.|
584
585## CollaborateEventType
586
587Enumerates collaboration event types.
588
589**System capability**: SystemCapability.DistributedSched.AppCollaboration
590
591| Value| Description|
592| -------- | -------- |
593| SEND_FAILURE   | Task sending failure.|
594| COLOR_SPACE_CONVERSION_FAILURE | Color space conversion failure.|
595
596## FlipOptions
597
598Enumerates video flip options.
599
600**System capability**: SystemCapability.DistributedSched.AppCollaboration
601
602| Value| Description|
603| -------- | -------- |
604| HORIZONTAL   | Horizontal flip.|
605| VERTICAL | Vertical flip.|
606
607## StreamRole
608
609Enumerates stream transmission modes.
610
611**System capability**: SystemCapability.DistributedSched.AppCollaboration
612
613| Value| Description|
614| -------- | -------- |
615| SOURCE  | TX stream.|
616| SINK  | RX stream.|
617
618## VideoPixelFormat
619
620Enumerates video pixel formats.
621
622**System capability**: SystemCapability.DistributedSched.AppCollaboration
623
624| Value| Description|
625| -------- | -------- |
626| UNKNOWN   | Unknown pixel format.|
627| NV12  | NV12, YUV420 semi-planar format.|
628| NV21  | NV21, YUV420 semi-planar format.|
629
630## ConnectOptions
631
632Defines the connection options for the application.
633
634**System capability**: SystemCapability.DistributedSched.AppCollaboration
635
636| Name         | Type   | Read-Only  | Optional  | Description         |
637| ----------- | ------- | ---- | ---- | ----------- |
638| needSendStream    | boolean  | No   | No   | Whether to send streams. The value **true** means to send streams, and the value **false** means the opposite.   |
639| needReceiveStream    | boolean  | No   | No   | Whether to receive streams. The value **true** means to receive streams, and the value **false** means the opposite.    |
640
641## EventCallbackInfo
642
643Defines the event callback information.
644
645**System capability**: SystemCapability.DistributedSched.AppCollaboration
646
647| Name      | Type   | Readable  | Writable  | Description         |
648| -------- | ------ | ---- | ---- | ----------- |
649| image  | image.PixelMap | Yes   | No   |   Received image.|
650
651## StartOptionParams
652
653Enumerates application start options.
654
655**System capability**: SystemCapability.DistributedSched.AppCollaboration
656
657| Name|  Value| Description|
658|-------|-------|-------|
659| START_IN_BACKGROUND | 1 |Start of the peer application in the background.|
660