rtmp: add rtmp_set_handlers

This commit is contained in:
Alfred E. Heggestad 2019-01-09 12:18:36 +01:00
parent 5bf4300459
commit a874c158cd
2 changed files with 14 additions and 0 deletions

View file

@ -81,6 +81,8 @@ int rtmp_accept(struct rtmp_conn **connp, struct tcp_sock *ts,
rtmp_command_h *cmdh, rtmp_close_h *closeh, void *arg);
int rtmp_control(const struct rtmp_conn *conn,
enum rtmp_packet_type type, ...);
void rtmp_set_handlers(struct rtmp_conn *conn, rtmp_command_h *cmdh,
rtmp_close_h *closeh, void *arg);
struct tcp_conn *rtmp_conn_tcpconn(const struct rtmp_conn *conn);
const char *rtmp_conn_stream(const struct rtmp_conn *conn);
int rtmp_conn_debug(struct re_printf *pf, const struct rtmp_conn *conn);

View file

@ -960,6 +960,18 @@ const char *rtmp_conn_stream(const struct rtmp_conn *conn)
}
void rtmp_set_handlers(struct rtmp_conn *conn, rtmp_command_h *cmdh,
rtmp_close_h *closeh, void *arg)
{
if (!conn)
return;
conn->cmdh = cmdh;
conn->closeh = closeh;
conn->arg = arg;
}
static const char *rtmp_handshake_name(enum rtmp_handshake_state state)
{
switch (state) {