mediastreamer2 2.12.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Functions
Text_stream_api

## Functions
TextStream * | text_stream_new (int loc_rtp_port, int loc_rtcp_port, bool_t ipv6)
TextStream * | text_stream_new_with_sessions (const MSMediaStreamSessions *sessions)
TextStream * | text_stream_new2 (const char *ip, int loc_rtp_port, int loc_rtcp_port)
TextStream * | text_stream_start (TextStream *stream, RtpProfile *profile, const char *rem_rtp_addr, int rem_rtp_port, const char *rem_rtcp_addr, int rem_rtcp_port, int payload_type)
void | text_stream_stop (TextStream *stream)
void | text_stream_iterate (TextStream *stream)
char | text_stream_getchar (TextStream *stream)
void | text_stream_putchar (TextStream *stream, const char c)
uint32_t | text_stream_getchar32 (TextStream *stream)
void | text_stream_putchar32 (TextStream *stream, uint32_t i)

## Detailed Description

## Function Documentation

TextStream* text_stream_new | ( | int | loc_rtp_port,
|  | int | loc_rtcp_port,
|  | bool_t | ipv6
| ) |  |

Creates a TextStream object listening on a RTP port.

Parameters

  loc_rtp_port | the local UDP port to listen for RTP packets.
  loc_rtcp_port | the local UDP port to listen for RTCP packets
  ipv6 | TRUE if ipv6 must be used.

Returns
  a new TextStream.

TextStream* text_stream_new_with_sessions | ( | const MSMediaStreamSessions * | sessions | ) |

Creates a TextStream object from initialized MSMediaStreamSessions.

Parameters

  sessions | the MSMediaStreamSessions

Returns
  a new TextStream

TextStream* text_stream_new2 | ( | const char * | ip,
|  | int | loc_rtp_port,
|  | int | loc_rtcp_port
| ) |  |

Creates a TextStream object listening on a RTP port for a dedicated address.

Parameters

  | loc_ip | the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
  [in] | loc_rtp_port | the local UDP port to listen for RTP packets.
  [in] | loc_rtcp_port | the local UDP port to listen for RTCP packets

Returns
  a new TextStream.

TextStream* text_stream_start | ( | TextStream * | stream,
|  | RtpProfile * | profile,
|  | const char * | rem_rtp_addr,
|  | int | rem_rtp_port,
|  | const char * | rem_rtcp_addr,
|  | int | rem_rtcp_port,
|  | int | payload_type
| ) |  |

Starts a text stream.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().
  [in] | profile | RtpProfile object holding the PayloadType that can be used during the text session.
  [in] | rem_rtp_addr | The remote IP address where to send the text to.
  [in] | rem_rtp_port | The remote port where to send the text to.
  [in] | rem_rtcp_addr | The remote IP address for RTCP.
  [in] | rem_rtcp_port | The remote port for RTCP.
  [in] | payload_type | The payload type number used to send the text stream. A valid PayloadType must be available at this index in the profile.

void text_stream_stop | ( | TextStream * | stream | ) |

Stops the text streaming thread and free everything

void text_stream_iterate | ( | TextStream * | stream | ) |

Executes background low priority tasks related to text processing (RTP statistics analysis). It should be called periodically, for example with an interval of 100 ms or so.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().

char text_stream_getchar | ( | TextStream * | stream | ) |

Reads a character from the stream.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().

Returns
  the character read or '\0' if there are no more character to read in the steam.

void text_stream_putchar | ( | TextStream * | stream,
|  | const char | c
| ) |  |

Writes a character to the stream. To write an utf8 character, just call it multiple times.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().
  [in] | c | the Char to send.

uint32_t text_stream_getchar32 | ( | TextStream * | stream | ) |

Reads a character from the stream in UTF-32 format.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().

Returns
  the character in UTF-32 format.

void text_stream_putchar32 | ( | TextStream * | stream,
|  | uint32_t | i
| ) |  |

Writes a character to stream in UTF-32 format.

Parameters

  [in] | stream | TextStream object previously created with text_stream_new().
  [in] | i | the Char in UTF-32 format.