#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <pthread.h>
#include <assert.h>
#include <libdv/dv_types.h>
#include <semaphore.h>
#include "RTP.h"
#include "xdvshow-const.h"
#include "xdvshow-shm.h"
#include "xdvshow-flags.h"
#include "xdvshow-rtp.h"
#include "xdvshow-defs.h"
Include dependency graph for xdvshow-rtp.c:
Go to the source code of this file.
Functions | |
int _xdvshow_prepare_socket | __P ((struct xdvshow_rtp_param *)) |
int _xdvshow_recv_dvrtp | __P ((void)) |
void * | xdvshow_ping_reflector (void *data) |
periodically sends a dummy packet to the packet reflector. | |
void * | xdvshow_prepare_rtp (void *data) |
Public function that handles the input from a network. | |
int | _xdvshow_prepare_socket (struct xdvshow_rtp_param *rtp_param) |
creates a communication socket and returns a descriptor. | |
int | _multicast_str2addr (struct xdvshow_rtp_param *rtp_param) |
converts the multicast address into binary data in network byte order. | |
int | _chk_multicast_addr (struct xdvshow_rtp_param *rtp_param) |
checks if the given address is a correct multicast address. | |
int | _chk_multicast_family (struct xdvshow_rtp_param *rtp_param) |
checks the multicast address family. | |
int | _multicast_join (struct xdvshow_rtp_param *rtp_param) |
is an internal function that joins mlticast group given by its address. | |
int | _xdvshow_prepare_multicast (struct xdvshow_rtp_param *rtp_param) |
converts the given address, checks if the address is correct and then joins the multicast group. | |
int | _xdvshow_recv_dvrtp () |
internal function that acquires the DV stream from a network. |
|
|
|
|
|
checks if the given address is a correct multicast address.
Definition at line 265 of file xdvshow-rtp.c. References xdvshow_rtp_param::multi_addr_str, xdvshow_rtp_param::multi_s_addr, and rtp_param. Referenced by _xdvshow_prepare_multicast().
|
|
checks the multicast address family.
Definition at line 309 of file xdvshow-rtp.c. References xdvshow_rtp_param::multi_s_addr, rtp_param, and xdvshow_rtp_param::s_addr. Referenced by _xdvshow_prepare_multicast().
|
|
is an internal function that joins mlticast group given by its address.
Definition at line 357 of file xdvshow-rtp.c. References _xdvshow_shm, xdvshow_rtp_param::multi_ifname, xdvshow_rtp_param::multi_s_addr, rtp_param, xdvshow_rtp_param::s_addr, and __xdvshow_shm::soc. Referenced by _xdvshow_prepare_multicast().
|
|
converts the multicast address into binary data in network byte order.
Definition at line 230 of file xdvshow-rtp.c. References xdvshow_rtp_param::multi_addr_str, xdvshow_rtp_param::multi_s_addr, and rtp_param. Referenced by _xdvshow_prepare_multicast().
|
|
converts the given address, checks if the address is correct and then joins the multicast group.
Definition at line 425 of file xdvshow-rtp.c. References _chk_multicast_addr(), _chk_multicast_family(), _multicast_join(), _multicast_str2addr(), and rtp_param. Referenced by xdvshow_prepare_rtp().
Here is the call graph for this function: ![]() |
|
creates a communication socket and returns a descriptor.
Definition at line 150 of file xdvshow-rtp.c. References _xdvshow_shm, DPRINT, xdvshow_rtp_param::port, rtp_param, xdvshow_rtp_param::s_addr, and __xdvshow_shm::soc. Referenced by xdvshow_prepare_rtp().
|
|
internal function that acquires the DV stream from a network.
Definition at line 457 of file xdvshow-rtp.c. References _xdvshow_shm, audio_empty, audio_ready, __xdvshow_shm::audio_shm_frame, shm_frame_buf::data, DPRINT, DPRINT_BARE, DSEQ_MAX_NTSC, DSEQ_MAX_PAL, dv_format_type, DVFRAME_DATA_READY, DVFRAME_MAX_SIZE, flags_format_normal, flags_format_wide, flags_use_audio, shm_frame::frame_buf, shm_frame_buf::lock, MAX_PKT_LEN, shm_frame::next, SCT_AUDIO, SCT_HEADER, SCT_SUBCODE, SCT_VAUX, SCT_VIDEO, __xdvshow_shm::shm_frame, __xdvshow_shm::soc, ts_sem_wait, video_empty, and video_ready. Referenced by xdvshow_prepare_rtp().
|
|
periodically sends a dummy packet to the packet reflector.
The dummy packet is sent to
Definition at line 50 of file xdvshow-rtp.c. References xdvshow_rtp_param::port, REFLECTOR_PING_INTERVAL, and rtp_param. Referenced by main().
|
|
Public function that handles the input from a network.
Definition at line 106 of file xdvshow-rtp.c. References _xdvshow_alloc_shm(), _xdvshow_attach_shm(), _xdvshow_prepare_multicast(), _xdvshow_prepare_socket(), _xdvshow_recv_dvrtp(), _xdvshow_shm, DPRINT, and __xdvshow_shm::parent_pid. Referenced by main().
Here is the call graph for this function: ![]() |