GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
|
#include <gpac/internal/media_dev.h>
#include <gpac/constants.h>
#include <gpac/math.h>
#include <gpac/isomedia.h>
#include <gpac/ietf.h>
#include <gpac/config_file.h>
#include <gpac/base_coding.h>
#include <gpac/filestreamer.h>
#include <gpac/rtp_streamer.h>
Data Structures | |
struct | GF_RTPTrack |
struct | GF_ISOMRTPStreamer |
FileStreamer object. More... | |
Functions | |
static GF_Err | gf_isom_streamer_setup_sdp (GF_ISOMRTPStreamer *streamer, char *sdpfilename, char **out_sdp_buffer) |
GF_Err | gf_isom_streamer_write_sdp (GF_ISOMRTPStreamer *streamer, char *sdpfilename) |
writes the SDP file More... | |
GF_Err | gf_isom_streamer_get_sdp (GF_ISOMRTPStreamer *streamer, char **out_sdp_buffer) |
gets the SDP file More... | |
void | gf_isom_streamer_reset (GF_ISOMRTPStreamer *streamer, Bool is_loop) |
resets RTP sender More... | |
GF_Err | gf_isom_streamer_send_next_packet (GF_ISOMRTPStreamer *streamer, s32 send_ahead_delay, s32 max_sleep_time) |
sends RTP packet More... | |
static u16 | check_next_port (GF_ISOMRTPStreamer *streamer, u16 first_port) |
GF_ISOMRTPStreamer * | gf_isom_streamer_new (const char *file_name, const char *ip_dest, u16 port, Bool loop, Bool force_mpeg4, u32 path_mtu, u32 ttl, char *ifce_addr) |
ISO File RTP Streamer list constructor. More... | |
void | gf_isom_streamer_del (GF_ISOMRTPStreamer *streamer) |
RTP file streamer destructor. More... | |
struct GF_RTPTrack |
Data Fields | ||
---|---|---|
struct __tag_rtp_track * | next | |
GF_RTPStreamer * | rtp | |
u16 | port | |
Double | microsec_ts_scale | |
u32 | avc_nalu_size | |
u32 | track_num | |
u32 | timescale | |
u32 | nb_aus | |
GF_ISOSample * | au | |
u32 | current_au | |
u32 | sample_duration | |
u32 | sample_desc_index | |
u64 | microsec_dts | |
u32 | ts_offset | |
u32 | microsec_ts_offset |
struct __isom_rtp_streamer |
|
static |
GF_Err gf_isom_streamer_write_sdp | ( | GF_ISOMRTPStreamer * | streamer, |
char * | sdpfilename | ||
) |
Writes the SDP file asscoiated with the streaming session
streamer | RTP streamer object |
sdpfilename | SDP file name to create |
GF_Err gf_isom_streamer_get_sdp | ( | GF_ISOMRTPStreamer * | streamer, |
char ** | out_sdp_buffer | ||
) |
Gets the SDP asscoiated with all media in the streaming session (only media parts are returned)
streamer | RTP streamer object |
out_sdp_buffer | location to the SDP buffer to allocate and fill |
void gf_isom_streamer_reset | ( | GF_ISOMRTPStreamer * | streamer, |
Bool | is_loop | ||
) |
Reset the RTP streams to the beginning of the media file
streamer | RTP streamer object |
is_loop | indicates whether the RTP timelines shall continue from the end of the file or shall restart from 0 |
GF_Err gf_isom_streamer_send_next_packet | ( | GF_ISOMRTPStreamer * | streamer, |
s32 | send_ahead_delay, | ||
s32 | max_sleep_time | ||
) |
Sends the next RTP packet in the current file, potentially waiting for the TS to be mature. If the last packet is sent and looping is disabled, this will return GF_EOS.
streamer | RTP streamer object |
send_ahead_delay | delay in milliseconds for packet sending. A packet is sent if (packet.timestamp + send_ahead_delay) is greate than the current time. |
max_sleep_time | indicates that if the streamer has to wait more than max_sleep_time before sending the packet, it should return and send it later. |
GF_ISOMRTPStreamer* gf_isom_streamer_new | ( | const char * | file_name, |
const char * | ip_dest, | ||
u16 | port, | ||
Bool | loop, | ||
Bool | force_mpeg4, | ||
u32 | path_mtu, | ||
u32 | ttl, | ||
char * | ifce_addr | ||
) |
Constructs a new ISO file RTP streamer
file_name | source file name to stream. Hint tracks will be ignored, all media tracks will be streamed |
ip_dest | destination IP address (V4 or V6, unicast or multicast) |
port | destination port |
loop | whether streaming stops at the end of all tracks or not. If not, RTP TS will continuously be incremented |
force_mpeg4 | forces usage of MPEG-4 generic (RFC3640) for all streams |
path_mtu | maximum RTP packet payload size allowed |
ttl | multicast time to live |
ifce_addr | IP of the local interface to use (may be NULL) |
void gf_isom_streamer_del | ( | GF_ISOMRTPStreamer * | streamer | ) |
Destructs an RTP file streamer
streamer | object to destruct |