9#ifndef Red5Pro_global_h
10#define Red5Pro_global_h
21#define STRINGIFY_(s) #s
22#define STRINGIFY(s) STRINGIFY_(s)
24#define R5PRO_MAJOR_VERSION 10
25#define R5PRO_MINOR_VERSION 0
26#define R5PRO_REVISION 0
27#define R5PRO_BUILD b826
30#define R5PRO_VERSION STRINGIFY(R5PRO_MAJOR_VERSION.R5PRO_MINOR_VERSION.R5PRO_REVISION.R5PRO_BUILD)
31#define R5PRO_VERSION_ISRELEASE 0
32#define R5PRO_VERSION_CHECK(maj, min) ((maj==MYLIB_MAJOR_VERSION) && (min<=MYLIB_MINOR_VERSION))
34#define SEC_TO_NANO 1e9
37#define SW_DECODE_YUV 1
39#if defined(__APPLE__) && defined(__MACH__)
41#include <TargetConditionals.h>
42#if TARGET_IPHONE_SIMULATOR == 1
45#elif TARGET_OS_IPHONE == 1
48#elif TARGET_OS_MAC == 1
54#if TARGET_OS_IPHONE == 1
55#define LOG(...) fprintf(stdout, __VA_ARGS__);
56#define LOGD(M, ...) if(r5_get_log_level() <= (int)r5_log_level_debug) fprintf(stderr, "[R5 DEBUG]" M "\n", ##__VA_ARGS__)
57#define LOGI(M, ...) if(r5_get_log_level() <= (int)r5_log_level_info) fprintf(stderr, "[R5 INFO] " M "\n", ##__VA_ARGS__)
58#define LOGW(M, ...) if(r5_get_log_level() <= (int)r5_log_level_warn) fprintf(stderr, "[R5 WARNING] " M "\n", ##__VA_ARGS__);
59#define LOGE(M, ...) if(r5_get_log_level() <= (int)r5_log_level_error) fprintf(stderr, "[R5 ERROR] " M "\n", ##__VA_ARGS__);
62#include <android/log.h>
63#define LOG(...) __android_log_print(ANDROID_LOG_INFO, "r5pro", __VA_ARGS__);
64#define LOGD(M, ...) if(r5_get_log_level() <= (int)r5_log_level_debug) LOG(M, ##__VA_ARGS__)
65#define LOGI(M, ...) if(r5_get_log_level() <= (int)r5_log_level_info) LOG( M, ##__VA_ARGS__)
66#define LOGW(M, ...) if(r5_get_log_level() <= (int)r5_log_level_warn) LOG( M, ##__VA_ARGS__);
67#define LOGE(M, ...) if(r5_get_log_level() <= (int)r5_log_level_error) LOG(M, ##__VA_ARGS__);
70#define check_mem(A) check((A), "Out of memory.")
122 r5_stream_mode_subscribe,
123 r5_stream_mode_publish
131 r5_buffer_state_buffered,
132 r5_buffer_state_needs_rebuffer,
133 r5_buffer_state_flush_buffer,
134 r5_buffer_state_rebuffering
163 r5_stream_format_unknown,
183 typedef struct client_ctx client_ctx;
210 int requires_sdk_license(
void);
258 r5_stats *r5_client_stats(client_ctx* client);
260void freeEndPause(
void);
r5_buffer_state
Definition: global.h:130
const char * r5_string_for_status(int status)
r5_status
Definition: global.h:92
r5_protocol
Definition: global.h:173
void r5_set_log_level(int level)
int r5_get_log_level(void)
r5_scale_mode
Definition: global.h:141
r5_stream_mode
Definition: global.h:120
enum r5_stream_mode r5_stream_mode_t
r5_media_type
Definition: global.h:151
r5_stream_format
Definition: global.h:162
r5_log_level
Definition: global.h:81
@ r5_status_hardware_decode_error
There was a problem using hardware acceleration to start decode of incoming stream.
Definition: global.h:113
@ r5_status_license_error
An error in validating the SDK license.
Definition: global.h:105
@ r5_status_stop_streaming
Streaming content has stopped.
Definition: global.h:99
@ r5_status_video_mute
Publisher has muted their video stream.
Definition: global.h:103
@ r5_status_audio_mute
Publisher has muted their audio stream.
Definition: global.h:101
@ r5_status_buffer_flush_empty
Publisher has completed flushing queued packets post-broadcast.
Definition: global.h:108
@ r5_status_buffer_flush_start
Publisher has started flushing queued packets post-broadcast.
Definition: global.h:107
@ r5_status_abr_level_change
ABR Publisher has changed broadcast level.
Definition: global.h:110
@ r5_status_audio_unmute
Publisher has unmuted their audio stream.
Definition: global.h:102
@ r5_status_connection_error
There was an error with the connection.
Definition: global.h:95
@ r5_status_video_unmute
Publisher has unmuted their video stream.
Definition: global.h:104
@ r5_status_license_valid
The license key provided for the SDK is deemed valid.
Definition: global.h:106
@ r5_status_start_streaming
Streaming content has begun as a publisher or subscriber.
Definition: global.h:98
@ r5_status_srtp_key_handle_error
There was a problem in the key exchange with the server.
Definition: global.h:112
@ r5_status_connected
A connection with the server has been established. Streaming has not started yet.
Definition: global.h:93
@ r5_status_netstatus
A netstatus event has been received from the server.
Definition: global.h:100
@ r5_status_disconnected
The connection with the server has been lost.
Definition: global.h:94
@ r5_status_video_render_start
Subscriber has rendered first video frame.
Definition: global.h:109
@ r5_status_connection_close
The connection is fully closed. Wait for this before releasing assets.
Definition: global.h:97
@ r5_status_srtp_key_gen_error
There was a problem generating a key on this device.
Definition: global.h:111
@ r5_status_connection_timeout
The connection has failed due to timeout.
Definition: global.h:96
@ r5_media_type_audio_custom
Custom audio source.
Definition: global.h:155
@ r5_media_type_video_custom
Custom video source.
Definition: global.h:154
@ r5_media_type_video
Standard video using R5Camera.
Definition: global.h:152
@ r5_media_type_audio
Standard audio using R5Microphone.
Definition: global.h:153
@ r5_stream_format_yuv_planar
Non-hardware accelerated YUV. Parses frames into YUV 3 planes.
Definition: global.h:165
@ r5_stream_format_rgb
Non-hardware accelerated RGB. Uses SW Scalar for decode.
Definition: global.h:164
@ r5_stream_format_yuv_biplanar
Non-hardware accelerated YUV. Parses frame to YUV bi-planar format.
Definition: global.h:166
long socket_queue_size
Num Packets queued to be sent out.
Definition: global.h:243
long pkts_audio_dropped
Incoming audio packets dropped.
Definition: global.h:236
int nb_video_frames
Number of queued video frames to be played.
Definition: global.h:232
float buffered_time
Length of content that has been received on socket.
Definition: global.h:229
float video_decode_smoothed
How long it takes to decode video packet.
Definition: global.h:247
int subscribe_queue_size
Number of audio/video frames waiting for decode.
Definition: global.h:230
long total_bytes_sent
total bytes sent by stream
Definition: global.h:240
float subscribe_bitrate
Subscribing bitrate (not smoothed)
Definition: global.h:241
long total_bytes_received
Total bytes received by stream.
Definition: global.h:239
float bitrate_received_smoothed
Smoothed incoming bitrate.
Definition: global.h:245
long publish_pkts_dropped
Total audio/video packets dropped due to latency.
Definition: global.h:237
long pkts_video_dropped
Incoming video packets dropped.
Definition: global.h:235
float subscribe_latency
How far behind subscriber clock the stream is arriving.
Definition: global.h:246
float publish_bitrate
Publishing bitrate (not smoothed)
Definition: global.h:242
float bitrate_sent_smoothed
Smoothed outgoing bitrate.
Definition: global.h:244
long pkts_received
Num Received packets.
Definition: global.h:233
long pkts_sent
Num Sent packets.
Definition: global.h:234
int nb_audio_frames
Number of queued audio frames to be played.
Definition: global.h:231