Fork me on GitHub
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
janus_streaming.c File Reference

Janus Streaming plugin. More...

#include "plugin.h"
#include <errno.h>
#include <netdb.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <jansson.h>
#include "../debug.h"
#include "../apierror.h"
#include "../config.h"
#include "../mutex.h"
#include "../rtp.h"
#include "../rtpsrtp.h"
#include "../rtcp.h"
#include "../record.h"
#include "../utils.h"
#include "../ip-utils.h"
Include dependency graph for janus_streaming.c:

Data Structures

struct  janus_streaming_rtp_keyframe
 
struct  janus_streaming_rtp_relay_packet
 
struct  janus_streaming_rtp_source
 
struct  janus_streaming_file_source
 
struct  multiple_fds
 
struct  janus_streaming_codecs
 
struct  janus_streaming_mountpoint
 
struct  janus_streaming_helper
 
struct  janus_streaming_message
 
struct  janus_streaming_session
 

Macros

#define JANUS_STREAMING_VERSION   8
 
#define JANUS_STREAMING_VERSION_STRING   "0.0.8"
 
#define JANUS_STREAMING_DESCRIPTION   "This is a streaming plugin for Janus, allowing WebRTC peers to watch/listen to pre-recorded files or media generated by gstreamer."
 
#define JANUS_STREAMING_NAME   "JANUS Streaming plugin"
 
#define JANUS_STREAMING_AUTHOR   "Meetecho s.r.l."
 
#define JANUS_STREAMING_PACKAGE   "janus.plugin.streaming"
 
#define JANUS_STREAMING_ERROR_NO_MESSAGE   450
 
#define JANUS_STREAMING_ERROR_INVALID_JSON   451
 
#define JANUS_STREAMING_ERROR_INVALID_REQUEST   452
 
#define JANUS_STREAMING_ERROR_MISSING_ELEMENT   453
 
#define JANUS_STREAMING_ERROR_INVALID_ELEMENT   454
 
#define JANUS_STREAMING_ERROR_NO_SUCH_MOUNTPOINT   455
 
#define JANUS_STREAMING_ERROR_CANT_CREATE   456
 
#define JANUS_STREAMING_ERROR_UNAUTHORIZED   457
 
#define JANUS_STREAMING_ERROR_CANT_SWITCH   458
 
#define JANUS_STREAMING_ERROR_CANT_RECORD   459
 
#define JANUS_STREAMING_ERROR_UNKNOWN_ERROR   470
 

Typedefs

typedef enum janus_streaming_type janus_streaming_type
 
typedef enum janus_streaming_source janus_streaming_source
 
typedef struct janus_streaming_rtp_keyframe janus_streaming_rtp_keyframe
 
typedef struct janus_streaming_rtp_relay_packet janus_streaming_rtp_relay_packet
 
typedef struct janus_streaming_rtp_source janus_streaming_rtp_source
 
typedef struct janus_streaming_file_source janus_streaming_file_source
 
typedef struct multiple_fds multiple_fds
 
typedef struct janus_streaming_codecs janus_streaming_codecs
 
typedef struct janus_streaming_mountpoint janus_streaming_mountpoint
 
typedef struct janus_streaming_helper janus_streaming_helper
 
typedef struct janus_streaming_message janus_streaming_message
 
typedef struct janus_streaming_session janus_streaming_session
 

Enumerations

enum  janus_streaming_type { janus_streaming_type_none = 0, janus_streaming_type_live, janus_streaming_type_on_demand }
 
enum  janus_streaming_source { janus_streaming_source_none = 0, janus_streaming_source_file, janus_streaming_source_rtp }
 

Functions

janus_plugincreate (void)
 
int janus_streaming_init (janus_callbacks *callback, const char *config_path)
 
void janus_streaming_destroy (void)
 
int janus_streaming_get_api_compatibility (void)
 
int janus_streaming_get_version (void)
 
const char * janus_streaming_get_version_string (void)
 
const char * janus_streaming_get_description (void)
 
const char * janus_streaming_get_name (void)
 
const char * janus_streaming_get_author (void)
 
const char * janus_streaming_get_package (void)
 
void janus_streaming_create_session (janus_plugin_session *handle, int *error)
 
struct janus_plugin_resultjanus_streaming_handle_message (janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep)
 
void janus_streaming_setup_media (janus_plugin_session *handle)
 
void janus_streaming_incoming_rtp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_streaming_incoming_rtcp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_streaming_hangup_media (janus_plugin_session *handle)
 
void janus_streaming_destroy_session (janus_plugin_session *handle, int *error)
 
json_tjanus_streaming_query_session (janus_plugin_session *handle)
 
janus_streaming_mountpointjanus_streaming_create_rtp_source (uint64_t id, char *name, char *desc, int srtpsuite, char *srtpcrypto, int threads, gboolean doaudio, char *amcast, const janus_network_address *aiface, uint16_t aport, uint16_t artcpport, uint8_t acodec, char *artpmap, char *afmtp, gboolean doaskew, gboolean dovideo, char *vmcast, const janus_network_address *viface, uint16_t vport, uint16_t vrtcpport, uint8_t vcodec, char *vrtpmap, char *vfmtp, gboolean bufferkf, gboolean simulcast, uint16_t vport2, uint16_t vport3, gboolean svc, gboolean dovskew, int rtp_collision, gboolean dodata, const janus_network_address *diface, uint16_t dport, gboolean buffermsg)
 
