2 * Copyright (C) 2009 Nokia Corporation.
3 * Copyright (C) 2007, 2008 OpenedHand Ltd.
5 * Authors: Zeeshan Ali (Khattak) <zeeshan.ali@nokia.com>
6 * <zeeshanak@gnome.org>
7 * Jorn Baayen <jorn@openedhand.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
26 * SECTION:gupnp-protocol-info
27 * @short_description: UPnP AV ProtocolInfo
29 * #GUPnPProtocolInfo provides a convenient API to deal with ProtocolInfo
30 * strings used in UPnP AV specifications.
35 #include <libgupnp/gupnp.h>
36 #include "gupnp-protocol-info.h"
37 #include "gupnp-av-error.h"
39 G_DEFINE_TYPE (GUPnPProtocolInfo,
43 struct _GUPnPProtocolInfoPrivate {
50 GUPnPDLNAConversion dlna_conversion;
51 GUPnPDLNAOperation dlna_operation;
52 GUPnPDLNAFlags dlna_flags;
69 parse_additional_info (const char *additional_info,
70 GUPnPProtocolInfo *info)
72 GUPnPProtocolInfoPrivate *priv;
78 if (strcmp (additional_info, "*") == 0)
81 tokens = g_strsplit (additional_info, ";", -1);
83 g_warning ("Invalid additional info in DIDL-Lite info: %s",
89 for (i = 0; tokens[i]; i++) {
92 p = g_strstr_len (tokens[i],
96 p += 12; /* end of "DLNA.ORG_PN=" */
97 gupnp_protocol_info_set_dlna_profile (info, p);
102 p = g_strstr_len (tokens[i],
108 p += 12; /* end of "DLNA.ORG_PS=" */
110 play_speeds = g_strsplit (p, ",", -1);
111 gupnp_protocol_info_set_play_speeds
113 (const char **) play_speeds);
114 g_strfreev (play_speeds);
119 p = g_strstr_len (tokens[i],
123 p += 12; /* end of "DLNA.ORG_CI=" */
125 gupnp_protocol_info_set_dlna_conversion (info,
131 p = g_strstr_len (tokens[i],
135 p += 12; /* end of "DLNA.ORG_OP=" */
137 gupnp_protocol_info_set_dlna_operation
139 strtoul (p, NULL, 16));
144 p = g_strstr_len (tokens[i],
148 p += 15; /* end of "DLNA.ORG_FLAGS=" */
151 gupnp_protocol_info_set_dlna_flags
153 strtoul (p, NULL, 16));
163 is_transport_compat (GUPnPProtocolInfo *info1,
164 GUPnPProtocolInfo *info2)
166 const char *protocol1;
167 const char *protocol2;
169 protocol1 = gupnp_protocol_info_get_protocol (info1);
170 protocol2 = gupnp_protocol_info_get_protocol (info2);
172 if (protocol1[0] != '*' &&
173 protocol2[0] != '*' &&
174 g_ascii_strcasecmp (protocol1, protocol2) != 0)
176 else if (g_ascii_strcasecmp ("internal", protocol1) == 0 &&
177 strcmp (gupnp_protocol_info_get_network (info1),
178 gupnp_protocol_info_get_network (info2)) != 0)
179 /* Host must be the same in case of INTERNAL protocol */
186 is_content_format_compat (GUPnPProtocolInfo *info1,
187 GUPnPProtocolInfo *info2)
189 const char *mime_type1;
190 const char *mime_type2;
192 mime_type1 = gupnp_protocol_info_get_mime_type (info1);
193 mime_type2 = gupnp_protocol_info_get_mime_type (info2);
195 if (mime_type1 [0] != '*' &&
196 mime_type2 [0] != '*' &&
197 g_ascii_strcasecmp (mime_type1, mime_type2) != 0 &&
198 /* Handle special case for LPCM: It is the only content type that
199 * make use of mime-type parameters that we know of.
201 * Example: audio/L16;rate=44100;channels=2
203 !((g_ascii_strcasecmp (mime_type1, "audio/L16") == 0 &&
204 g_ascii_strncasecmp (mime_type2, "audio/L16", 9) == 0) ||
205 (g_ascii_strcasecmp (mime_type2, "audio/L16") == 0 &&
206 g_ascii_strncasecmp (mime_type1, "audio/L16", 9) == 0)))
213 is_additional_info_compat (GUPnPProtocolInfo *info1,
214 GUPnPProtocolInfo *info2)
216 const char *profile1;
217 const char *profile2;
219 profile1 = gupnp_protocol_info_get_dlna_profile (info1);
220 profile2 = gupnp_protocol_info_get_dlna_profile (info2);
222 if (profile1 == NULL ||
224 profile1 [0] == '*' ||
225 profile2 [0] == '*' ||
226 g_ascii_strcasecmp (profile1, profile2) == 0)
233 add_dlna_info (GString *str,
234 GUPnPProtocolInfo *info)
236 const char *dlna_profile;
238 GUPnPDLNAConversion conversion;
239 GUPnPDLNAOperation operation;
240 GUPnPDLNAFlags flags;
242 dlna_profile = gupnp_protocol_info_get_dlna_profile (info);
243 if (dlna_profile == NULL) {
244 g_string_append_printf (str, ":");
246 g_string_append_printf (str, ":DLNA.ORG_PN=%s;", dlna_profile);
249 operation = gupnp_protocol_info_get_dlna_operation (info);
250 if (operation != GUPNP_DLNA_OPERATION_NONE &&
251 /* the OP parameter is only allowed for the "http-get"
252 * and "rtsp-rtp-udp" protocols
254 (strcmp (gupnp_protocol_info_get_protocol (info),
256 strcmp (gupnp_protocol_info_get_protocol (info),
257 "rtsp-rtp-udp") == 0))
258 g_string_append_printf (str, "DLNA.ORG_OP=%.2x;", operation);
260 /* Specify PS parameter if list of play speeds is provided */
261 speeds = gupnp_protocol_info_get_play_speeds (info);
262 if (speeds != NULL) {
265 g_string_append_printf (str, "DLNA.ORG_PS=;");
267 for (i = 0; speeds[i]; i++) {
268 g_string_append (str, speeds[i]);
271 g_string_append_c (str, ',');
275 conversion = gupnp_protocol_info_get_dlna_conversion (info);
276 /* omit the CI parameter for non-converted content */
277 if (conversion != GUPNP_DLNA_CONVERSION_NONE)
278 g_string_append_printf (str, "DLNA.ORG_CI=%d;", conversion);
280 flags = gupnp_protocol_info_get_dlna_flags (info);
281 /* Omit the FLAGS parameter if no or DLNA profile are set */
282 if (flags != GUPNP_DLNA_FLAGS_NONE && dlna_profile != NULL) {
283 g_string_append_printf (str, "DLNA.ORG_FLAGS=%.8x", flags);
284 /* append 24 reserved hex-digits */
285 g_string_append_printf (str,
287 "0000" "0000" "0000");
290 /* if nothing of the above was set, use the "match all" rule */
291 switch (str->str[str->len - 1]) {
293 g_string_append_c (str, '*');
296 g_string_erase (str, str->len - 1, 1);
304 gupnp_protocol_info_init (GUPnPProtocolInfo *info)
306 info->priv = G_TYPE_INSTANCE_GET_PRIVATE
308 GUPNP_TYPE_PROTOCOL_INFO,
309 GUPnPProtocolInfoPrivate);
311 info->priv->dlna_conversion = GUPNP_DLNA_CONVERSION_NONE;
312 info->priv->dlna_operation = GUPNP_DLNA_OPERATION_NONE;
313 info->priv->dlna_flags = GUPNP_DLNA_FLAGS_NONE;
317 gupnp_protocol_info_set_property (GObject *object,
322 GUPnPProtocolInfo *info;
324 info = GUPNP_PROTOCOL_INFO (object);
326 switch (property_id) {
328 gupnp_protocol_info_set_protocol (info,
329 g_value_get_string (value));
332 gupnp_protocol_info_set_network (info,
333 g_value_get_string (value));
336 gupnp_protocol_info_set_mime_type (info,
337 g_value_get_string (value));
339 case PROP_DLNA_PROFILE:
340 gupnp_protocol_info_set_dlna_profile
342 g_value_get_string (value));
344 case PROP_PLAY_SPEEDS:
345 gupnp_protocol_info_set_play_speeds (info,
346 g_value_get_boxed (value));
348 case PROP_DLNA_CONVERSION:
349 gupnp_protocol_info_set_dlna_conversion
351 g_value_get_flags (value));
353 case PROP_DLNA_OPERATION:
354 gupnp_protocol_info_set_dlna_operation
356 g_value_get_flags (value));
358 case PROP_DLNA_FLAGS:
359 gupnp_protocol_info_set_dlna_flags
361 g_value_get_flags (value));
364 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
370 gupnp_protocol_info_get_property (GObject *object,
375 GUPnPProtocolInfo *info;
377 info = GUPNP_PROTOCOL_INFO (object);
379 switch (property_id) {
381 g_value_set_string (value,
382 gupnp_protocol_info_get_protocol (info));
385 g_value_set_string (value,
386 gupnp_protocol_info_get_network (info));
389 g_value_set_string (value,
390 gupnp_protocol_info_get_mime_type (info));
392 case PROP_DLNA_PROFILE:
395 gupnp_protocol_info_get_dlna_profile (info));
397 case PROP_PLAY_SPEEDS:
398 g_value_set_boxed (value,
399 gupnp_protocol_info_get_play_speeds (info));
401 case PROP_DLNA_CONVERSION:
404 gupnp_protocol_info_get_dlna_conversion
407 case PROP_DLNA_OPERATION:
410 gupnp_protocol_info_get_dlna_operation (info));
412 case PROP_DLNA_FLAGS:
413 g_value_set_flags (value,
414 gupnp_protocol_info_get_dlna_flags (info));
417 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
423 gupnp_protocol_info_finalize (GObject *object)
425 GObjectClass *object_class;
426 GUPnPProtocolInfoPrivate *priv;
428 priv = GUPNP_PROTOCOL_INFO (object)->priv;
431 g_free (priv->protocol);
433 g_free (priv->network);
435 g_free (priv->mime_type);
436 if (priv->dlna_profile)
437 g_free (priv->dlna_profile);
438 if (priv->play_speeds)
439 g_strfreev (priv->play_speeds);
441 object_class = G_OBJECT_CLASS (gupnp_protocol_info_parent_class);
442 object_class->finalize (object);
446 gupnp_protocol_info_class_init (GUPnPProtocolInfoClass *klass)
448 GObjectClass *object_class;
450 object_class = G_OBJECT_CLASS (klass);
452 object_class->set_property = gupnp_protocol_info_set_property;
453 object_class->get_property = gupnp_protocol_info_get_property;
454 object_class->finalize = gupnp_protocol_info_finalize;
456 g_type_class_add_private (klass, sizeof (GUPnPProtocolInfoPrivate));
459 * GUPnPProtocolInfo:protocol:
461 * The protocol of this info.
463 g_object_class_install_property
466 g_param_spec_string ("protocol",
468 "The protocol of this info.",
471 G_PARAM_STATIC_NAME |
472 G_PARAM_STATIC_NICK |
473 G_PARAM_STATIC_BLURB));
476 * GUPnPProtocolInfo:network:
478 * The network this info is associated with.
480 g_object_class_install_property
483 g_param_spec_string ("network",
485 "The network this info is associated"
489 G_PARAM_STATIC_NAME |
490 G_PARAM_STATIC_NICK |
491 G_PARAM_STATIC_BLURB));
494 * GUPnPProtocolInfo:mime-type:
496 * The MIME-type of this info.
498 g_object_class_install_property
501 g_param_spec_string ("mime-type",
503 "The MIME-type of this info.",
506 G_PARAM_STATIC_NAME |
507 G_PARAM_STATIC_NICK |
508 G_PARAM_STATIC_BLURB));
511 * GUPnPProtocolInfo:dlna-profile:
513 * The DLNA profile of this info.
515 g_object_class_install_property
518 g_param_spec_string ("dlna-profile",
520 "The DLNA profile of this info.",
523 G_PARAM_STATIC_NAME |
524 G_PARAM_STATIC_NICK |
525 G_PARAM_STATIC_BLURB));
528 * GUPnPProtocolInfo:play-speeds:
530 * The allowed play speeds on this info in the form of array of
533 g_object_class_install_property
536 g_param_spec_boxed ("play-speeds",
538 "The allowed play speeds on this"
539 " info in the form of array of"
543 G_PARAM_STATIC_NAME |
544 G_PARAM_STATIC_NICK |
545 G_PARAM_STATIC_BLURB));
548 * GUPnPProtocolInfo:dlna-conversion:
550 * The DLNA conversion flags.
552 g_object_class_install_property
554 PROP_DLNA_CONVERSION,
555 g_param_spec_flags ("dlna-conversion",
557 "The DLNA conversion flags.",
558 GUPNP_TYPE_DLNA_CONVERSION,
559 GUPNP_DLNA_CONVERSION_NONE,
561 G_PARAM_STATIC_NAME |
562 G_PARAM_STATIC_NICK |
563 G_PARAM_STATIC_BLURB));
566 * GUPnPProtocolInfo:dlna-operation:
568 * The DLNA operation flags.
570 g_object_class_install_property
573 g_param_spec_flags ("dlna-operation",
575 "The DLNA operation flags.",
576 GUPNP_TYPE_DLNA_OPERATION,
577 GUPNP_DLNA_OPERATION_NONE,
579 G_PARAM_STATIC_NAME |
580 G_PARAM_STATIC_NICK |
581 G_PARAM_STATIC_BLURB));
584 * GUPnPProtocolInfo:dlna-flags:
586 * Various generic DLNA flags.
588 g_object_class_install_property
591 g_param_spec_flags ("dlna-flags",
593 "Various generic DLNA flags.",
594 GUPNP_TYPE_DLNA_FLAGS,
595 GUPNP_DLNA_FLAGS_NONE,
597 G_PARAM_STATIC_NAME |
598 G_PARAM_STATIC_NICK |
599 G_PARAM_STATIC_BLURB));
603 * gupnp_protocol_info_new:
605 * Return value: A new #GUPnPProtocolInfo object. Unref after usage.
608 gupnp_protocol_info_new ()
610 return g_object_new (GUPNP_TYPE_PROTOCOL_INFO,
615 * gupnp_protocol_info_new_from_string:
616 * @protocol_info: The protocol info string
617 * @error: The location where to store any error, or NULL
619 * Parses the @protocol_info string and creates a new #GUPnPProtocolInfo object
622 * Return value: A new #GUPnPProtocolInfo object. Unref after usage.
625 gupnp_protocol_info_new_from_string (const char *protocol_info,
628 GUPnPProtocolInfo *info;
631 g_return_val_if_fail (protocol_info != NULL, NULL);
633 tokens = g_strsplit (protocol_info, ":", 4);
634 if (tokens[0] == NULL ||
639 GUPNP_PROTOCOL_ERROR,
640 GUPNP_PROTOCOL_ERROR_INVALID_SYNTAX,
641 "Failed to parse protocolInfo string: \n%s",
649 info = gupnp_protocol_info_new ();
651 gupnp_protocol_info_set_protocol (info, tokens[0]);
652 gupnp_protocol_info_set_network (info, tokens[1]);
653 gupnp_protocol_info_set_mime_type (info, tokens[2]);
655 parse_additional_info (tokens[3], info);
663 * gupnp_protocol_info_to_string:
664 * @info: The #GUPnPProtocolInfo
666 * Provides the string representation of @info.
668 * Return value: String representation of @info. #g_free after usage.
671 gupnp_protocol_info_to_string (GUPnPProtocolInfo *info)
674 const char *protocol;
675 const char *mime_type;
678 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
680 protocol = gupnp_protocol_info_get_protocol (info);
681 mime_type = gupnp_protocol_info_get_mime_type (info);
682 network = gupnp_protocol_info_get_network (info);
684 g_return_val_if_fail (protocol != NULL, NULL);
685 g_return_val_if_fail (mime_type != NULL, NULL);
687 str = g_string_new ("");
689 g_string_append (str, protocol);
690 g_string_append_c (str, ':');
692 g_string_append (str, network);
694 g_string_append_c (str, '*');
695 g_string_append_c (str, ':');
696 g_string_append (str, mime_type);
698 add_dlna_info (str, info);
700 return g_string_free (str, FALSE);
704 * gupnp_protocol_info_get_protocol:
705 * @info: A #GUPnPProtocolInfo
707 * Get the protocol of this info.
709 * Return value: The protocol of this info or %NULL. This string should not
713 gupnp_protocol_info_get_protocol (GUPnPProtocolInfo *info)
715 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
717 return info->priv->protocol;
721 * gupnp_protocol_info_get_network:
722 * @info: A #GUPnPProtocolInfo
724 * Get the network this info is associated with.
726 * Return value: The network string or %NULL. This string should not be freed.
729 gupnp_protocol_info_get_network (GUPnPProtocolInfo *info)
731 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
733 return info->priv->network;
737 * gupnp_protocol_info_get_mime_type:
738 * @info: A #GUPnPProtocolInfo
740 * Get the MIME-type of this info.
742 * Return value: The MIME-type of this info or %NULL. This string should not
746 gupnp_protocol_info_get_mime_type (GUPnPProtocolInfo *info)
748 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
750 return info->priv->mime_type;
754 * gupnp_protocol_info_get_dlna_profile:
755 * @info: A #GUPnPProtocolInfo
757 * Get the DLNA profile of this info.
759 * Return value: The DLNA profile of this info or %NULL. This string should
763 gupnp_protocol_info_get_dlna_profile (GUPnPProtocolInfo *info)
765 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
767 return info->priv->dlna_profile;
771 * gupnp_protocol_info_get_play_speeds:
772 * @info: A #GUPnPProtocolInfo
774 * Get the allowed play speeds on this info in the form of array of strings.
776 * Returns: (transfer none): The allowed play speeds as array of strings or %NULL. This
777 * return array and it's content must not be modified or freed.
780 gupnp_protocol_info_get_play_speeds (GUPnPProtocolInfo *info)
782 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info), NULL);
784 return (const char **) info->priv->play_speeds;
788 * gupnp_protocol_info_get_dlna_conversion:
789 * @info: A #GUPnPProtocolInfo
791 * Get the DLNA conversion flags.
793 * Return value: The DLNA conversion flags.
796 gupnp_protocol_info_get_dlna_conversion (GUPnPProtocolInfo *info)
798 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info),
799 GUPNP_DLNA_CONVERSION_NONE);
801 return info->priv->dlna_conversion;
805 * gupnp_protocol_info_get_dlna_operation:
806 * @info: A #GUPnPProtocolInfo
808 * Get the DLNA operation flags.
810 * Return value: The DLNA operation flags.
813 gupnp_protocol_info_get_dlna_operation (GUPnPProtocolInfo *info)
815 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info),
816 GUPNP_DLNA_OPERATION_NONE);
818 return info->priv->dlna_operation;
822 * gupnp_protocol_info_get_dlna_flags:
823 * @info: A #GUPnPProtocolInfo
825 * Get the gereric DLNA flags.
827 * Return value: The generic DLNA flags.
830 gupnp_protocol_info_get_dlna_flags (GUPnPProtocolInfo *info)
832 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info),
833 GUPNP_DLNA_FLAGS_NONE);
835 return info->priv->dlna_flags;
839 * gupnp_protocol_info_set_protocol:
840 * @info: A #GUPnPProtocolInfo
841 * @protocol: The protocol string
843 * Set the protocol of this info.
845 * Return value: None.
848 gupnp_protocol_info_set_protocol (GUPnPProtocolInfo *info,
849 const char *protocol)
851 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
853 if (info->priv->protocol)
854 g_free (info->priv->protocol);
855 info->priv->protocol = g_strdup (protocol);
857 g_object_notify (G_OBJECT (info), "protocol");
861 * gupnp_protocol_info_set_network:
862 * @info: A #GUPnPProtocolInfo
863 * @network: The network string
865 * Set the network this info is associated with.
867 * Return value: None.
870 gupnp_protocol_info_set_network (GUPnPProtocolInfo *info,
873 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
875 if (info->priv->network)
876 g_free (info->priv->network);
877 info->priv->network = g_strdup (network);
879 g_object_notify (G_OBJECT (info), "network");
883 * gupnp_protocol_info_set_mime_type:
884 * @info: A #GUPnPProtocolInfo
885 * @mime_type: The MIME-type string
887 * Set the MIME-type of this info.
889 * Return value: None.
892 gupnp_protocol_info_set_mime_type (GUPnPProtocolInfo *info,
893 const char *mime_type)
895 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
897 if (info->priv->mime_type)
898 g_free (info->priv->mime_type);
899 info->priv->mime_type = g_strdup (mime_type);
901 g_object_notify (G_OBJECT (info), "mime-type");
905 * gupnp_protocol_info_set_dlna_profile:
906 * @info: A #GUPnPProtocolInfo
907 * @profile: The DLNA profile string
909 * Set the DLNA profile of this info.
911 * Return value: None.
914 gupnp_protocol_info_set_dlna_profile (GUPnPProtocolInfo *info,
917 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
919 if (info->priv->dlna_profile)
920 g_free (info->priv->dlna_profile);
921 info->priv->dlna_profile = g_strdup (profile);
923 g_object_notify (G_OBJECT (info), "dlna-profile");
927 * gupnp_protocol_info_set_play_speeds:
928 * @info: A #GUPnPProtocolInfo
929 * @speeds: The allowed play speeds
931 * Set the allowed play speeds on this info in the form of array of strings.
933 * Return value: None.
936 gupnp_protocol_info_set_play_speeds (GUPnPProtocolInfo *info,
939 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
941 if (info->priv->play_speeds)
942 g_strfreev (info->priv->play_speeds);
943 info->priv->play_speeds = (char **) g_boxed_copy (G_TYPE_STRV, speeds);
945 g_object_notify (G_OBJECT (info), "play-speeds");
949 * gupnp_protocol_info_set_dlna_conversion:
950 * @info: A #GUPnPProtocolInfo
951 * @conversion: The bitwise OR of one or more DLNA conversion flags
953 * Set the DLNA conversion flags.
955 * Return value: None.
958 gupnp_protocol_info_set_dlna_conversion (GUPnPProtocolInfo *info,
959 GUPnPDLNAConversion conversion)
961 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
963 info->priv->dlna_conversion = conversion;
965 g_object_notify (G_OBJECT (info), "dlna-conversion");
969 * gupnp_protocol_info_set_dlna_operation:
970 * @info: A #GUPnPProtocolInfo
971 * @operation: The bitwise OR of one or more DLNA operation flags
973 * Set the DLNA operation flags.
975 * Return value: None.
978 gupnp_protocol_info_set_dlna_operation (GUPnPProtocolInfo *info,
979 GUPnPDLNAOperation operation)
981 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
983 info->priv->dlna_operation = operation;
985 g_object_notify (G_OBJECT (info), "dlna-operation");
989 * gupnp_protocol_info_set_dlna_flags:
990 * @info: A #GUPnPProtocolInfo
991 * @flags: The bitwise OR of one or more generic DLNA flags
993 * Set the gereric DLNA flags.
995 * Return value: None.
998 gupnp_protocol_info_set_dlna_flags (GUPnPProtocolInfo *info,
999 GUPnPDLNAFlags flags)
1001 g_return_if_fail (GUPNP_IS_PROTOCOL_INFO (info));
1003 info->priv->dlna_flags = flags;
1005 g_object_notify (G_OBJECT (info), "dlna-flags");
1009 * gupnp_protocol_info_is_compatible:
1010 * @info1: The first #GUPnPProtocolInfo
1011 * @info2: The second #GUPnPProtocolInfo
1013 * Checks if the given protocolInfo string is compatible with @info.
1015 * Return value: #TRUE if @protocol_info is compatible with @info, otherwise
1019 gupnp_protocol_info_is_compatible (GUPnPProtocolInfo *info1,
1020 GUPnPProtocolInfo *info2)
1022 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info1), FALSE);
1023 g_return_val_if_fail (GUPNP_IS_PROTOCOL_INFO (info2), FALSE);
1025 return is_transport_compat (info1, info2) &&
1026 is_content_format_compat (info1, info2) &&
1027 is_additional_info_compat (info1, info2);