xine-lib 1.2.11
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <pthread.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/compat.h>
#include <xine/input_plugin.h>
Data Structures | |
struct | ivtv_ioctl_codec |
struct | pvr_input_plugin_t |
struct | saved_show_t |
struct | pvrscr_s |
Macros | |
#define | XINE_ENABLE_EXPERIMENTAL_FEATURES |
#define | LOG_MODULE "input_pvr" |
#define | LOG_VERBOSE |
#define | PVR_DEVICE "/dev/video0" |
#define | PVR_BLOCK_SIZE 2048 /* pvr works with dvd-like data */ |
#define | BLOCKS_PER_PAGE 102400 /* 200MB per page. each session can have several pages */ |
#define | MAX_PAGES 10000 /* maximum number of pages to keep track */ |
#define | NUM_PREVIEW_BUFFERS 250 /* used in mpeg_block demuxer */ |
#define | IVTV_IOC_G_CODEC 0xFFEE7703 |
#define | IVTV_IOC_S_CODEC 0xFFEE7704 |
#define | IVTV_STREAM_PS 0 |
#define | IVTV_STREAM_TS 1 |
#define | IVTV_STREAM_MPEG1 2 |
#define | IVTV_STREAM_PES_AV 3 |
#define | IVTV_STREAM_PES_V 5 |
#define | IVTV_STREAM_PES_A 7 |
#define | IVTV_STREAM_DVD 10 |
#define | PVR_FILENAME "%s%08d_%08d.vob" |
#define | SAVE_BASE_FILENAME "ch%03d %02d-%02d-%04d %02d:%02d:%02d" |
#define | SAVE_FILENAME "%s%s_%04d.vob" |
Typedefs | |
typedef struct pvrscr_s | pvrscr_t |
Functions | |
static int | pvrscr_get_priority (scr_plugin_t *scr) |
static void | pvrscr_set_pivot (pvrscr_t *this) |
static int | pvrscr_set_speed (scr_plugin_t *scr, int speed) |
static void | pvrscr_speed_tunning (pvrscr_t *this, double factor) |
static void | pvrscr_adjust (scr_plugin_t *scr, int64_t vpts) |
static void | pvrscr_start (scr_plugin_t *scr, int64_t start_vpts) |
static int64_t | pvrscr_get_current (scr_plugin_t *scr) |
static void | pvrscr_exit (scr_plugin_t *scr) |
static pvrscr_t * | pvrscr_init (void) |
static uint32_t | block_to_page (pvr_input_plugin_t *this, uint32_t block) |
static uint32_t | pvr_plugin_get_capabilities (input_plugin_t *this_gen) |
static off_t | pvr_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) |
static void | pvr_adjust_realtime_speed (pvr_input_plugin_t *this, fifo_buffer_t *fifo, int speed) |
static char * | make_temp_name (pvr_input_plugin_t *this, int page) |
static char * | make_base_save_name (int channel, time_t tm) |
static char * | make_save_name (pvr_input_plugin_t *this, char *base, int page) |
static void | pvr_report_realtime (pvr_input_plugin_t *this, int mode) |
static int | pvr_break_rec_page (pvr_input_plugin_t *this) |
static int | pvr_rec_file (pvr_input_plugin_t *this) |
static int | pvr_play_file (pvr_input_plugin_t *this, fifo_buffer_t *fifo, uint8_t *buffer, int speed) |
static int | pvr_mpeg_resync (int fd) |
static void * | pvr_loop (void *this_gen) |
static void | pvr_finish_recording (pvr_input_plugin_t *this) |
static void | pvr_event_handler (pvr_input_plugin_t *this) |
static buf_element_t * | pvr_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t todo) |
static off_t | pvr_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) |
static off_t | pvr_plugin_get_current_pos (input_plugin_t *this_gen) |
static off_t | pvr_plugin_get_length (input_plugin_t *this_gen) |
static uint32_t | pvr_plugin_get_blocksize (input_plugin_t *this_gen) |
static const char * | pvr_plugin_get_mrl (input_plugin_t *this_gen) |
static int | pvr_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type) |
static void | pvr_plugin_dispose (input_plugin_t *this_gen) |
static int | pvr_plugin_open (input_plugin_t *this_gen) |
static input_plugin_t * | pvr_class_get_instance (input_class_t *cls_gen, xine_stream_t *stream, const char *data) |
static void * | init_plugin (xine_t *xine, const void *data) |
Variables | |
const plugin_info_t xine_plugin_info[] | EXPORTED |
#define BLOCKS_PER_PAGE 102400 /* 200MB per page. each session can have several pages */ |
#define IVTV_IOC_G_CODEC 0xFFEE7703 |
#define IVTV_IOC_S_CODEC 0xFFEE7704 |
#define IVTV_STREAM_DVD 10 |
#define IVTV_STREAM_MPEG1 2 |
#define IVTV_STREAM_PES_A 7 |
#define IVTV_STREAM_PES_AV 3 |
#define IVTV_STREAM_PES_V 5 |
#define IVTV_STREAM_PS 0 |
#define IVTV_STREAM_TS 1 |
#define LOG_MODULE "input_pvr" |
#define LOG_VERBOSE |
#define MAX_PAGES 10000 /* maximum number of pages to keep track */ |
#define NUM_PREVIEW_BUFFERS 250 /* used in mpeg_block demuxer */ |
#define PVR_BLOCK_SIZE 2048 /* pvr works with dvd-like data */ |
#define PVR_DEVICE "/dev/video0" |
#define PVR_FILENAME "%s%08d_%08d.vob" |
#define SAVE_BASE_FILENAME "ch%03d %02d-%02d-%04d %02d:%02d:%02d" |
#define SAVE_FILENAME "%s%s_%04d.vob" |
#define XINE_ENABLE_EXPERIMENTAL_FEATURES |
|
static |
Referenced by pvr_play_file(), and pvr_plugin_seek().
|
static |
|
static |
References _x_asprintf(), and SAVE_BASE_FILENAME.
Referenced by pvr_finish_recording().
|
static |
References _x_asprintf(), and SAVE_FILENAME.
Referenced by pvr_event_handler(), and pvr_finish_recording().
|
static |
References _x_asprintf(), and PVR_FILENAME.
Referenced by pvr_break_rec_page(), pvr_finish_recording(), and pvr_play_file().
|
static |
References _x_set_speed(), fifo_buffer_s::num_free, pvrscr_speed_tunning(), fifo_buffer_s::size, XINE_SPEED_NORMAL, and XINE_SPEED_PAUSE.
Referenced by pvr_plugin_read_block().
|
static |
References _, lprintf, make_temp_name(), xine_create_cloexec(), XINE_VERBOSITY_LOG, and xprintf.
Referenced by pvr_event_handler(), and pvr_rec_file().
|
static |
References lprintf, NULL, PVR_DEVICE, pvr_plugin_dispose(), pvr_plugin_get_blocksize(), pvr_plugin_get_capabilities(), pvr_plugin_get_current_pos(), pvr_plugin_get_length(), pvr_plugin_get_mrl(), pvr_plugin_get_optional_data(), pvr_plugin_open(), pvr_plugin_read(), pvr_plugin_read_block(), pvr_plugin_seek(), xine_cfg_entry_s::str_value, xine_stream_s::xine, xine_config_lookup_entry(), and xine_list_new().
Referenced by init_plugin().
|
static |
References _, _x_demux_flush_engine(), _x_get_speed(), _x_set_speed(), saved_show_t::base_name, ivtv_ioctl_codec::bitrate, xine_set_mpeg_data_t::bitrate_mean, xine_set_mpeg_data_t::bitrate_peak, ivtv_ioctl_codec::bitrate_peak, xine_set_v4l2_data_t::channel, xine_set_v4l2_data_t::frequency, saved_show_t::id, xine_set_v4l2_data_t::input, input(), IVTV_IOC_G_CODEC, IVTV_IOC_S_CODEC, IVTV_STREAM_DVD, lprintf, make_save_name(), NULL, saved_show_t::pages, pvr_break_rec_page(), pvr_finish_recording(), pvrscr_speed_tunning(), xine_set_v4l2_data_t::session_id, ivtv_ioctl_codec::stream_type, xine_event_t::type, xine_event_free(), xine_event_get(), XINE_EVENT_PVR_PAUSE, XINE_EVENT_PVR_SAVE, XINE_EVENT_SET_MPEG_DATA, XINE_EVENT_SET_V4L2, xine_list_front(), xine_list_get_value(), xine_list_next(), xine_list_remove(), xine_open_cloexec(), XINE_SPEED_NORMAL, XINE_SPEED_PAUSE, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by pvr_plugin_read_block().
|
static |
References saved_show_t::base_name, saved_show_t::id, lprintf, make_base_save_name(), make_save_name(), make_temp_name(), NULL, saved_show_t::pages, xine_event_t::tv, XINE_EVENT_PVR_REPORT_NAME, xine_event_send(), xine_list_push_back(), XINE_VERBOSITY_LOG, and xprintf.
Referenced by pvr_event_handler(), and pvr_plugin_dispose().
|
static |
References _, NULL, PVR_BLOCK_SIZE, pvr_mpeg_resync(), pvr_rec_file(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by pvr_plugin_open().
|
static |
Referenced by pvr_loop().
|
static |
References _, _x_set_speed(), block_to_page(), BLOCKS_PER_PAGE, lprintf, make_temp_name(), fifo_buffer_s::num_free, PVR_BLOCK_SIZE, pvr_report_realtime(), fifo_buffer_s::size, xine_open_cloexec(), XINE_SPEED_NORMAL, XINE_SPEED_PAUSE, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by pvr_plugin_read_block().
|
static |
References _x_freep(), saved_show_t::base_name, lprintf, pvr_finish_recording(), xine_event_dispose_queue(), xine_list_delete(), xine_list_front(), xine_list_get_value(), and xine_list_next().
Referenced by pvr_class_get_instance().
|
static |
References PVR_BLOCK_SIZE.
Referenced by pvr_class_get_instance().
|
static |
References INPUT_CAP_BLOCK, and INPUT_CAP_SEEKABLE.
Referenced by pvr_class_get_instance().
|
static |
References PVR_BLOCK_SIZE.
Referenced by pvr_class_get_instance().
|
static |
References PVR_BLOCK_SIZE.
Referenced by pvr_class_get_instance().
|
static |
Referenced by pvr_class_get_instance().
|
static |
References INPUT_OPTIONAL_UNSUPPORTED.
Referenced by pvr_class_get_instance().
|
static |
References _, _x_assert, ivtv_ioctl_codec::bitrate, ivtv_ioctl_codec::bitrate_mode, ivtv_ioctl_codec::bitrate_peak, input(), IVTV_IOC_G_CODEC, IVTV_IOC_S_CODEC, IVTV_STREAM_DVD, NULL, NUM_PREVIEW_BUFFERS, pvr_loop(), pvrscr_init(), ivtv_ioctl_codec::stream_type, xine_event_new_queue(), xine_open_cloexec(), XINE_VERBOSITY_LOG, XINE_VERBOSITY_NONE, and xprintf.
Referenced by pvr_class_get_instance().
|
static |
Referenced by pvr_class_get_instance().
|
static |
References _x_get_speed(), _x_stream_info_get(), BUF_CONTROL_NOP, BUF_DEMUX_BLOCK, fifo_buffer_s::buffer_pool_alloc, buf_element_s::content, buf_element_s::free_buffer, buf_element_s::max_size, buf_element_s::mem, NULL, pvr_adjust_realtime_speed(), PVR_BLOCK_SIZE, pvr_event_handler(), pvr_play_file(), pvrscr_speed_tunning(), buf_element_s::size, buf_element_s::type, xine_fast_memcpy, XINE_SPEED_PAUSE, XINE_STREAM_INFO_IGNORE_VIDEO, xine_usec_sleep(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by pvr_class_get_instance().
|
static |
References block_to_page(), PVR_BLOCK_SIZE, and pvr_report_realtime().
Referenced by pvr_class_get_instance().
|
static |
References BLOCKS_PER_PAGE, PVR_BLOCK_SIZE, pvr_break_rec_page(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by pvr_loop().
|
static |
References mode(), NULL, xine_event_t::tv, xine_event_t::type, XINE_EVENT_PVR_REALTIME, and xine_event_send().
Referenced by pvr_play_file(), and pvr_plugin_seek().
|
static |
References NULL, and xine_monotonic_clock().
Referenced by pvrscr_init().
|
static |
Referenced by pvrscr_init().
|
static |
References NULL, and xine_monotonic_clock().
Referenced by pvrscr_init().
|
static |
Referenced by pvrscr_init().
|
static |
References NULL, pvrscr_adjust(), pvrscr_exit(), pvrscr_get_current(), pvrscr_get_priority(), pvrscr_set_speed(), pvrscr_speed_tunning(), pvrscr_start(), and XINE_SPEED_PAUSE.
Referenced by pvr_plugin_open().
|
static |
References NULL, and xine_monotonic_clock().
Referenced by pvrscr_set_speed(), and pvrscr_speed_tunning().
|
static |
References pvrscr_set_pivot(), and XINE_FINE_SPEED_NORMAL.
Referenced by pvrscr_init(), and pvrscr_start().
|
static |
References pvrscr_set_pivot(), and XINE_FINE_SPEED_NORMAL.
Referenced by pvr_adjust_realtime_speed(), pvr_event_handler(), pvr_plugin_read_block(), and pvrscr_init().
|
static |
References NULL, pvrscr_set_speed(), XINE_FINE_SPEED_NORMAL, and xine_monotonic_clock().
Referenced by pvrscr_init().
const plugin_info_t xine_plugin_info [] EXPORTED |