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_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 |
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_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_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_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_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) |
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 9 |
#define JANUS_STREAMING_VERSION_STRING "0.0.9" |
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 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_session janus_streaming_session |
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 | acodec, | ||
char * | artpmap, | ||
char * | afmtp, | ||
gboolean | dovideo ) |
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_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 ) |
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 |