Fork me on GitHub
No Matches
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 "../sdp-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


#define JANUS_STREAMING_DEFAULT_SESSION_TIMEOUT   0 /* Overwrite the RTSP session timeout. If set to zero, the RTSP timeout is derived from a session. */
#define JANUS_STREAMING_DEFAULT_RECONNECT_DELAY   5 /* Reconnecting delay in seconds. */
#define JANUS_STREAMING_DEFAULT_CURL_TIMEOUT   10L /* Communication timeout for cURL. */
#define JANUS_STREAMING_DEFAULT_CURL_CONNECT_TIMEOUT   5L /* Connection timeout for cURL. */
#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 an external source."
#define JANUS_STREAMING_NAME   "JANUS Streaming plugin"
#define JANUS_STREAMING_AUTHOR   "Meetecho s.r.l."
#define JANUS_STREAMING_PACKAGE   "janus.plugin.streaming"
#define DEFAULT_RTP_RANGE_MIN   10000
#define DEFAULT_RTP_RANGE_MAX   60000


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


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 }


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)
json_tjanus_streaming_handle_admin_message (json_t *message)
void janus_streaming_setup_media (janus_plugin_session *handle)
void janus_streaming_incoming_rtp (janus_plugin_session *handle, janus_plugin_rtp *packet)
void janus_streaming_incoming_rtcp (janus_plugin_session *handle, janus_plugin_rtcp *packet)
void janus_streaming_data_ready (janus_plugin_session *handle)
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 *id_str, char *name, char *desc, char *metadata, int srtpsuite, char *srtpcrypto, int threads, gboolean e2ee, gboolean playoutdelay_ext, gboolean doaudio, gboolean doaudiortcp, char *amcast, const janus_network_address *aiface, uint16_t aport, uint16_t artcpport, uint8_t acodec, char *artpmap, char *afmtp, gboolean doaskew, gboolean dovideo, gboolean dovideortcp, char *vmcast, const janus_network_address *viface, uint16_t vport, uint16_t vrtcpport, uint8_t vcodec, char *vrtpmap, char *vfmtp, char *sprop, 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 textdata, gboolean buffermsg)
janus_streaming_mountpointjanus_streaming_create_file_source (uint64_t id, char *id_str, char *name, char *desc, char *metadata, char *filename, gboolean live, gboolean doaudio, uint8_t acodec, char *artpmap, char *afmtp, gboolean dovideo)
janus_streaming_mountpointjanus_streaming_create_rtsp_source (uint64_t id, char *id_str, char *name, char *desc, char *metadata, char *url, char *username, char *password, gboolean quirk, gboolean doaudio, int audiopt, char *artpmap, char *afmtp, gboolean dovideo, int videopt, char *vrtpmap, char *vfmtp, gboolean bufferkf, const janus_network_address *iface, int threads, gint64 reconnect_delay, gint64 session_timeout, int rtsp_timeout, int rtsp_conn_timeout, gboolean error_on_failure)


GHashTable * mountpoints = NULL
GHashTable * mountpoints_temp = NULL
janus_mutex mountpoints_mutex = JANUS_MUTEX_INITIALIZER

Detailed Description

Janus Streaming plugin.

Lorenzo Miniero

Check the Streaming plugin documentation for more details.


Macro Definition Documentation


#define DEFAULT_RTP_RANGE_MAX   60000


#define DEFAULT_RTP_RANGE_MIN   10000


#define JANUS_STREAMING_AUTHOR   "Meetecho s.r.l."


#define JANUS_STREAMING_DEFAULT_CURL_CONNECT_TIMEOUT   5L /* Connection timeout for cURL. */


#define JANUS_STREAMING_DEFAULT_CURL_TIMEOUT   10L /* Communication timeout for cURL. */


#define JANUS_STREAMING_DEFAULT_RECONNECT_DELAY   5 /* Reconnecting delay in seconds. */


#define JANUS_STREAMING_DEFAULT_SESSION_TIMEOUT   0 /* Overwrite the RTSP session timeout. If set to zero, the RTSP timeout is derived from a session. */


#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 an external source."




























#define JANUS_STREAMING_NAME   "JANUS Streaming plugin"


#define JANUS_STREAMING_PACKAGE   "janus.plugin.streaming"





Typedef Documentation

◆ janus_streaming_codecs

◆ janus_streaming_file_source

◆ janus_streaming_helper

◆ janus_streaming_message

◆ janus_streaming_mountpoint

◆ janus_streaming_rtp_keyframe

◆ janus_streaming_rtp_relay_packet

◆ janus_streaming_rtp_source

◆ janus_streaming_session

