4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, ByungWook Jang <bw.jang@samsung.com>,
7 * Manoj Kumar K <manojkumar.k@samsung.com>, Abhishek Bajaj <abhi.bajaj@samsung.com>, Nikhilesh Mittal <nikhilesh.m@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __GST_WFD_CONFIG_MESSAGE_H__
24 #define __GST_WFD_CONFIG_MESSAGE_H__
30 #define STRING_WFD_AUDIO_CODECS "wfd_audio_codecs"
31 #define STRING_WFD_VIDEO_FORMATS "wfd_video_formats"
32 #define STRING_WFD_3D_VIDEO_FORMATS "wfd_3d_video_formats"
33 #define STRING_WFD_CONTENT_PROTECTION "wfd_content_protection"
34 #define STRING_WFD_DISPLAY_EDID "wfd_display_edid"
35 #define STRING_WFD_COUPLED_SINK "wfd_coupled_sink"
36 #define STRING_WFD_TRIGGER_METHOD "wfd_trigger_method"
37 #define STRING_WFD_PRESENTATION_URL "wfd_presentation_URL"
38 #define STRING_WFD_CLIENT_RTP_PORTS "wfd_client_rtp_ports"
39 #define STRING_WFD_ROUTE "wfd_route"
40 #define STRING_WFD_I2C "wfd_I2C"
41 #define STRING_WFD_AV_FORMAT_CHANGE_TIMING "wfd_av_format_change_timing"
42 #define STRING_WFD_PREFERRED_DISPLAY_MODE "wfd_preferred_display_mode"
43 #define STRING_WFD_UIBC_CAPABILITY "wfd_uibc_capability"
44 #define STRING_WFD_UIBC_SETTING "wfd_uibc_setting"
45 #define STRING_WFD_STANDBY_RESUME_CAPABILITY "wfd_standby_resume_capability"
46 #define STRING_WFD_STANDBY "wfd_standby"
47 #define STRING_WFD_CONNECTOR_TYPE "wfd_connector_type"
48 #define STRING_WFD_IDR_REQUEST "wfd_idr_request"
52 * @WFD_OK: A successful return value
53 * @WFD_EINVAL: a function was given invalid parameters
55 * Return values for the WFD_CONFIG functions.
60 WFD_NOT_IMPLEMENTED = -2,
61 WFD_NOT_SUPPORTED = -3
65 WFD_AUDIO_UNKNOWN = 0,
66 WFD_AUDIO_LPCM = (1 << 0),
67 WFD_AUDIO_AAC = (1 << 1),
68 WFD_AUDIO_AC3 = (1 << 2)
73 WFD_FREQ_44100 = (1 << 0),
74 WFD_FREQ_48000 = (1 << 1)
78 WFD_CHANNEL_UNKNOWN = 0,
79 WFD_CHANNEL_2 = (1 << 0),
80 WFD_CHANNEL_4 = (1 << 1),
81 WFD_CHANNEL_6 = (1 << 2),
82 WFD_CHANNEL_8 = (1 << 3)
87 WFD_VIDEO_UNKNOWN = 0,
88 WFD_VIDEO_H264 = (1 << 0)
92 WFD_VIDEO_CEA_RESOLUTION = 0,
93 WFD_VIDEO_VESA_RESOLUTION,
94 WFD_VIDEO_HH_RESOLUTION
95 } WFDVideoNativeResolution;
99 WFD_CEA_640x480P60 = (1 << 0),
100 WFD_CEA_720x480P60 = (1 << 1),
101 WFD_CEA_720x480I60 = (1 << 2),
102 WFD_CEA_720x576P50 = (1 << 3),
103 WFD_CEA_720x576I50 = (1 << 4),
104 WFD_CEA_1280x720P30 = (1 << 5),
105 WFD_CEA_1280x720P60 = (1 << 6),
106 WFD_CEA_1920x1080P30 = (1 << 7),
107 WFD_CEA_1920x1080P60 = (1 << 8),
108 WFD_CEA_1920x1080I60 = (1 << 9),
109 WFD_CEA_1280x720P25 = (1 << 10),
110 WFD_CEA_1280x720P50 = (1 << 11),
111 WFD_CEA_1920x1080P25 = (1 << 12),
112 WFD_CEA_1920x1080P50 = (1 << 13),
113 WFD_CEA_1920x1080I50 = (1 << 14),
114 WFD_CEA_1280x720P24 = (1 << 15),
115 WFD_CEA_1920x1080P24 = (1 << 16)
116 } WFDVideoCEAResolution;
119 WFD_VESA_UNKNOWN = 0,
120 WFD_VESA_800x600P30 = (1 << 0),
121 WFD_VESA_800x600P60 = (1 << 1),
122 WFD_VESA_1024x768P30 = (1 << 2),
123 WFD_VESA_1024x768P60 = (1 << 3),
124 WFD_VESA_1152x864P30 = (1 << 4),
125 WFD_VESA_1152x864P60 = (1 << 5),
126 WFD_VESA_1280x768P30 = (1 << 6),
127 WFD_VESA_1280x768P60 = (1 << 7),
128 WFD_VESA_1280x800P30 = (1 << 8),
129 WFD_VESA_1280x800P60 = (1 << 9),
130 WFD_VESA_1360x768P30 = (1 << 10),
131 WFD_VESA_1360x768P60 = (1 << 11),
132 WFD_VESA_1366x768P30 = (1 << 12),
133 WFD_VESA_1366x768P60 = (1 << 13),
134 WFD_VESA_1280x1024P30 = (1 << 14),
135 WFD_VESA_1280x1024P60 = (1 << 15),
136 WFD_VESA_1400x1050P30 = (1 << 16),
137 WFD_VESA_1400x1050P60 = (1 << 17),
138 WFD_VESA_1440x900P30 = (1 << 18),
139 WFD_VESA_1440x900P60 = (1 << 19),
140 WFD_VESA_1600x900P30 = (1 << 20),
141 WFD_VESA_1600x900P60 = (1 << 21),
142 WFD_VESA_1600x1200P30 = (1 << 22),
143 WFD_VESA_1600x1200P60 = (1 << 23),
144 WFD_VESA_1680x1024P30 = (1 << 24),
145 WFD_VESA_1680x1024P60 = (1 << 25),
146 WFD_VESA_1680x1050P30 = (1 << 26),
147 WFD_VESA_1680x1050P60 = (1 << 27),
148 WFD_VESA_1920x1200P30 = (1 << 28),
149 WFD_VESA_1920x1200P60 = (1 << 29)
150 } WFDVideoVESAResolution;
154 WFD_HH_800x480P30 = (1 << 0),
155 WFD_HH_800x480P60 = (1 << 1),
156 WFD_HH_854x480P30 = (1 << 2),
157 WFD_HH_854x480P60 = (1 << 3),
158 WFD_HH_864x480P30 = (1 << 4),
159 WFD_HH_864x480P60 = (1 << 5),
160 WFD_HH_640x360P30 = (1 << 6),
161 WFD_HH_640x360P60 = (1 << 7),
162 WFD_HH_960x540P30 = (1 << 8),
163 WFD_HH_960x540P60 = (1 << 9),
164 WFD_HH_848x480P30 = (1 << 10),
165 WFD_HH_848x480P60 = (1 << 11)
166 } WFDVideoHHResolution;
169 WFD_H264_UNKNOWN_PROFILE = 0,
170 WFD_H264_BASE_PROFILE = (1 << 0),
171 WFD_H264_HIGH_PROFILE = (1 << 1)
172 } WFDVideoH264Profile;
175 WFD_H264_LEVEL_UNKNOWN = 0,
176 WFD_H264_LEVEL_3_1 = (1 << 0),
177 WFD_H264_LEVEL_3_2 = (1 << 1),
178 WFD_H264_LEVEL_4 = (1 << 2),
179 WFD_H264_LEVEL_4_1 = (1 << 3),
180 WFD_H264_LEVEL_4_2 = (1 << 4)
185 WFD_HDCP_2_0 = (1 << 0),
186 WFD_HDCP_2_1 = (1 << 1)
190 WFD_SINK_UNKNOWN = -1,
191 WFD_SINK_NOT_COUPLED = 0,
193 WFD_SINK_TEARDOWN_COUPLING,
195 } WFDCoupledSinkStatus;
198 WFD_TRIGGER_UNKNOWN = 0,
201 WFD_TRIGGER_TEARDOWN,
206 WFD_RTSP_TRANS_UNKNOWN = 0,
207 WFD_RTSP_TRANS_RTP = (1 << 0),
208 WFD_RTSP_TRANS_RDT = (1 << 1)
212 WFD_RTSP_PROFILE_UNKNOWN = 0,
213 WFD_RTSP_PROFILE_AVP = (1 << 0),
214 WFD_RTSP_PROFILE_SAVP = (1 << 1)
218 WFD_RTSP_LOWER_TRANS_UNKNOWN = 0,
219 WFD_RTSP_LOWER_TRANS_UDP = (1 << 0),
220 WFD_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
221 WFD_RTSP_LOWER_TRANS_TCP = (1 << 2),
222 WFD_RTSP_LOWER_TRANS_HTTP = (1 << 3)
226 WFD_PRIMARY_SINK = 0,
231 WFD_UIBC_INPUT_CAT_UNKNOWN = 0,
232 WFD_UIBC_INPUT_CAT_GENERIC = (1 << 0),
233 WFD_UIBC_INPUT_CAT_HIDC = (1 << 1),
237 WFD_UIBC_INPUT_TYPE_UNKNOWN = 0,
238 WFD_UIBC_INPUT_TYPE_KEYBOARD = (1 << 0),
239 WFD_UIBC_INPUT_TYPE_MOUSE = (1 << 1),
240 WFD_UIBC_INPUT_TYPE_SINGLETOUCH = (1 << 2),
241 WFD_UIBC_INPUT_TYPE_MULTITOUCH = (1 << 3),
242 WFD_UIBC_INPUT_TYPE_JOYSTICK = (1 << 4),
243 WFD_UIBC_INPUT_TYPE_CAMERA = (1 << 5),
244 WFD_UIBC_INPUT_TYPE_GESTURE = (1 << 6),
245 WFD_UIBC_INPUT_TYPE_REMOTECONTROL = (1 << 7)
249 WFD_UIBC_INPUT_PATH_UNKNOWN = 0,
250 WFD_UIBC_INPUT_PATH_INFRARED = (1 << 0),
251 WFD_UIBC_INPUT_PATH_USB = (1 << 1),
252 WFD_UIBC_INPUT_PATH_BT = (1 << 2),
253 WFD_UIBC_INPUT_PATH_ZIGBEE = (1 << 3),
254 WFD_UIBC_INPUT_PATH_WIFI = (1 << 4),
255 WFD_UIBC_INPUT_PATH_NOSP = (1 << 5)
259 WFD_CONNECTOR_VGA = 0,
261 WFD_CONNECTOR_COMPOSITE,
262 WFD_CONNECTOR_COMPONENT,
266 WFD_CONNECTOR_RESERVED_7,
267 WFD_CONNECTOR_JAPANESE_D,
270 WFD_CONNECTOR_RESERVED_11,
272 WFD_CONNECTOR_NO = 254,
273 WFD_CONNECTOR_PHYSICAL = 255
294 guint min_slice_size;
295 guint slice_enc_params;
296 guint frame_rate_control_support;
297 } WFDVideoH264MiscParams;
304 WFDVideoH264MiscParams misc_params;
309 guint preferred_display_mode_supported;
310 WFDVideoH264Codec H264_codec;
319 guint video_3d_capability;
321 guint min_slice_size;
322 guint slice_enc_params;
323 guint frame_rate_control_support;
324 } WFD3DVideoH264MiscParams;
329 WFD3DVideoH264MiscParams misc_params;
332 } WFD3DVideoH264Codec;
336 guint preferred_display_mode_supported;
337 WFD3DVideoH264Codec H264_codec;
351 WFDHdcp2Spec *hdcp2_spec;
352 } WFDContentProtection;
355 guint edid_supported;
356 guint edid_block_count;
364 } WFDCoupled_sink_cap;
367 WFDCoupled_sink_cap *coupled_sink_cap;
371 gchar *wfd_trigger_method;
377 } WFDPresentationUrl;
398 } WFDAVFormatChangeTiming;
401 gboolean displaymodesupported;
415 WFDVideoH264Codec H264_codec;
416 } WFDPreferredDisplayMode;
420 } WFDInputCategoryList;
424 } WFDGenericCategoryList;
426 typedef struct _detailed_cap detailed_cap;
429 WFDUibcinp_type inp_type;
430 WFDUibcinp_path inp_path;
431 } WFDHIDCTypePathPair;
433 struct _detailed_cap {
434 WFDHIDCTypePathPair p;
441 } WFDHIDCCategoryList;
444 gboolean uibcsupported;
445 WFDInputCategoryList input_category_list;
446 WFDGenericCategoryList generic_cap_list;
447 WFDHIDCCategoryList hidc_cap_list;
452 gboolean uibc_setting;
456 gboolean standby_resume_cap;
457 } WFDStandbyResumeCapability;
460 gboolean wfd_standby;
465 gint32 connector_type;
469 gboolean idr_request;
472 /***********************************************************/
476 WFDAudioCodeclist *audio_codecs;
477 WFDVideoCodeclist *video_formats;
478 WFD3DFormats *video_3d_formats;
479 WFDContentProtection *content_protection;
480 WFDDisplayEdid *display_edid;
481 WFDCoupledSink *coupled_sink;
482 WFDTriggerMethod *trigger_method;
483 WFDPresentationUrl *presentation_url;
484 WFDClientRtpPorts *client_rtp_ports;
487 WFDAVFormatChangeTiming *av_format_change_timing;
488 WFDPreferredDisplayMode *preferred_display_mode;
489 WFDUibcCapability *uibc_capability;
490 WFDUibcSetting *uibc_setting;
491 WFDStandbyResumeCapability *standby_resume_capability;
493 WFDConnectorType *connector_type;
494 WFDIdrRequest *idr_request;
497 /* Session descriptions */
498 WFDResult wfdconfig_message_new(WFDMessage **msg);
499 WFDResult wfdconfig_message_init(WFDMessage *msg);
500 WFDResult wfdconfig_message_uninit(WFDMessage *msg);
501 WFDResult wfdconfig_message_free(WFDMessage *msg);
502 WFDResult wfdconfig_message_parse_buffer(const guint8 *data, guint size, WFDMessage *msg);
503 gchar *wfdconfig_message_as_text(const WFDMessage *msg);
504 gchar *wfdconfig_parameter_names_as_text(const WFDMessage *msg);
505 WFDResult wfdconfig_message_dump(const WFDMessage *msg);
508 WFDResult wfdconfig_set_supported_audio_format(WFDMessage *msg,
509 guint aCodec, guint aFreq, guint aChanels,
510 guint aBitwidth, guint32 aLatency);
511 WFDResult wfdconfig_set_prefered_audio_format(WFDMessage *msg,
512 WFDAudioFormats aCodec, WFDAudioFreq aFreq, WFDAudioChannels aChanels,
513 guint aBitwidth, guint32 aLatency);
514 WFDResult wfdconfig_get_supported_audio_format(WFDMessage *msg,
515 guint *aCodec, guint *aFreq, guint *aChanels,
516 guint *aBitwidth, guint32 *aLatency);
517 WFDResult wfdconfig_get_prefered_audio_format(WFDMessage *msg,
518 WFDAudioFormats *aCodec, WFDAudioFreq *aFreq, WFDAudioChannels *aChanels,
519 guint *aBitwidth, guint32 *aLatency);
521 WFDResult wfdconfig_set_supported_video_format(WFDMessage *msg, WFDVideoCodecs vCodec,
522 WFDVideoNativeResolution vNative, guint64 vNativeResolution,
523 guint64 vCEAResolution, guint64 vVESAResolution, guint64 vHHResolution,
524 guint vProfile, guint vLevel, guint32 vLatency, guint32 vMaxHeight,
525 guint32 vMaxWidth, guint32 min_slice_size, guint32 slice_enc_params, guint frame_rate_control);
526 WFDResult wfdconfig_set_prefered_video_format(WFDMessage *msg, WFDVideoCodecs vCodec,
527 WFDVideoNativeResolution vNative, guint64 vNativeResolution,
528 WFDVideoCEAResolution vCEAResolution, WFDVideoVESAResolution vVESAResolution,
529 WFDVideoHHResolution vHHResolution, WFDVideoH264Profile vProfile,
530 WFDVideoH264Level vLevel, guint32 vLatency, guint32 vMaxHeight,
531 guint32 vMaxWidth, guint32 min_slice_size, guint32 slice_enc_params, guint frame_rate_control);
532 WFDResult wfdconfig_get_supported_video_format(WFDMessage *msg, WFDVideoCodecs *vCodec,
533 WFDVideoNativeResolution *vNative, guint64 *vNativeResolution,
534 guint64 *vCEAResolution, guint64 *vVESAResolution, guint64 *vHHResolution,
535 guint *vProfile, guint *vLevel, guint32 *vLatency, guint32 *vMaxHeight,
536 guint32 *vMaxWidth, guint32 *min_slice_size, guint32 *slice_enc_params, guint *frame_rate_control);
537 WFDResult wfdconfig_get_prefered_video_format(WFDMessage *msg, WFDVideoCodecs *vCodec,
538 WFDVideoNativeResolution *vNative, guint64 *vNativeResolution,
539 WFDVideoCEAResolution *vCEAResolution, WFDVideoVESAResolution *vVESAResolution,
540 WFDVideoHHResolution *vHHResolution, WFDVideoH264Profile *vProfile,
541 WFDVideoH264Level *vLevel, guint32 *vLatency, guint32 *vMaxHeight,
542 guint32 *vMaxWidth, guint32 *min_slice_size, guint32 *slice_enc_params, guint *frame_rate_control);
544 /* Todo wfd-3d-formats */
546 WFDResult wfdconfig_set_contentprotection_type(WFDMessage *msg, WFDHDCPProtection hdcpversion, guint32 TCPPort);
547 WFDResult wfdconfig_get_contentprotection_type(WFDMessage *msg, WFDHDCPProtection *hdcpversion, guint32 *TCPPort);
549 WFDResult wfdconfig_set_display_EDID(WFDMessage *msg, gboolean edid_supported, guint32 edid_blockcount, gchar *edid_playload);
550 WFDResult wfdconfig_get_display_EDID(WFDMessage *msg, gboolean *edid_supported, guint32 *edid_blockcount, gchar **edid_playload);
553 WFDResult wfdconfig_set_coupled_sink(WFDMessage *msg, WFDCoupledSinkStatus status, gchar *sink_address);
554 WFDResult wfdconfig_get_coupled_sink(WFDMessage *msg, WFDCoupledSinkStatus *status, gchar **sink_address);
556 WFDResult wfdconfig_set_trigger_type(WFDMessage *msg, WFDTrigger trigger);
557 WFDResult wfdconfig_get_trigger_type(WFDMessage *msg, WFDTrigger *trigger);
559 WFDResult wfdconfig_set_presentation_url(WFDMessage *msg, gchar *wfd_url0, gchar *wfd_url1);
560 WFDResult wfdconfig_get_presentation_url(WFDMessage *msg, gchar **wfd_url0, gchar **wfd_url1);
562 WFDResult wfdconfig_set_prefered_RTP_ports(WFDMessage *msg, WFDRTSPTransMode trans, WFDRTSPProfile profile,
563 WFDRTSPLowerTrans lowertrans, guint32 rtp_port0, guint32 rtp_port1);
564 WFDResult wfdconfig_get_prefered_RTP_ports(WFDMessage *msg, WFDRTSPTransMode *trans, WFDRTSPProfile *profile,
565 WFDRTSPLowerTrans *lowertrans, guint32 *rtp_port0, guint32 *rtp_port1);
567 WFDResult wfdconfig_set_audio_sink_type(WFDMessage *msg, WFDSinkType sinktype);
568 WFDResult wfdconfig_get_audio_sink_type(WFDMessage *msg, WFDSinkType *sinktype);
570 WFDResult wfdconfig_set_I2C_port(WFDMessage *msg, gboolean i2csupport, guint32 i2cport);
571 WFDResult wfdconfig_get_I2C_port(WFDMessage *msg, gboolean *i2csupport, guint32 *i2cport);
573 WFDResult wfdconfig_set_av_format_change_timing(WFDMessage *msg, guint64 PTS, guint64 DTS);
574 WFDResult wfdconfig_get_av_format_change_timing(WFDMessage *msg, guint64 *PTS, guint64 *DTS);
576 /* Todo wfd-preferred-display-mode */
578 WFDResult wfdconfig_set_uibc_capability(WFDMessage *msg, guint32 input_category, guint32 inp_type, WFDHIDCTypePathPair *inp_pair,
579 guint32 inp_type_path_count, guint32 tcp_port);
580 WFDResult wfdconfig_get_uibc_capability(WFDMessage *msg, guint32 *input_category, guint32 *inp_type, WFDHIDCTypePathPair **inp_pair,
581 guint32 *inp_type_path_count, guint32 *tcp_port);
583 WFDResult wfdconfig_set_uibc_status(WFDMessage *msg, gboolean uibc_enable);
584 WFDResult wfdconfig_get_uibc_status(WFDMessage *msg, gboolean *uibc_enable);
586 WFDResult wfdconfig_set_standby_resume_capability(WFDMessage *msg, gboolean supported);
587 WFDResult wfdconfig_get_standby_resume_capability(WFDMessage *msg, gboolean *supported);
589 WFDResult wfdconfig_set_standby(WFDMessage *msg, gboolean standby_enable);
590 WFDResult wfdconfig_get_standby(WFDMessage *msg, gboolean *standby_enable);
592 WFDResult wfdconfig_set_connector_type(WFDMessage *msg, WFDConnector connector);
593 WFDResult wfdconfig_get_connector_type(WFDMessage *msg, WFDConnector *connector);
595 WFDResult wfdconfig_set_idr_request(WFDMessage *msg);
599 #endif /* __GST_WFD_CONFIG_MESSAGE_H__ */