Logo Search packages:      
Sourcecode: srtp version File versions  Download package

err_status_t srtp_remove_stream ( srtp_t  session,
uint32_t  ssrc 

srtp_remove_stream() deallocates an SRTP stream.

The function call srtp_remove_stream(session, ssrc) removes the SRTP stream with the SSRC value ssrc from the SRTP session context given by the argument session.

session is the SRTP session from which the stream will be removed.
ssrc is the SSRC value of the stream to be removed.
Wildcard SSRC values cannot be removed from a session.
  • err_status_ok if the stream deallocation succeded.
  • [other] otherwise.

Definition at line 1282 of file srtp.c.

References err_status_bad_param, err_status_no_ctx, and err_status_ok.

  srtp_stream_ctx_t *stream, *last_stream;
  err_status_t status;

  /* sanity check arguments */
  if (session == NULL)
    return err_status_bad_param;
  /* find stream in list; complain if not found */
  last_stream = stream = session->stream_list;
  while ((stream != NULL) && (ssrc != stream->ssrc)) {
    last_stream = stream;
    stream = stream->next;
  if (stream == NULL)
    return err_status_no_ctx;

  /* remove stream from the list */
  last_stream->next = stream->next;

  /* deallocate the stream */
  status = srtp_stream_dealloc(session, stream);
  if (status)
    return status;

  return err_status_ok;

Generated by  Doxygen 1.6.0   Back to index