2 * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 * Unless otherwise indicated, Source Code is licensed under MIT license.
21 * See further explanation attached in License Statement (distributed in the file
24 * Permission is hereby granted, free of charge, to any person obtaining a copy of
25 * this software and associated documentation files (the "Software"), to deal in
26 * the Software without restriction, including without limitation the rights to
27 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28 * of the Software, and to permit persons to whom the Software is furnished to do
29 * so, subject to the following conditions:
31 * The above copyright notice and this permission notice shall be included in all
32 * copies or substantial portions of the Software.
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43 #ifndef __GST_WFD_MESSAGE_H__
44 #define __GST_WFD_MESSAGE_H__
53 * @GST_WFD_OK: A successful return value
54 * @GST_WFD_EINVAL: a function was given invalid parameters
56 * Return values for the WFD functions.
65 GST_WFD_AUDIO_UNKNOWN = 0,
66 GST_WFD_AUDIO_LPCM = (1 << 0),
67 GST_WFD_AUDIO_AAC = (1 << 1),
68 GST_WFD_AUDIO_AC3 = (1 << 2)
72 GST_WFD_FREQ_UNKNOWN = 0,
73 GST_WFD_FREQ_44100 = (1 << 0),
74 GST_WFD_FREQ_48000 = (1 << 1)
78 GST_WFD_CHANNEL_UNKNOWN = 0,
79 GST_WFD_CHANNEL_2 = (1 << 0),
80 GST_WFD_CHANNEL_4 = (1 << 1),
81 GST_WFD_CHANNEL_6 = (1 << 2),
82 GST_WFD_CHANNEL_8 = (1 << 3)
83 } GstWFDAudioChannels;
87 GST_WFD_VIDEO_UNKNOWN = 0,
88 GST_WFD_VIDEO_H264 = (1 << 0)
92 GST_WFD_VIDEO_CEA_RESOLUTION = 0,
93 GST_WFD_VIDEO_VESA_RESOLUTION,
94 GST_WFD_VIDEO_HH_RESOLUTION
95 } GstWFDVideoNativeResolution;
98 GST_WFD_CEA_UNKNOWN = 0,
99 GST_WFD_CEA_640x480P60 = (1 << 0),
100 GST_WFD_CEA_720x480P60 = (1 << 1),
101 GST_WFD_CEA_720x480I60 = (1 << 2),
102 GST_WFD_CEA_720x576P50 = (1 << 3),
103 GST_WFD_CEA_720x576I50 = (1 << 4),
104 GST_WFD_CEA_1280x720P30 = (1 << 5),
105 GST_WFD_CEA_1280x720P60 = (1 << 6),
106 GST_WFD_CEA_1920x1080P30= (1 << 7),
107 GST_WFD_CEA_1920x1080P60= (1 << 8),
108 GST_WFD_CEA_1920x1080I60= (1 << 9),
109 GST_WFD_CEA_1280x720P25 = (1 << 10),
110 GST_WFD_CEA_1280x720P50 = (1 << 11),
111 GST_WFD_CEA_1920x1080P25= (1 << 12),
112 GST_WFD_CEA_1920x1080P50= (1 << 13),
113 GST_WFD_CEA_1920x1080I50= (1 << 14),
114 GST_WFD_CEA_1280x720P24 = (1 << 15),
115 GST_WFD_CEA_1920x1080P24= (1 << 16)
116 } GstWFDVideoCEAResolution;
119 GST_WFD_VESA_UNKNOWN = 0,
120 GST_WFD_VESA_800x600P30 = (1 << 0),
121 GST_WFD_VESA_800x600P60 = (1 << 1),
122 GST_WFD_VESA_1024x768P30 = (1 << 2),
123 GST_WFD_VESA_1024x768P60 = (1 << 3),
124 GST_WFD_VESA_1152x864P30 = (1 << 4),
125 GST_WFD_VESA_1152x864P60 = (1 << 5),
126 GST_WFD_VESA_1280x768P30 = (1 << 6),
127 GST_WFD_VESA_1280x768P60 = (1 << 7),
128 GST_WFD_VESA_1280x800P30 = (1 << 8),
129 GST_WFD_VESA_1280x800P60 = (1 << 9),
130 GST_WFD_VESA_1360x768P30 = (1 << 10),
131 GST_WFD_VESA_1360x768P60 = (1 << 11),
132 GST_WFD_VESA_1366x768P30 = (1 << 12),
133 GST_WFD_VESA_1366x768P60 = (1 << 13),
134 GST_WFD_VESA_1280x1024P30 = (1 << 14),
135 GST_WFD_VESA_1280x1024P60 = (1 << 15),
136 GST_WFD_VESA_1400x1050P30 = (1 << 16),
137 GST_WFD_VESA_1400x1050P60 = (1 << 17),
138 GST_WFD_VESA_1440x900P30 = (1 << 18),
139 GST_WFD_VESA_1440x900P60 = (1 << 19),
140 GST_WFD_VESA_1600x900P30 = (1 << 20),
141 GST_WFD_VESA_1600x900P60 = (1 << 21),
142 GST_WFD_VESA_1600x1200P30 = (1 << 22),
143 GST_WFD_VESA_1600x1200P60 = (1 << 23),
144 GST_WFD_VESA_1680x1024P30 = (1 << 24),
145 GST_WFD_VESA_1680x1024P60 = (1 << 25),
146 GST_WFD_VESA_1680x1050P30 = (1 << 26),
147 GST_WFD_VESA_1680x1050P60 = (1 << 27),
148 GST_WFD_VESA_1920x1200P30 = (1 << 28),
149 GST_WFD_VESA_1920x1200P60 = (1 << 29)
150 } GstWFDVideoVESAResolution;
153 GST_WFD_HH_UNKNOWN = 0,
154 GST_WFD_HH_800x480P30 = (1 << 0),
155 GST_WFD_HH_800x480P60 = (1 << 1),
156 GST_WFD_HH_854x480P30 = (1 << 2),
157 GST_WFD_HH_854x480P60 = (1 << 3),
158 GST_WFD_HH_864x480P30 = (1 << 4),
159 GST_WFD_HH_864x480P60 = (1 << 5),
160 GST_WFD_HH_640x360P30 = (1 << 6),
161 GST_WFD_HH_640x360P60 = (1 << 7),
162 GST_WFD_HH_960x540P30 = (1 << 8),
163 GST_WFD_HH_960x540P60 = (1 << 9),
164 GST_WFD_HH_848x480P30 = (1 << 10),
165 GST_WFD_HH_848x480P60 = (1 << 11)
166 } GstWFDVideoHHResolution;
169 GST_WFD_H264_UNKNOWN_PROFILE= 0,
170 GST_WFD_H264_BASE_PROFILE = (1 << 0),
171 GST_WFD_H264_HIGH_PROFILE = (1 << 1)
172 } GstWFDVideoH264Profile;
175 GST_WFD_H264_LEVEL_UNKNOWN = 0,
176 GST_WFD_H264_LEVEL_3_1 = (1 << 0),
177 GST_WFD_H264_LEVEL_3_2 = (1 << 1),
178 GST_WFD_H264_LEVEL_4 = (1 << 2),
179 GST_WFD_H264_LEVEL_4_1 = (1 << 3),
180 GST_WFD_H264_LEVEL_4_2 = (1 << 4)
181 } GstWFDVideoH264Level;
184 GST_WFD_HDCP_NONE = 0,
185 GST_WFD_HDCP_2_0 = (1 << 0),
186 GST_WFD_HDCP_2_1 = (1 << 1)
187 } GstWFDHDCPProtection;
190 GST_WFD_SINK_UNKNOWN = -1,
191 GST_WFD_SINK_NOT_COUPLED = 0,
192 GST_WFD_SINK_COUPLED,
193 GST_WFD_SINK_TEARDOWN_COUPLING,
194 GST_WFD_SINK_RESERVED
195 } GstWFDCoupledSinkStatus;
198 GST_WFD_TRIGGER_UNKNOWN = 0,
199 GST_WFD_TRIGGER_SETUP,
200 GST_WFD_TRIGGER_PAUSE,
201 GST_WFD_TRIGGER_TEARDOWN,
206 GST_WFD_RTSP_TRANS_UNKNOWN = 0,
207 GST_WFD_RTSP_TRANS_RTP = (1 << 0),
208 GST_WFD_RTSP_TRANS_RDT = (1 << 1)
209 } GstWFDRTSPTransMode;
212 GST_WFD_RTSP_PROFILE_UNKNOWN = 0,
213 GST_WFD_RTSP_PROFILE_AVP = (1 << 0),
214 GST_WFD_RTSP_PROFILE_SAVP = (1 << 1)
218 GST_WFD_RTSP_LOWER_TRANS_UNKNOWN = 0,
219 GST_WFD_RTSP_LOWER_TRANS_UDP = (1 << 0),
220 GST_WFD_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
221 GST_WFD_RTSP_LOWER_TRANS_TCP = (1 << 2),
222 GST_WFD_RTSP_LOWER_TRANS_HTTP = (1 << 3)
223 } GstWFDRTSPLowerTrans;
226 GST_WFD_PRIMARY_SINK = 0,
227 GST_WFD_SECONDARY_SINK
231 GST_WFD_UIBC_INPUT_CAT_UNKNOWN = 0,
232 GST_WFD_UIBC_INPUT_CAT_GENERIC = (1 << 0),
233 GST_WFD_UIBC_INPUT_CAT_HIDC = (1 << 1),
234 } GstWFDUibcinput_cat;
237 GST_WFD_UIBC_INPUT_TYPE_UNKNOWN = 0,
238 GST_WFD_UIBC_INPUT_TYPE_KEYBOARD = (1 << 0),
239 GST_WFD_UIBC_INPUT_TYPE_MOUSE = (1 << 1),
240 GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH = (1 << 2),
241 GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH = (1 << 3),
242 GST_WFD_UIBC_INPUT_TYPE_JOYSTICK = (1 << 4),
243 GST_WFD_UIBC_INPUT_TYPE_CAMERA = (1 << 5),
244 GST_WFD_UIBC_INPUT_TYPE_GESTURE = (1 << 6),
245 GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL = (1 << 7)
246 } GstWFDUibcinp_type;
249 GST_WFD_UIBC_INPUT_PATH_UNKNOWN = 0,
250 GST_WFD_UIBC_INPUT_PATH_INFRARED = (1 << 0),
251 GST_WFD_UIBC_INPUT_PATH_USB = (1 << 1),
252 GST_WFD_UIBC_INPUT_PATH_BT = (1 << 2),
253 GST_WFD_UIBC_INPUT_PATH_ZIGBEE = (1 << 3),
254 GST_WFD_UIBC_INPUT_PATH_WIFI = (1 << 4),
255 GST_WFD_UIBC_INPUT_PATH_NOSP = (1 << 5)
256 } GstWFDUibcinp_path;
259 GST_WFD_CONNECTOR_VGA = 0,
261 GST_WFD_CONNECTOR_COMPOSITE,
262 GST_WFD_CONNECTOR_COMPONENT,
263 GST_WFD_CONNECTOR_DVI,
264 GST_WFD_CONNECTOR_HDMI,
265 GST_WFD_CONNECTOR_LVDS,
266 GST_WFD_CONNECTOR_RESERVED_7,
267 GST_WFD_CONNECTOR_JAPANESE_D,
268 GST_WFD_CONNECTOR_SDI,
269 GST_WFD_CONNECTOR_DP,
270 GST_WFD_CONNECTOR_RESERVED_11,
271 GST_WFD_CONNECTOR_UDI,
272 GST_WFD_CONNECTOR_NO = 254,
273 GST_WFD_CONNECTOR_PHYSICAL = 255
285 GstWFDAudioCodec *list;
286 } GstWFDAudioCodeclist;
294 guint min_slice_size;
295 guint slice_enc_params;
296 guint frame_rate_control_support;
297 } GstWFDVideoH264MiscParams;
304 GstWFDVideoH264MiscParams misc_params;
305 } GstWFDVideoH264Codec;
309 guint preferred_display_mode_supported;
310 GstWFDVideoH264Codec H264_codec;
315 GstWFDVideoCodec *list;
316 } GstWFDVideoCodeclist;
319 guint video_3d_capability;
321 guint min_slice_size;
322 guint slice_enc_params;
323 guint frame_rate_control_support;
324 } GstWFD3DVideoH264MiscParams;
329 GstWFD3DVideoH264MiscParams misc_params;
332 } GstWFD3DVideoH264Codec;
336 guint preferred_display_mode_supported;
337 GstWFD3DVideoH264Codec H264_codec;
342 GstWFD3dCapList *list;
351 GstWFDHdcp2Spec *hdcp2_spec;
352 } GstWFDContentProtection;
355 guint edid_supported;
356 guint edid_block_count;
364 } GstWFDCoupled_sink_cap;
367 GstWFDCoupled_sink_cap *coupled_sink_cap;
371 gchar *wfd_trigger_method;
372 } GstWFDTriggerMethod;
377 } GstWFDPresentationUrl;
384 } GstWFDClientRtpPorts;
398 } GstWFDAVFormatChangeTiming;
401 gboolean displaymodesupported;
415 GstWFDVideoH264Codec H264_codec;
416 } GstWFDPreferredDisplayMode;
420 } GstWFDInputCategoryList;
424 } GstWFDGenericCategoryList;
426 typedef struct _detailed_cap detailed_cap;
429 GstWFDUibcinp_type inp_type;
430 GstWFDUibcinp_path inp_path;
431 } GstWFDHIDCTypePathPair;
433 struct _detailed_cap {
434 GstWFDHIDCTypePathPair p;
441 } GstWFDHIDCCategoryList;
444 gboolean uibcsupported;
445 GstWFDInputCategoryList input_category_list;
446 GstWFDGenericCategoryList generic_cap_list;
447 GstWFDHIDCCategoryList hidc_cap_list;
449 } GstWFDUibcCapability;
452 gboolean uibc_setting;
456 gboolean standby_resume_cap;
457 } GstWFDStandbyResumeCapability;
460 gboolean wfd_standby;
465 gint32 connector_type;
466 } GstWFDConnectorType;
469 gboolean idr_request;
474 * @version: the protocol version
475 * @origin: owner/creator and session identifier
476 * @session_name: session name
477 * @information: session information
478 * @uri: URI of description
479 * @emails: array of #gchar with email addresses
480 * @phones: array of #gchar with phone numbers
481 * @connection: connection information for the session
482 * @bandwidths: array of #GstWFDBandwidth with bandwidth information
483 * @times: array of #GstWFDTime with time descriptions
484 * @zones: array of #GstWFDZone with time zone adjustments
485 * @key: encryption key
486 * @attributes: array of #GstWFDAttribute with session attributes
487 * @medias: array of #GstWFDMedia with media descriptions
489 * The contents of the WFD message.
492 GstWFDAudioCodeclist *audio_codecs;
493 GstWFDVideoCodeclist *video_formats;
494 GstWFD3DFormats *video_3d_formats;
495 GstWFDContentProtection *content_protection;
496 GstWFDDisplayEdid *display_edid;
497 GstWFDCoupledSink *coupled_sink;
498 GstWFDTriggerMethod *trigger_method;
499 GstWFDPresentationUrl *presentation_url;
500 GstWFDClientRtpPorts *client_rtp_ports;
503 GstWFDAVFormatChangeTiming *av_format_change_timing;
504 GstWFDPreferredDisplayMode *preferred_display_mode;
505 GstWFDUibcCapability *uibc_capability;
506 GstWFDUibcSetting *uibc_setting;
507 GstWFDStandbyResumeCapability *standby_resume_capability;
508 GstWFDStandby *standby;
509 GstWFDConnectorType *connector_type;
510 GstWFDIdrRequest *idr_request;
513 GType gst_wfd_message_get_type (void);
515 #define GST_TYPE_WFD_MESSAGE (gst_wfd_message_get_type())
516 #define GST_WFD_MESSAGE_CAST(object) ((GstWFDMessage *)(object))
517 #define GST_WFD_MESSAGE(object) (GST_WFD_MESSAGE_CAST(object))
519 /* Session descriptions */
520 GstWFDResult gst_wfd_message_new (GstWFDMessage **msg);
521 GstWFDResult gst_wfd_message_init (GstWFDMessage *msg);
522 GstWFDResult gst_wfd_message_uninit (GstWFDMessage *msg);
523 GstWFDResult gst_wfd_message_free (GstWFDMessage *msg);
524 GstWFDResult gst_wfd_message_copy (const GstWFDMessage *msg, GstWFDMessage **copy);
526 GstWFDResult gst_wfd_message_parse_buffer (const guint8 *data, guint size, GstWFDMessage *msg);
527 gchar* gst_wfd_message_as_text (const GstWFDMessage *msg);
528 gchar* gst_wfd_message_param_names_as_text (const GstWFDMessage *msg);
529 GstWFDResult gst_wfd_message_dump (const GstWFDMessage *msg);
532 GstWFDResult gst_wfd_message_set_supported_audio_format(GstWFDMessage *msg,
533 GstWFDAudioFormats a_codec,
534 guint a_freq, guint a_channels,
535 guint a_bitwidth, guint32 a_latency);
537 GstWFDResult gst_wfd_message_set_prefered_audio_format(GstWFDMessage *msg,
538 GstWFDAudioFormats a_codec,
539 GstWFDAudioFreq a_freq,
540 GstWFDAudioChannels a_channels,
541 guint a_bitwidth, guint32 a_latency);
543 GstWFDResult gst_wfd_message_get_supported_audio_format (GstWFDMessage *msg,
550 GstWFDResult gst_wfd_message_get_prefered_audio_format (GstWFDMessage *msg,
551 GstWFDAudioFormats *a_codec,
552 GstWFDAudioFreq *a_freq,
553 GstWFDAudioChannels *a_channels,
554 guint *a_bitwidth, guint32 *a_latency);
556 GstWFDResult gst_wfd_message_set_supported_video_format (GstWFDMessage *msg,
557 GstWFDVideoCodecs v_codec,
558 GstWFDVideoNativeResolution v_native,
559 guint64 v_native_resolution,
560 guint64 v_cea_resolution,
561 guint64 v_vesa_resolution,
562 guint64 v_hh_resolution,
566 guint32 v_max_height,
568 guint32 min_slice_size,
569 guint32 slice_enc_params,
570 guint frame_rate_control);
572 GstWFDResult gst_wfd_message_set_prefered_video_format(GstWFDMessage *msg,
573 GstWFDVideoCodecs v_codec,
574 GstWFDVideoNativeResolution v_native,
575 guint64 v_native_resolution,
576 GstWFDVideoCEAResolution v_cea_resolution,
577 GstWFDVideoVESAResolution v_vesa_resolution,
578 GstWFDVideoHHResolution v_hh_resolution,
579 GstWFDVideoH264Profile v_profile,
580 GstWFDVideoH264Level v_level,
582 guint32 v_max_height,
584 guint32 min_slice_size,
585 guint32 slice_enc_params,
586 guint frame_rate_control);
588 GstWFDResult gst_wfd_message_get_supported_video_format(GstWFDMessage *msg,
589 GstWFDVideoCodecs *v_codec,
590 GstWFDVideoNativeResolution *v_native,
591 guint64 *v_native_resolution,
592 guint64 *v_cea_resolution,
593 guint64 *v_vesa_resolution,
594 guint64 *v_hh_resolution,
598 guint32 *v_max_height,
599 guint32 *v_max_width,
600 guint32 *min_slice_size,
601 guint32 *slice_enc_params,
602 guint *frame_rate_control);
604 GstWFDResult gst_wfd_message_get_prefered_video_format(GstWFDMessage *msg,
605 GstWFDVideoCodecs *v_codec,
606 GstWFDVideoNativeResolution *v_native,
607 guint64 *v_native_resolution,
608 GstWFDVideoCEAResolution *v_cea_resolution,
609 GstWFDVideoVESAResolution *v_vesa_resolution,
610 GstWFDVideoHHResolution *v_hh_resolution,
611 GstWFDVideoH264Profile *v_profile,
612 GstWFDVideoH264Level *v_level,
614 guint32 *v_max_height,
615 guint32 *v_max_width,
616 guint32 *min_slice_size,
617 guint32 *slice_enc_params,
618 guint *frame_rate_control);
620 GstWFDResult gst_wfd_message_set_display_edid (GstWFDMessage *msg,
621 gboolean edid_supported,
622 guint32 edid_blockcount,
623 gchar *edid_playload);
625 GstWFDResult gst_wfd_message_get_display_edid (GstWFDMessage *msg,
626 gboolean *edid_supported,
627 guint32 *edid_blockcount,
628 gchar **edid_playload);
630 GstWFDResult gst_wfd_message_set_contentprotection_type (GstWFDMessage *msg,
631 GstWFDHDCPProtection hdcpversion,
634 GstWFDResult gst_wfd_message_get_contentprotection_type (GstWFDMessage *msg,
635 GstWFDHDCPProtection *hdcpversion,
638 GstWFDResult gst_wfd_messge_set_prefered_rtp_ports (GstWFDMessage *msg,
639 GstWFDRTSPTransMode trans,
640 GstWFDRTSPProfile profile,
641 GstWFDRTSPLowerTrans lowertrans,
645 GstWFDResult gst_wfd_message_get_prefered_rtp_ports (GstWFDMessage *msg,
646 GstWFDRTSPTransMode *trans,
647 GstWFDRTSPProfile *profile,
648 GstWFDRTSPLowerTrans *lowertrans,
652 GstWFDResult gst_wfd_message_set_presentation_url(GstWFDMessage *msg,
653 gchar *wfd_url0, gchar *wfd_url1);
655 GstWFDResult gst_wfd_message_get_presentation_url(GstWFDMessage *msg, gchar **wfd_url0,
660 #endif /* __GST_WFD_MESSAGE_H__ */