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"
Data Structures | |
struct | janus_streaming_rtp_keyframe |
struct | janus_streaming_rtp_relay_packet |
struct | janus_streaming_codecs |
struct | janus_streaming_rtp_source |
struct | janus_streaming_rtp_source_stream |
struct | janus_streaming_file_source |
struct | multiple_fds |
struct | janus_streaming_mountpoint |
struct | janus_streaming_helper |
struct | janus_streaming_message |
struct | janus_streaming_session_stream |
struct | janus_streaming_session |
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_codecs | janus_streaming_codecs |
typedef struct janus_streaming_rtp_source | janus_streaming_rtp_source |
typedef enum janus_streaming_media | janus_streaming_media |
typedef struct janus_streaming_rtp_source_stream | janus_streaming_rtp_source_stream |
typedef struct janus_streaming_file_source | janus_streaming_file_source |
typedef struct multiple_fds | multiple_fds |
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_stream | janus_streaming_session_stream |
typedef struct janus_streaming_session | janus_streaming_session |
Functions | |
janus_plugin * | create (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_result * | janus_streaming_handle_message (janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep) |
json_t * | janus_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_t * | janus_streaming_query_session (janus_plugin_session *handle) |
janus_streaming_rtp_source_stream * | janus_streaming_create_rtp_source_stream (const char *name, int mindex, const char *type, const char *mid, const char *label, const char *msid, char *mcast, char *miface, const janus_network_address *iface, uint16_t port, uint16_t port2, uint16_t port3, gboolean dortcp, uint16_t rtcpport, uint8_t pt, char *codec, char *fmtp, char *sprop, gboolean doskew, gboolean bufferkf, gboolean simulcast, gboolean svc, gboolean textdata, gboolean buffermsg) |
janus_streaming_mountpoint * | janus_streaming_create_rtp_source (uint64_t id, char *id_str, char *name, char *desc, char *metadata, GList *media, int srtpsuite, char *srtpcrypto, int threads, int rtp_collision, gboolean e2ee, gboolean playoutdelay_ext, int abscapturetime_src_ext_id) |
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 apt, char *acodec, char *afmtp, gboolean dovideo) |
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 *acodec, char *afmtp, gboolean dovideo, int videopt, char *vcodec, 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) |
Variables | |
GHashTable * | mountpoints = NULL |
GHashTable * | mountpoints_temp = NULL |
janus_mutex | mountpoints_mutex = JANUS_MUTEX_INITIALIZER |
Janus Streaming plugin.
Check the Streaming plugin documentation for more details.
#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_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_INVALID_SDP 461 |
#define JANUS_STREAMING_ERROR_INVALID_STATE 460 |
#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 10 |
#define JANUS_STREAMING_VERSION_STRING "0.0.10" |
typedef struct janus_streaming_codecs janus_streaming_codecs |
typedef struct janus_streaming_file_source janus_streaming_file_source |
typedef struct janus_streaming_helper janus_streaming_helper |
typedef enum janus_streaming_media janus_streaming_media |
typedef struct janus_streaming_message janus_streaming_message |
typedef struct janus_streaming_mountpoint janus_streaming_mountpoint |
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_rtp_source_stream janus_streaming_rtp_source_stream |
typedef struct janus_streaming_session janus_streaming_session |
typedef struct janus_streaming_session_stream janus_streaming_session_stream |
typedef enum janus_streaming_source janus_streaming_source |
typedef enum janus_streaming_type janus_streaming_type |
typedef struct multiple_fds multiple_fds |
enum janus_streaming_type |
janus_plugin * create | ( | void | ) |
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 | apt, | ||
char * | acodec, | ||
char * | afmtp, | ||
gboolean | dovideo ) |
janus_streaming_mountpoint * janus_streaming_create_rtp_source | ( | uint64_t | id, |
char * | id_str, | ||
char * | name, | ||
char * | desc, | ||
char * | metadata, | ||
GList * | media, | ||
int | srtpsuite, | ||
char * | srtpcrypto, | ||
int | threads, | ||
int | rtp_collision, | ||
gboolean | e2ee, | ||
gboolean | playoutdelay_ext, | ||
int | abscapturetime_src_ext_id ) |
janus_streaming_rtp_source_stream * janus_streaming_create_rtp_source_stream | ( | const char * | name, |
int | mindex, | ||
const char * | type, | ||
const char * | mid, | ||
const char * | label, | ||
const char * | msid, | ||
char * | mcast, | ||
char * | miface, | ||
const janus_network_address * | iface, | ||
uint16_t | port, | ||
uint16_t | port2, | ||
uint16_t | port3, | ||
gboolean | dortcp, | ||
uint16_t | rtcpport, | ||
uint8_t | pt, | ||
char * | codec, | ||
char * | fmtp, | ||
char * | sprop, | ||
gboolean | doskew, | ||
gboolean | bufferkf, | ||
gboolean | simulcast, | ||
gboolean | svc, | ||
gboolean | textdata, | ||
gboolean | buffermsg ) |
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 * | acodec, | ||
char * | afmtp, | ||
gboolean | dovideo, | ||
int | videopt, | ||
char * | vcodec, | ||
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 ) |
void janus_streaming_create_session | ( | janus_plugin_session * | handle, |
int * | error ) |
void janus_streaming_data_ready | ( | janus_plugin_session * | handle | ) |
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, |
janus_plugin_rtcp * | packet ) |
void janus_streaming_incoming_rtp | ( | janus_plugin_session * | handle, |
janus_plugin_rtp * | packet ) |
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 | ) |
GHashTable* mountpoints = NULL |
janus_mutex mountpoints_mutex = JANUS_MUTEX_INITIALIZER |
GHashTable * mountpoints_temp = NULL |