event.h 631 Bytes
Newer Older
1 2 3 4 5 6

#ifndef _EVENT_H
#define _EVENT_H

#include <glib.h>

Dafydd Harries's avatar
Dafydd Harries committed
7 8
#include "candidate.h"

9 10
G_BEGIN_DECLS

11
typedef enum
12
{
Dafydd Harries's avatar
Dafydd Harries committed
13 14
  NICE_EVENT_COMPONENT_CONNECTED,
  NICE_EVENT_CANDIDATE_SELECTED,
15
} NiceEventType;
16 17 18 19 20 21 22 23 24 25


typedef struct _NiceEvent NiceEvent;

struct _NiceEvent
{
  NiceEventType type;

  union {
    struct {
Dafydd Harries's avatar
Dafydd Harries committed
26 27 28 29
      guint stream_id;
      guint component_id;
      NiceAddress addr;
    } component_connected;
30
    struct {
Dafydd Harries's avatar
Dafydd Harries committed
31 32 33
      NiceCandidate *local;
      NiceCandidate *remote;
    } candidate_selected;
34 35 36 37 38 39 40 41 42 43 44 45 46 47
  };
};


NiceEvent *
_nice_event_new (NiceEventType type);

void
nice_event_free (NiceEvent *ev);

G_END_DECLS

#endif /* _EVENT_H */