janus_streaming_mountpointjanus_streaming_create_file_source (uint64_t id, char *name, char *desc, char *filename, gboolean live, gboolean doaudio, gboolean dovideo)
 
janus_streaming_mountpointjanus_streaming_create_rtsp_source (uint64_t id, char *name, char *desc, char *url, char *username, char *password, gboolean doaudio, char *artpmap, char *afmtp, gboolean dovideo, char *vrtpmap, char *vfmtp, const janus_network_address *iface, gboolean error_on_failure)
 

Variables

GHashTable * mountpoints
 
janus_mutex mountpoints_mutex
 

Detailed Description

Janus Streaming plugin.

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Check the Streaming plugin documentation for more details.

Plugins

Macro Definition Documentation

#define JANUS_STREAMING_AUTHOR   "Meetecho s.r.l."
#define JANUS_STREAMING_DESCRIPTION   "This is a streaming plugin for Janus, allowing WebRTC peers to watch/listen to pre-recorded files or media generated by gstreamer."
#define JANUS_STREAMING_ERROR_CANT_CREATE   456
#define JANUS_STREAMING_ERROR_CANT_RECORD   459
#define JANUS_STREAMING_ERROR_CANT_SWITCH   458
#define JANUS_STREAMING_ERROR_INVALID_ELEMENT   454
#define JANUS_STREAMING_ERROR_INVALID_JSON   451
#define JANUS_STREAMING_ERROR_INVALID_REQUEST   452
#define JANUS_STREAMING_ERROR_MISSING_ELEMENT   453
#define JANUS_STREAMING_ERROR_NO_MESSAGE   450
#define JANUS_STREAMING_ERROR_NO_SUCH_MOUNTPOINT   455
#define JANUS_STREAMING_ERROR_UNAUTHORIZED   457
#define JANUS_STREAMING_ERROR_UNKNOWN_ERROR   470
#define JANUS_STREAMING_NAME   "JANUS Streaming plugin"
#define JANUS_STREAMING_PACKAGE   "janus.plugin.streaming"
#define JANUS_STREAMING_VERSION   8
#define JANUS_STREAMING_VERSION_STRING   "0.0.8"

Typedef Documentation

typedef struct multiple_fds multiple_fds

Enumeration Type Documentation

Enumerator
janus_streaming_source_none 
janus_streaming_source_file 
janus_streaming_source_rtp 
Enumerator
janus_streaming_type_none 
janus_streaming_type_live 
janus_streaming_type_on_demand 

Function Documentation

janus_plugin* create ( void  )
janus_streaming_mountpoint * janus_streaming_create_file_source ( uint64_t  id,
char *  name,
char *  desc,
char *  filename,
gboolean  live,
gboolean  doaudio,
gboolean  dovideo 
)
janus_streaming_mountpoint * janus_streaming_create_rtp_source ( uint64_t  id,
char *  name,
char *  desc,
int  srtpsuite,
char *  srtpcrypto,
int  threads,
gboolean  doaudio,
char *  amcast,
const janus_network_address aiface,
uint16_t  aport,
uint16_t  artcpport,
uint8_t  acodec,
char *  artpmap,
char *  afmtp,
gboolean  doaskew,
gboolean  dovideo,
char *  vmcast,
const janus_network_address viface,
uint16_t  vport,
uint16_t  vrtcpport,
uint8_t  vcodec,
char *  vrtpmap,
char *  vfmtp,
gboolean  bufferkf,
gboolean  simulcast,
uint16_t  vport2,
uint16_t  vport3,
gboolean  svc,
gboolean  dovskew,
int  rtp_collision,
gboolean  dodata,
const janus_network_address diface,
uint16_t  dport,
gboolean  buffermsg 
)
janus_streaming_mountpoint * janus_streaming_create_rtsp_source ( uint64_t  id,
char *  name,
char *  desc,
char *  url,
char *  username,
char *  password,
gboolean  doaudio,
char *  artpmap,
char *  afmtp,
gboolean  dovideo,
char *  vrtpmap,
char *  vfmtp,
const janus_network_address iface,
gboolean  error_on_failure 
)
void janus_streaming_create_session ( janus_plugin_session handle,
int *  error 
)
void janus_streaming_destroy ( void  )
void janus_streaming_destroy_session ( janus_plugin_session handle,
int *  error 
)
int janus_streaming_get_api_compatibility ( void  )
const char * janus_streaming_get_author ( void  )
const char * janus_streaming_get_description ( void  )
const char * janus_streaming_get_name ( void  )
const char * janus_streaming_get_package ( void  )
int janus_streaming_get_version ( void  )
const char * janus_streaming_get_version_string ( void  )
struct janus_plugin_result * janus_streaming_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 
)
void janus_streaming_hangup_media ( janus_plugin_session handle)
void janus_streaming_incoming_rtcp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
void janus_streaming_incoming_rtp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
int janus_streaming_init ( janus_callbacks callback,
const char *  config_path 
)
json_t * janus_streaming_query_session ( janus_plugin_session handle)
void janus_streaming_setup_media ( janus_plugin_session handle)

Variable Documentation

GHashTable* mountpoints
janus_mutex mountpoints_mutex