-
- msg_Dbg( p_announce, "registering announce");
- if( p_method->i_type == METHOD_TYPE_SAP )
- {
- /* Do we already have a SAP announce handler ? */
- if( !p_announce->p_sap )
- {
- msg_Dbg( p_announce, "creating SAP announce handler");
- sap_handler_t *p_sap = announce_SAPHandlerCreate( p_announce );
- if( !p_sap )
- {
- msg_Err( p_announce, "SAP handler creation failed" );
- return VLC_ENOOBJ;
- }
- p_announce->p_sap = p_sap;
- }
- /* this will set p_session->p_sap for later deletion */
- msg_Dbg( p_announce, "adding SAP session");
- p_announce->p_sap->pf_add( p_announce->p_sap, p_session, p_method );
- }
- else if( p_method->i_type == METHOD_TYPE_SLP )
- {
- msg_Dbg( p_announce, "SLP unsupported at the moment" );
- return VLC_EGENERIC;
- }
- else
- {
- msg_Dbg( p_announce, "Announce type unsupported" );
- return VLC_EGENERIC;
- }
- return VLC_SUCCESS;;
-}
-
-
-/* Unregister an announce */
-int announce_UnRegister( announce_handler_t *p_announce,
- session_descriptor_t *p_session )
-{
- msg_Dbg( p_announce, "unregistering announce" );
- if( p_session->p_sap != NULL ) /* SAP Announce */
- {
- if( !p_announce->p_sap )
- {
- msg_Err( p_announce, "can't remove announce, no SAP handler");
- return VLC_ENOOBJ;
- }
- p_announce->p_sap->pf_del( p_announce->p_sap, p_session );
- }
- return VLC_SUCCESS;