#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/shm.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include <getopt.h>
#include <libdv/dv.h>
#include <xdvshow-info.h>
#include <xdvshow-x11.h>
#include "xdvshow-shm.h"
#include "xdvshow-rtp.h"
#include "xdvshow-file.h"
#include "xdvshow-ieee1394.h"
#include "xdvshow-audio.h"
#include "xdvshow-flags.h"
#include "xdvshow-const.h"
#include "xdvshow-defs.h"
Include dependency graph for xdvshow-main.c:
Go to the source code of this file.
Functions | |
int input_func | __P ((u_char **)) |
int input_unlock_func | __P (()) |
void *video_thread_func | __P ((void *)) |
void | sigint_signal (int signo) |
Function that processes SIGINT signal and tries to terminate xdvshow. | |
int | main (int argc, char *argv[]) |
Main entry fucntion of the prgram. | |
void * | video_thread_func (void *data) |
This fuction is called as video displaying thread. | |
void * | audio_thread_func (void *data) |
This fuction is called as audio playing thread. | |
Variables | |
int | flags_stereo = 0 |
int | flags_fulscreen = 0 |
int | flags_sdl = 0 |
int | flags_x11 = 1 |
int | fags_sdlnooverlay = 0 |
int | flags_file = 0 |
int | flags_zoom = 0 |
int | flags_scale = 0 |
int | flags_dump = 0 |
int | flags_deinterlace = 0 |
int | flags_reflector = 0 |
int | flags_use_audio = 0 |
int | flags_format_wide = 0 |
int | flags_format_normal = 0 |
u_int32_t | flags = 0x0 |
u_int32_t | dv_format_type = e_dv_system_625_50 |
char * | prog_name = "xdvshow" |
u_char * | videodata |
u_char * | audioframe |
int16_t * | audio_buffers [4] |
xdvshow_rtp_param | rtp_param |
int | dump_fd |
char * | reflector_address |
timeval | currtime |
long | frametime_usec |
long | frametimeadd_usec = 27000 |
long | framedelay_usec |
dv_decoder_t * | dv_dec |
pthread_t | read_thread |
pthread_t | ping_thread |
pthread_t | video_thread |
|
|
|
|
|
|
|
This fuction is called as audio playing thread. If audio is not selected by command line parameter this function if just an endless loop. In second case the function fills the audioframe buffer, calls a decode function and a play function.
Definition at line 677 of file xdvshow-main.c. References audio_buffers, audioframe, dv_dec, flags_use_audio, and xdvshow_play_audio(). Referenced by main().
Here is the call graph for this function: ![]() |
|
Main entry fucntion of the prgram. The function parses input parameters using getopt and spawn pthread threads based on input parameters.
Definition at line 244 of file xdvshow-main.c. References __P(), audio_buffers, audio_thread_func(), currtime, DPRINT, dump_fd, dv_dec, dv_format_type, flags_deinterlace, flags_dump, flags_file, flags_format_normal, flags_format_wide, flags_fullscreen, flags_reflector, flags_scale, flags_sdl, flags_sdlnooverlay, flags_stereo, flags_use_audio, flags_x11, flags_zoom, frametime_usec, frametimeadd_usec, xdvshow_rtp_param::multi_addr_str, ping_thread, xdvshow_rtp_param::port, read_thread, reflector_address, rtp_param, xdvshow_rtp_param::s_addr, show_usage(), show_version(), sigint_signal(), THREAD_STACKSIZE, video_thread, video_thread_func(), xdvshow_capture_raw(), xdvshow_close_file(), xdvshow_close_shm(), xdvshow_init_audio(), xdvshow_ping_reflector(), xdvshow_prepare_file(), xdvshow_prepare_rtp(), xdvshow_read_audio_shm(), xdvshow_read_audio_unlock(), xdvshow_read_shm(), xdvshow_read_unlock(), and xdvshow_semaphore_init().
Here is the call graph for this function: ![]() |
|
Function that processes SIGINT signal and tries to terminate xdvshow. It waits for ping_thread, video_thread, and read_thread termination and closes dump filehandle (if needed) and cleans up (detaches) shared memory. It also frees up DV decoder.
Definition at line 143 of file xdvshow-main.c. References _xdvshow_shm, DPRINT, DPRINT_BARE, dump_fd, dv_dec, flags_dump, flags_reflector, flags_sdl, flags_x11, ping_thread, read_thread, __xdvshow_shm::shm_buf, __xdvshow_shm::shmid, video_thread, xdvshow_close_window(), and xdvshow_x11_close_window(). Referenced by main().
Here is the call graph for this function: ![]() |
|
This fuction is called as video displaying thread. At first the function creates a new window and then repeteadly checks for any pedning events (when using libSDL), fills a videodata buffer, decodes it and displays via SDL or X11.
Definition at line 574 of file xdvshow-main.c. References currtime, DPRINT, dump_fd, dv_dec, dv_format_type, flags_dump, flags_file, flags_sdl, flags_x11, framedelay_usec, frametime_usec, frametimeadd_usec, prog_name, videodata, xdvshow_open_window(), xdvshow_render(), xdvshow_SDL_handle_events(), xdvshow_x11_open_window(), and xdvshow_x11_render(). Referenced by main().
Here is the call graph for this function: ![]() |
|
Definition at line 114 of file xdvshow-main.c. Referenced by audio_thread_func(), main(), and xdvshow_play_audio(). |
|
Definition at line 113 of file xdvshow-main.c. Referenced by audio_thread_func(), and xdvshow_read_audio_shm(). |
|
Definition at line 122 of file xdvshow-main.c. Referenced by main(), and video_thread_func(). |
|
Definition at line 119 of file xdvshow-main.c. Referenced by main(), sigint_signal(), and video_thread_func(). |
|
Definition at line 127 of file xdvshow-main.c. Referenced by audio_thread_func(), main(), sigint_signal(), and video_thread_func(). |
|
Definition at line 99 of file xdvshow-main.c. Referenced by _xdvshow_read_file(), _xdvshow_recv_dvrtp(), main(), and video_thread_func(). |
|
Definition at line 86 of file xdvshow-main.c. |
|
Definition at line 98 of file xdvshow-main.c. |
|
Definition at line 91 of file xdvshow-main.c. |
|
Definition at line 90 of file xdvshow-main.c. |
|
Definition at line 87 of file xdvshow-main.c. Referenced by main(), and video_thread_func(). |
|
Definition at line 96 of file xdvshow-main.c. |
|
Definition at line 95 of file xdvshow-main.c. |
|
Definition at line 78 of file xdvshow-main.c. |
|
Definition at line 92 of file xdvshow-main.c. |
|
Definition at line 89 of file xdvshow-main.c. |
|
Definition at line 83 of file xdvshow-main.c. |
|
Definition at line 77 of file xdvshow-main.c. |
|
Definition at line 93 of file xdvshow-main.c. |
|
Definition at line 84 of file xdvshow-main.c. |
|
Definition at line 88 of file xdvshow-main.c. |
|
Definition at line 125 of file xdvshow-main.c. Referenced by video_thread_func(). |
|
Definition at line 123 of file xdvshow-main.c. Referenced by main(), and video_thread_func(). |
|
Definition at line 124 of file xdvshow-main.c. Referenced by main(), and video_thread_func(). |
|
Definition at line 130 of file xdvshow-main.c. Referenced by main(), and sigint_signal(). |
|
Definition at line 106 of file xdvshow-main.c. Referenced by video_thread_func(). |
|
Definition at line 129 of file xdvshow-main.c. Referenced by main(), and sigint_signal(). |
|
Definition at line 120 of file xdvshow-main.c. Referenced by main(). |
|
Definition at line 117 of file xdvshow-main.c. Referenced by _chk_multicast_addr(), _chk_multicast_family(), _multicast_join(), _multicast_str2addr(), _xdvshow_prepare_multicast(), _xdvshow_prepare_socket(), main(), and xdvshow_ping_reflector(). |
|
Definition at line 131 of file xdvshow-main.c. Referenced by main(), and sigint_signal(). |
|
Definition at line 111 of file xdvshow-main.c. Referenced by video_thread_func(). |