◆ janus_streaming_source

◆ janus_streaming_type

◆ multiple_fds

typedef struct multiple_fds multiple_fds

Enumeration Type Documentation

◆ janus_streaming_source


◆ janus_streaming_type


Function Documentation

◆ create()

janus_plugin * create ( void  )

◆ janus_streaming_create_file_source()

janus_streaming_mountpoint * janus_streaming_create_file_source ( uint64_t  id,
char *  id_str,
char *  name,
char *  desc,
char *  metadata,
char *  filename,
gboolean  live,
gboolean  doaudio,
uint8_t  acodec,
char *  artpmap,
char *  afmtp,
gboolean  dovideo 

◆ janus_streaming_create_rtp_source()

janus_streaming_mountpoint * janus_streaming_create_rtp_source ( uint64_t  id,
char *  id_str,
char *  name,
char *  desc,
char *  metadata,
int  srtpsuite,
char *  srtpcrypto,
int  threads,
gboolean  e2ee,
gboolean  playoutdelay_ext,
gboolean  doaudio,
gboolean  doaudiortcp,
char *  amcast,
const janus_network_address aiface,
uint16_t  aport,
uint16_t  artcpport,
uint8_t  acodec,
char *  artpmap,
char *  afmtp,
gboolean  doaskew,
gboolean  dovideo,
gboolean  dovideortcp,
char *  vmcast,
const janus_network_address viface,
uint16_t  vport,
uint16_t  vrtcpport,
uint8_t  vcodec,
char *  vrtpmap,
char *  vfmtp,
char *  sprop,
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  textdata,
gboolean  buffermsg 

◆ janus_streaming_create_rtsp_source()

janus_streaming_mountpoint * janus_streaming_create_rtsp_source ( uint64_t  id,
char *  id_str,
char *  name,
char *  desc,
char *  metadata,
char *  url,
char *  username,
char *  password,
gboolean  quirk,
gboolean  doaudio,
int  audiopt,
char *  artpmap,
char *  afmtp,
gboolean  dovideo,
int  videopt,
char *  vrtpmap,
char *  vfmtp,
gboolean  bufferkf,
const janus_network_address iface,
int  threads,
gint64  reconnect_delay,
gint64  session_timeout,
int  rtsp_timeout,
int  rtsp_conn_timeout,
gboolean  error_on_failure 

◆ janus_streaming_create_session()

void janus_streaming_create_session ( janus_plugin_session handle,
int *  error 

◆ janus_streaming_data_ready()

void janus_streaming_data_ready ( janus_plugin_session handle)

◆ janus_streaming_destroy()

void janus_streaming_destroy ( void  )

◆ janus_streaming_destroy_session()

void janus_streaming_destroy_session ( janus_plugin_session handle,
int *  error 

◆ janus_streaming_get_api_compatibility()

int janus_streaming_get_api_compatibility ( void  )

◆ janus_streaming_get_author()

const char * janus_streaming_get_author ( void  )

◆ janus_streaming_get_description()

const char * janus_streaming_get_description ( void  )

◆ janus_streaming_get_name()

const char * janus_streaming_get_name ( void  )

◆ janus_streaming_get_package()

const char * janus_streaming_get_package ( void  )

◆ janus_streaming_get_version()

int janus_streaming_get_version ( void  )

◆ janus_streaming_get_version_string()

const char * janus_streaming_get_version_string ( void  )

◆ janus_streaming_handle_admin_message()

json_t * janus_streaming_handle_admin_message ( json_t message)

◆ janus_streaming_handle_message()

struct janus_plugin_result * janus_streaming_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 

◆ janus_streaming_hangup_media()

void janus_streaming_hangup_media ( janus_plugin_session handle)

◆ janus_streaming_incoming_rtcp()

void janus_streaming_incoming_rtcp ( janus_plugin_session handle,
janus_plugin_rtcp packet 

◆ janus_streaming_incoming_rtp()

void janus_streaming_incoming_rtp ( janus_plugin_session handle,
janus_plugin_rtp packet 

◆ janus_streaming_init()

int janus_streaming_init ( janus_callbacks callback,
const char *  config_path 

◆ janus_streaming_query_session()

json_t * janus_streaming_query_session ( janus_plugin_session handle)

◆ janus_streaming_setup_media()

void janus_streaming_setup_media ( janus_plugin_session handle)

Variable Documentation

◆ mountpoints

GHashTable* mountpoints = NULL

◆ mountpoints_mutex

janus_mutex mountpoints_mutex = JANUS_MUTEX_INITIALIZER

◆ mountpoints_temp

GHashTable * mountpoints_temp = NULL