Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
plugin.h
Go to the documentation of this file.
1 
146 #ifndef _JANUS_PLUGIN_H
147 #define _JANUS_PLUGIN_H
148 
149 #include <stdlib.h>
150 #include <stdint.h>
151 #include <stdio.h>
152 #include <string.h>
153 #include <ctype.h>
154 #include <unistd.h>
155 #include <inttypes.h>
156 
157 
167 #define JANUS_PLUGIN_API_VERSION 4
168 
185 #define JANUS_PLUGIN_INIT(...) { \
186  .init = NULL, \
187  .destroy = NULL, \
188  .get_api_compatibility = NULL, \
189  .get_version = NULL, \
190  .get_version_string = NULL, \
191  .get_description = NULL, \
192  .get_name = NULL, \
193  .get_author = NULL, \
194  .get_package = NULL, \
195  .create_session = NULL, \
196  .handle_message = NULL, \
197  .setup_media = NULL, \
198  .incoming_rtp = NULL, \
199  .incoming_rtcp = NULL, \
200  .incoming_data = NULL, \
201  .slow_link = NULL, \
202  .hangup_media = NULL, \
203  .destroy_session = NULL, \
204  .query_session = NULL, \
205  ## __VA_ARGS__ }
206 
207 
211 typedef struct janus_plugin janus_plugin;
216 
225  int stopped:1;
226 };
227 
229 struct janus_plugin {
234  int (* const init)(janus_callbacks *callback, const char *config_path);
236  void (* const destroy)(void);
237 
244  int (* const get_api_compatibility)(void);
246  int (* const get_version)(void);
248  const char *(* const get_version_string)(void);
250  const char *(* const get_description)(void);
252  const char *(* const get_name)(void);
254  const char *(* const get_author)(void);
256  const char *(* const get_package)(void);
257 
261  void (* const create_session)(janus_plugin_session *handle, int *error);
268  struct janus_plugin_result * (* const handle_message)(janus_plugin_session *handle, char *transaction, char *message, char *sdp_type, char *sdp);
271  void (* const setup_media)(janus_plugin_session *handle);
277  void (* const incoming_rtp)(janus_plugin_session *handle, int video, char *buf, int len);
283  void (* const incoming_rtcp)(janus_plugin_session *handle, int video, char *buf, int len);
291  void (* const incoming_data)(janus_plugin_session *handle, char *buf, int len);
308  void (* const slow_link)(janus_plugin_session *handle, int uplink, int video);
311  void (* const hangup_media)(janus_plugin_session *handle);
315  void (* const destroy_session)(janus_plugin_session *handle, int *error);
321  char *(* const query_session)(janus_plugin_session *handle);
322 
323 };
324 
334  int (* const push_event)(janus_plugin_session *handle, janus_plugin *plugin, const char *transaction, const char *message, const char *sdp_type, const char *sdp);
335 
341  void (* const relay_rtp)(janus_plugin_session *handle, int video, char *buf, int len);
347  void (* const relay_rtcp)(janus_plugin_session *handle, int video, char *buf, int len);
352  void (* const relay_data)(janus_plugin_session *handle, char *buf, int len);
353 
358  void (* const close_pc)(janus_plugin_session *handle);
363  void (* const end_session)(janus_plugin_session *handle);
364 
365 };
366 
368 typedef janus_plugin* create_p(void);
369 
370 
389 
390 
399 
412  char *content;
413 };
414 
422 
428 
429 
430 #endif