diff options
-rw-r--r-- | HISTORY | 20 | ||||
-rw-r--r-- | config.c | 277 | ||||
-rw-r--r-- | config.h | 105 | ||||
-rw-r--r-- | examples/remote.conf.example | 3 | ||||
-rw-r--r-- | frontend.c | 6 | ||||
-rw-r--r-- | frontend_local.c | 23 | ||||
-rw-r--r-- | frontend_svr.c | 11 | ||||
-rw-r--r-- | media_player.c | 93 | ||||
-rw-r--r-- | menu.c | 49 | ||||
-rw-r--r-- | menuitems.c | 8 | ||||
-rw-r--r-- | setup_menu.c | 4 | ||||
-rw-r--r-- | tools/http.c | 4 | ||||
-rw-r--r-- | tools/iso639.h | 12 | ||||
-rw-r--r-- | tools/playlist.c | 80 | ||||
-rw-r--r-- | tools/udp_pes_scheduler.c | 23 | ||||
-rw-r--r-- | xine_sxfe_frontend.c | 13 | ||||
-rw-r--r-- | xineliboutput.c | 279 |
17 files changed, 550 insertions, 460 deletions
@@ -1,12 +1,6 @@ VDR Plugin 'xineliboutput' Revision History ------------------------------------------- -2009-06-06: Version 1.0.5 (branch-1_0_x) -Backported bugfixes from CVS trunk: -- Fixed compilation with gcc-4.4.0 -- Fixed memory leaks -- Fixed setting focus in vdr-sxfe fullscreen mode - 2009-02-12: Version 1.0.4 (branch-1_0_x) Backported bugfixes from CVS trunk: - Updated Italian translations (Thanks to Diego Pierotto) @@ -19,7 +13,7 @@ Backported bugfixes from CVS trunk: 2008-10-24: Version 1.0.3 (branch-1_0_x) Backported bugfixes from CVS trunk: -- Added missing sxfe display locks (Thanks to Antti Seppälä) +- Added missing sxfe display locks (Thanks to Antti Seppälä) - Modified HUD OSD scaling parameters (Thanks to Rolf Ahrenberg) - Fixes to HUD OSD drawing (Thanks to Rolf Ahrenberg) - Fixed --aspect=auto:path_to_script option (Thanks to Armin Diedering) @@ -58,7 +52,7 @@ Backported bugfixes from CVS trunk: - Added Italian translations (Thanks to Diego Pierotto) - Added Czech translations (Thanks to Maya) - Added HUD OSD (Blend OSD using graphics hardware) and --hud command-line option. - (Thanks to Antti Seppälä and Rolf Ahrenberg) + (Thanks to Antti Seppälä and Rolf Ahrenberg) - Added support for libextractor metadata parsing library (Petri Helin) - Added service interface for launching media player (Suggested by Tobias Grimm) - Added configuration options for unsharp and denoise3d post plugins (Petri Helin) @@ -129,7 +123,7 @@ Backported bugfixes from CVS trunk: - Adapted for xine-lib 1.1.4 - Adapted for vdr-1.5.1 (Thanks to Rolf Ahrenberg) - Mac OS X compability fixes (Thanks to Tero Siironen) -- DXR3 added to list of output devices (experimental; Thanks to Ville Skyttä) +- DXR3 added to list of output devices (experimental; Thanks to Ville Skyttä) - Subtitle selection menu updated to use VDR audio menu skin - New subtitle macro key handling (identical to VDR kAudio) - Added preferred subtitle language selection for media player @@ -141,12 +135,12 @@ Backported bugfixes from CVS trunk: - Added automatic re-connection to remote frontends (--reconnect option) - Slow down DVD drive speed - Initialize video size from stream info when playing slave streams, - (Thanks to Antti Seppälä) + (Thanks to Antti Seppälä) - Makefile shell scripts modified to run in dash (Ubuntu). (Thanks to realKano@directbox.com) - Increased frame-based buffering time after channel changes - Use iconv to translate id3 tags from utf8 to VDR charset -- Use /dev/dsp as OSS default device (Thanks to Ville Skyttä) +- Use /dev/dsp as OSS default device (Thanks to Ville Skyttä) - Lot of small fixes and enhancements, complete log in CVS 2007-01-07: Version 1.0.0pre7 @@ -155,7 +149,7 @@ Backported bugfixes from CVS trunk: - Added playlist menu to media player - Added "Play Audio CD" / "Play remote Audio CD" entry to plugin menu - Makefile modified to allow overriding default directory environment. - Using "install" to install files. (Thanks to Timo Weingärtner) + Using "install" to install files. (Thanks to Timo Weingärtner) - Added metainfo caching to media player. Cached metainfo is stored to ".xineliboutput-playlist.m3u" files by default. - Added support for playlists inside playlists @@ -172,7 +166,7 @@ Backported bugfixes from CVS trunk: - Subtitle type .ssa added - Parsing for .pls, .asx and .ram playlists added - Eliminated some warnings when compiling to 64bit (Thanks to Anssi Hannula) -- Vidix(fb) added to supported video drivers (Thanks to Antti Seppälä) +- Vidix(fb) added to supported video drivers (Thanks to Antti Seppälä) - Media player/audio file browser does not anymore show video files - When replaying music files, replay moves to next file automatically - Decoder setup menu moved to Local setup menu @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.c,v 1.63.2.5 2009-06-07 23:40:38 phintuka Exp $ + * $Id: config.c,v 1.63.2.2 2008-09-26 19:15:48 phintuka Exp $ * */ @@ -234,131 +234,12 @@ const char * const config_t::s_osdScalings[] = { NULL }; -const char * const config_t::s_decoders_MPEG2[] = { - trNOOP("automatic"), - "libmpeg2", - "FFmpeg", - NULL -}; - -const char * const config_t::s_decoders_H264[] = { - trNOOP("automatic"), - "FFmpeg", - "CoreAVC", - NULL -}; - -const char * const config_t::s_ff_skip_loop_filters[] = { - trNOOP("automatic"), - trNOOP("default"), - trNOOP("none"), - trNOOP("nonref"), - trNOOP("bidir"), - trNOOP("nonkey"), - trNOOP("all"), - NULL -}; - -const char * const config_t::s_ff_speed_over_accuracy[] = { - trNOOP("automatic"), - trNOOP("yes"), - trNOOP("no"), -}; - -static const char exts_playlist[][4] = { - "asx", - "m3u", - "pls", - "ram", -}; - -static const char exts_audio[][8] = { - "ac3", - "asf", - "au", - "aud", - "flac", - "mpa", - "mpega", - "mp2", - "mp3", - "m4a", - "ogg", - "ogm", - "ra", - "spx", - "wav", - "wma", -}; - -static const char exts_video[][8] = { - "asf", - "avi", - "dat", - "divx", - "dv", - "fli", - "flv", - "iso", /* maybe dvd */ - "mkv", - "mov", - "mpeg", - "mpg", - "mpv", - "mp4", - "m2v", - "m2t", - "m2ts", - "m4v", - "mts", - "pes", - "rm", - "ts", - "vdr", - "vob", - "wmv", - "xvid", -}; - -static const char exts_image[][8] = { - "bmp", - "gif", - "jpeg", - "jpg", - "mng", - "png", - "tiff", -}; - -#define DEF_EXT_IS(TYPE) \ -static bool ext_is_ ## TYPE(const char *ext) \ -{ \ - for(unsigned int i=0; i<sizeof(exts_ ## TYPE)/sizeof(exts_ ## TYPE[0]); i++) \ - if(!strcasecmp(ext, exts_ ## TYPE[i])) \ - return true; \ - return false; \ -} -DEF_EXT_IS(playlist) -DEF_EXT_IS(audio) -DEF_EXT_IS(video) -DEF_EXT_IS(image) - -static const char *get_extension(const char *fname) -{ - if(fname) { - const char *pos = strrchr(fname, '.'); - if(pos) - return pos+1; - } - return NULL; -} - static char *strcatrealloc(char *dest, const char *src) { if (!src || !*src) return dest; - size_t l = (dest ? strlen(dest) : 0) + strlen(src) + 1; + int l = (dest ? strlen(dest) : 0) + strlen(src) + 1; if(dest) { dest = (char *)realloc(dest, l); strcat(dest, src); @@ -369,61 +250,103 @@ static char *strcatrealloc(char *dest, const char *src) return dest; } - bool config_t::IsPlaylistFile(const char *fname) { - const char *ext = get_extension(fname); - return ext && ext_is_playlist(ext); + if(fname) { + char *pos = strrchr(fname,'.'); + if(pos) { + pos++; + if(!strcasecmp(pos, "pls") || + !strcasecmp(pos, "m3u") || + !strcasecmp(pos, "ram") || + !strcasecmp(pos, "asx")) + return true; + } + } + return false; } bool config_t::IsAudioFile(const char *fname) { - const char *ext = get_extension(fname); - return ext && (ext_is_audio(ext) || ext_is_playlist(ext)); + if(fname) { + char *pos = strrchr(fname,'.'); + if(pos) { + pos++; + if(!strcasecmp(pos, "mpa") || + !strcasecmp(pos, "mp2") || + !strcasecmp(pos, "mp3") || + !strcasecmp(pos, "m4a") || + !strcasecmp(pos, "mpega") || + !strcasecmp(pos, "flac") || + !strcasecmp(pos, "ac3") || + !strcasecmp(pos, "ogg") || + !strcasecmp(pos, "ogm") || + !strcasecmp(pos, "au") || + !strcasecmp(pos, "aud") || + !strcasecmp(pos, "wma") || + !strcasecmp(pos, "asf") || + !strcasecmp(pos, "wav") || + !strcasecmp(pos, "spx") || + !strcasecmp(pos, "ra")) + return true; + return IsPlaylistFile(fname); + } + } + return false; } bool config_t::IsVideoFile(const char *fname) { - const char *ext = get_extension(fname); - return ext && (ext_is_video(ext) || ext_is_audio(ext) || ext_is_playlist(ext)); + if(fname) { + char *pos = strrchr(fname,'.'); + if(pos) { + pos++; + if(!strcasecmp(pos, "avi") || + !strcasecmp(pos, "mpv") || + !strcasecmp(pos, "m2v") || + !strcasecmp(pos, "m4v") || + !strcasecmp(pos, "vob") || + !strcasecmp(pos, "vdr") || + !strcasecmp(pos, "mpg") || + !strcasecmp(pos, "mpeg")|| + !strcasecmp(pos, "mp4") || + !strcasecmp(pos, "asf") || + !strcasecmp(pos, "wmv") || + !strcasecmp(pos, "mov") || + !strcasecmp(pos, "ts") || + !strcasecmp(pos, "pes") || + !strcasecmp(pos, "xvid") || + !strcasecmp(pos, "divx") || + !strcasecmp(pos, "fli") || + !strcasecmp(pos, "flv") || + !strcasecmp(pos, "dv") || + !strcasecmp(pos, "dat") || + !strcasecmp(pos, "mkv") || + !strcasecmp(pos, "rm") || + !strcasecmp(pos, "iso")) /* maybe dvd */ + return true; + return IsAudioFile(fname); + } + } + return false; } bool config_t::IsImageFile(const char *fname) { - const char *ext = get_extension(fname); - return ext && (ext_is_image(ext) || ext_is_playlist(ext)); -} - -bool config_t::IsDvdImage(const char *fname) -{ - const char *ext = get_extension(fname); - return (ext && !strcasecmp(ext, "iso")) ? true : false; -} - -bool config_t::IsDvdFolder(const char *fname) -{ - struct stat st; - cString buf, folder; - - buf = cString::sprintf("%s/VIDEO_TS/", fname); - if (stat(buf, &st) == 0) { - folder = buf; - } else { - buf = cString::sprintf("%s/video_ts/", fname); - if (stat(buf, &st) == 0) - folder = buf; - else - return false; + if(fname) { + char *pos = strrchr(fname,'.'); + if(pos) { + pos++; + if(!strcasecmp(pos, "jpg") || + !strcasecmp(pos, "jpeg") || + !strcasecmp(pos, "gif") || + !strcasecmp(pos, "tiff") || + !strcasecmp(pos, "bmp") || + !strcasecmp(pos, "mng") || + !strcasecmp(pos, "png")) + return true; + } } - - buf = cString::sprintf("%s/video_ts.ifo", *folder); - if (stat(buf, &st) == 0) - return true; - - buf = cString::sprintf("%s/VIDEO_TS.IFO", *folder); - if (stat(buf, &st) == 0) - return true; - return false; } @@ -496,7 +419,6 @@ config_t::config_t() { speaker_type = SPEAKERS_STEREO; post_plugins = NULL; - config_file = NULL; audio_delay = 0; audio_compression = 0; @@ -549,7 +471,6 @@ config_t::config_t() { strn0cpy(spu_lang[3], "" , sizeof(spu_lang[3])); #endif extsub_size = -1; - dvb_subtitles = 0; alpha_correction = 0; alpha_correction_abs = 0; @@ -576,7 +497,6 @@ config_t::config_t() { remote_mode = 0; listen_port = LISTEN_PORT; remote_keyboard = 1; - remote_max_clients = MAXCLIENTS; remote_usetcp = 1; remote_useudp = 1; remote_usertp = 1; @@ -614,25 +534,17 @@ config_t::config_t() { saturation = -1; contrast = -1; brightness = -1; - sharpness = -1; - noise_reduction = -1; vo_aspect_ratio = 0; live_mode_sync = 1; // Sync SCR to transponder clock in live mode scr_tunning = 0; // Fine-tune xine egine SCR (to sync video to graphics output) scr_hz = 90000; // Current SCR speed (Hz), default is 90000 - decoder_mpeg2 = DECODER_MPEG2_auto; - decoder_h264 = DECODER_H264_auto; - ff_h264_speed_over_accurancy = FF_H264_SPEED_OVER_ACCURACY_auto; - ff_h264_skip_loop_filter = FF_H264_SKIP_LOOPFILTER_auto; - strn0cpy(browse_files_dir, VideoDirectory, sizeof(browse_files_dir)); strn0cpy(browse_music_dir, VideoDirectory, sizeof(browse_music_dir)); strn0cpy(browse_images_dir, VideoDirectory, sizeof(browse_images_dir)); cache_implicit_playlists = 1; enable_id3_scanner = 1; - dvd_arrow_keys_control_playback = 1; main_menu_mode = ShowMenu; force_primary_device = 0; @@ -655,7 +567,7 @@ bool config_t::ProcessArg(const char *Name, const char *Value) bool config_t::ProcessArgs(int argc, char *argv[]) { - static const char short_options[] = "fDw:h:l:r:A:V:d:P:C:pc"; + static const char short_options[] = "fDw:h:l:r:A:V:d:P:pc"; static const struct option long_options[] = { { "fullscreen", no_argument, NULL, 'f' }, @@ -671,7 +583,6 @@ bool config_t::ProcessArgs(int argc, char *argv[]) { "video", required_argument, NULL, 'V' }, { "display", required_argument, NULL, 'd' }, { "post", required_argument, NULL, 'P' }, - { "config", required_argument, NULL, 'C' }, { "primary", no_argument, NULL, 'p' }, { "exit-on-close",no_argument, NULL, 'c' }, { NULL } @@ -736,8 +647,6 @@ bool config_t::ProcessArgs(int argc, char *argv[]) post_plugins = strcatrealloc(post_plugins, ";"); post_plugins = strcatrealloc(post_plugins, optarg); break; - case 'C': config_file = strdup(optarg); - break; case 'p': ProcessArg("ForcePrimaryDevice", "1"); break; case 'c': exit_on_close = 1; @@ -751,7 +660,7 @@ bool config_t::ProcessArgs(int argc, char *argv[]) bool config_t::SetupParse(const char *Name, const char *Value) { - const char *pt; + char *pt; if(*m_ProcessedArgs && NULL != (pt=strstr(m_ProcessedArgs+1, Name)) && *(pt-1) == ' ' && *(pt+strlen(Name)) == ' ') { LOGDBG("Skipping configuration entry %s=%s (overridden in command line)", Name, Value); @@ -804,12 +713,10 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "OSD.SpuLang3")) STRN0CPY(spu_lang[3], Value); #endif else if (!strcasecmp(Name, "OSD.ExtSubSize")) extsub_size = atoi(Value); - else if (!strcasecmp(Name, "OSD.DvbSubtitles")) dvb_subtitles = atoi(Value); else if (!strcasecmp(Name, "RemoteMode")) remote_mode = atoi(Value); else if (!strcasecmp(Name, "Remote.ListenPort")) listen_port = atoi(Value); else if (!strcasecmp(Name, "Remote.Keyboard")) remote_keyboard = atoi(Value); - else if (!strcasecmp(Name, "Remote.MaxClients")) remote_max_clients = atoi(Value); else if (!strcasecmp(Name, "Remote.UseTcp")) remote_usetcp = atoi(Value); else if (!strcasecmp(Name, "Remote.UseUdp")) remote_useudp = atoi(Value); else if (!strcasecmp(Name, "Remote.UseRtp")) remote_usertp = atoi(Value); @@ -839,7 +746,6 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Video.DeinterlaceOptions")) STRN0CPY(deinterlace_opts, Value); else if (!strcasecmp(Name, "Video.Deinterlace")) STRN0CPY(deinterlace_method, Value); else if (!strcasecmp(Name, "Video.FieldOrder")) field_order=atoi(Value)?1:0; - else if (!strcasecmp(Name, "Video.AutoCrop")) autocrop = atoi(Value); else if (!strcasecmp(Name, "Video.AutoCrop.AutoDetect")) autocrop_autodetect = atoi(Value); else if (!strcasecmp(Name, "Video.AutoCrop.SoftStart")) autocrop_soft = atoi(Value); @@ -857,22 +763,14 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Video.Saturation")) saturation = atoi(Value); else if (!strcasecmp(Name, "Video.Contrast")) contrast = atoi(Value); else if (!strcasecmp(Name, "Video.Brightness")) brightness = atoi(Value); - else if (!strcasecmp(Name, "Video.Sharpness")) sharpness = atoi(Value); - else if (!strcasecmp(Name, "Video.NoiseReduction")) noise_reduction = atoi(Value); else if (!strcasecmp(Name, "Video.Overscan")) overscan = atoi(Value); else if (!strcasecmp(Name, "Video.IBPTrickSpeed")) ibp_trickspeed = atoi(Value); else if (!strcasecmp(Name, "Video.MaxTrickSpeed")) max_trickspeed = atoi(Value); else if (!strcasecmp(Name, "Video.AspectRatio")) vo_aspect_ratio = atoi(Value); - else if (!strcasecmp(Name, "Video.Decoder.MPEG2")) decoder_mpeg2 = strstra(Value, s_decoders_MPEG2, 0); - else if (!strcasecmp(Name, "Video.Decoder.H264")) decoder_h264 = strstra(Value, s_decoders_H264, 0); - else if (!strcasecmp(Name, "Video.Decoder.H264.SpeedOverAccuracy")) ff_h264_speed_over_accurancy = strstra(Value, s_ff_speed_over_accuracy, 0); - else if (!strcasecmp(Name, "Video.Decoder.H264.SkipLoopFilter")) ff_h264_skip_loop_filter = strstra(Value, s_ff_skip_loop_filters, 0); - else if (!strcasecmp(Name, "Post.pp.Enable")) ffmpeg_pp = atoi(Value); else if (!strcasecmp(Name, "Post.pp.Quality")) ffmpeg_pp_quality = atoi(Value); else if (!strcasecmp(Name, "Post.pp.Mode")) STRN0CPY(ffmpeg_pp_mode, Value); - else if (!strcasecmp(Name, "Post.unsharp.Enable")) unsharp = atoi(Value); else if (!strcasecmp(Name, "Post.unsharp.luma_matrix_width")) unsharp_luma_matrix_width = atoi(Value); else if (!strcasecmp(Name, "Post.unsharp.luma_matrix_height")) unsharp_luma_matrix_height = atoi(Value); @@ -880,7 +778,6 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Post.unsharp.chroma_matrix_width")) unsharp_chroma_matrix_width = atoi(Value); else if (!strcasecmp(Name, "Post.unsharp.chroma_matrix_height")) unsharp_chroma_matrix_height = atoi(Value); else if (!strcasecmp(Name, "Post.unsharp.chroma_amount")) unsharp_chroma_amount = atoi(Value); - else if (!strcasecmp(Name, "Post.denoise3d.Enable")) denoise3d = atoi(Value); else if (!strcasecmp(Name, "Post.denoise3d.luma")) denoise3d_luma = atoi(Value); else if (!strcasecmp(Name, "Post.denoise3d.chroma")) denoise3d_chroma = atoi(Value); @@ -891,8 +788,6 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Media.BrowseImagesDir")) STRN0CPY(browse_images_dir, Value); else if (!strcasecmp(Name, "Media.CacheImplicitPlaylists")) cache_implicit_playlists = atoi(Value); else if (!strcasecmp(Name, "Media.EnableID3Scanner")) enable_id3_scanner = atoi(Value); - else if (!strcasecmp(Name, "Media.DVD.ArrowKeysControlPlayback")) dvd_arrow_keys_control_playback = atoi(Value); - else if (!strcasecmp(Name, "Playlist.Tracknumber")) playlist_tracknumber = atoi(Value); else if (!strcasecmp(Name, "Playlist.Artist")) playlist_artist = atoi(Value); else if (!strcasecmp(Name, "Playlist.Album")) playlist_album = atoi(Value); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.h,v 1.46.2.3 2009-06-07 23:40:38 phintuka Exp $ + * $Id: config.h,v 1.46.2.1 2008-09-26 13:03:27 phintuka Exp $ * */ @@ -16,9 +16,6 @@ #include <vdr/config.h> -// Max number of remote clients -#define MAXCLIENTS 10 - // Decoder buffer size #define PES_BUFFERS_CUSTOM 0 #define PES_BUFFERS_TINY_50 1 @@ -135,8 +132,6 @@ #define SPEAKERS_A52_PASSTHRU 12 #define SPEAKERS_count 13 -#define SUBTITLESIZE_count 7 - // OSD blending methods #define OSD_BLENDING_SOFTWARE 0 // xine-lib "normal" osd #define OSD_BLENDING_HARDWARE 1 // xine-lib "unscaled osd" @@ -156,34 +151,10 @@ #define OSD_SCALING_BILINEAR 2 #define OSD_SCALING_count 3 +#define SUBTITLESIZE_count 7 #if VDRVERSNUM >= 10510 # define DEVICE_SUPPORTS_IBP_TRICKSPEED #endif - -// Video decoder -#define DECODER_MPEG2_auto 0 /* use value from frontend config_xineliboutput */ -#define DECODER_MPEG2_LIBMPEG2 1 -#define DECODER_MPEG2_FFMPEG 2 -#define DECODER_MPEG2_count 3 - -#define DECODER_H264_auto 0 /* use value from frontend config_xineliboutput */ -#define DECODER_H264_FFMPEG 1 -#define DECODER_H264_COREAVC 2 -#define DECODER_H264_count 3 - -#define FF_H264_SKIP_LOOPFILTER_auto 0 /* use value from frontend config_xineliboutput */ -#define FF_H264_SKIP_LOOPFILTER_DEFAULT 1 -#define FF_H264_SKIP_LOOPFILTER_NONE 2 -#define FF_H264_SKIP_LOOPFILTER_NONREF 3 -#define FF_H264_SKIP_LOOPFILTER_BIDIR 4 -#define FF_H264_SKIP_LOOPFILTER_NONKEY 5 -#define FF_H264_SKIP_LOOPFILTER_ALL 6 -#define FF_H264_SKIP_LOOPFILTER_count 7 - -#define FF_H264_SPEED_OVER_ACCURACY_auto 0 /* use value from frontend config_xineliboutput */ -#define FF_H264_SPEED_OVER_ACCURACY_no 1 -#define FF_H264_SPEED_OVER_ACCURACY_yes 2 -#define FF_H264_SPEED_OVER_ACCURACY_count 3 #define HIDDEN_OPTION(opt) \ (xc.IsOptionHidden(xc.opt)) @@ -203,36 +174,31 @@ typedef enum { class config_t { public: - static const char * const s_bufferSize [PES_BUFFERS_count + 1]; - static const int i_pesBufferSize [PES_BUFFERS_count + 1]; - static const char * const s_aspects [ASPECT_count + 1]; - static const char * const s_vo_aspects [VO_ASPECT_count + 1]; - static const char * const s_deinterlaceMethods [DEINTERLACE_count + 1]; - static const char * const s_deinterlaceMethodNames [DEINTERLACE_count + 1]; - static const char * const s_fieldOrder [FIELD_ORDER_count + 1]; - static const char * const s_audioDriverNames [AUDIO_DRIVER_count + 1]; - static const char * const s_audioDrivers [AUDIO_DRIVER_count + 1]; - static const char * const s_videoDriverNamesX11 [X11_DRIVER_count + 1]; - static const char * const s_videoDriversX11 [X11_DRIVER_count + 1]; - static const char * const s_videoDriverNamesFB [FB_DRIVER_count + 1]; - static const char * const s_videoDriversFB [FB_DRIVER_count + 1]; - static const char * const s_frontendNames [FRONTEND_count + 1]; - static const char * const s_frontends [FRONTEND_count + 1]; - static const char * const s_frontend_files [FRONTEND_count + 1]; - static const char * const s_audioEqNames [AUDIO_EQ_count + 1]; - static const char * const s_audioVisualizations [AUDIO_VIS_count + 1]; - static const char * const s_audioVisualizationNames[AUDIO_VIS_count + 1]; - static const char * const s_speakerArrangements [SPEAKERS_count + 1]; - static const char * const s_subtitleSizes [SUBTITLESIZE_count + 1]; - static const char * const s_osdBlendingMethods [OSD_BLENDING_count + 1]; - static const char * const s_osdMixers [OSD_MIXER_count + 1]; - static const char * const s_osdScalings [OSD_SCALING_count + 1]; - static const char * const s_decoders_MPEG2 [DECODER_MPEG2_count + 1]; - static const char * const s_decoders_H264 [DECODER_H264_count + 1]; - static const char * const s_ff_skip_loop_filters [FF_H264_SKIP_LOOPFILTER_count + 1]; - static const char * const s_ff_speed_over_accuracy [FF_H264_SPEED_OVER_ACCURACY_count + 1]; - + static const char * const s_bufferSize[]; + static const int i_pesBufferSize[]; + static const char * const s_aspects[]; + static const char * const s_deinterlaceMethods[]; + static const char * const s_deinterlaceMethodNames[]; + static const char * const s_fieldOrder[]; + static const char * const s_audioDriverNames[]; + static const char * const s_audioDrivers[]; + static const char * const s_videoDriverNamesX11[]; + static const char * const s_videoDriversX11[]; + static const char * const s_videoDriverNamesFB[]; + static const char * const s_videoDriversFB[]; + static const char * const s_frontendNames[]; + static const char * const s_frontends[]; + static const char * const s_frontend_files[]; + static const char * const s_audioEqNames[]; + static const char * const s_audioVisualizations[]; + static const char * const s_audioVisualizationNames[]; + static const char * const s_speakerArrangements[]; + static const char * const s_subtitleSizes[]; static const char * const s_subExts[]; + static const char * const s_osdBlendingMethods[]; + static const char * const s_osdMixers[]; + static const char * const s_osdScalings[]; + static const char * const s_vo_aspects[]; public: @@ -246,7 +212,6 @@ class config_t { char audio_driver[32]; char audio_port[64]; char *post_plugins; // static post plugins from command line options - char *config_file; // config file from command line options int pes_buffers; char modeline[64]; @@ -278,8 +243,6 @@ class config_t { int saturation; // 0...0xffff, -1 == off int contrast; // 0...0xffff, -1 == off int brightness; // 0...0xffff, -1 == off - int sharpness; // 0...0xffff, -1 == off - int noise_reduction; // 0...0xffff, -1 == off int vo_aspect_ratio; // OSD settings @@ -292,8 +255,7 @@ class config_t { int osd_blending_lowresvideo; // Use hardware blending for low-resolution video int alpha_correction; int alpha_correction_abs; - int extsub_size; // size of separate subtitles ( -1 = xine default ; 0...6 = { tiny small normal large very large huge } - int dvb_subtitles; // send DVB subtitles in data stream (decode+display using xine-lib or external media player) + int extsub_size; /* size of separate subtitles ( -1 = xine default ; 0...6 = { tiny small normal large very large huge } */ // Media player #if VDRVERSNUM < 10515 @@ -308,8 +270,7 @@ class config_t { int subtitle_vpos; // used in media player. Not saved ! int playlist_tracknumber; int playlist_artist; - int playlist_album; - int dvd_arrow_keys_control_playback; + int playlist_album; // Audio visualization char audio_visualization[64]; @@ -362,9 +323,8 @@ class config_t { char remote_local_if[32]; // Listen only on this interface char remote_local_ip[32]; // Bind locally to this IP int remote_keyboard; // Allow remote client to control VDR with keyboard, LIRC, etc. - int remote_max_clients; // Max. number of clients - int remote_usebcast; // Use broadcasts to find servers automatically + int remote_usebcast; // Use proadcasts to find servers automatically int remote_usepipe; // enable local pipes for video transport int remote_usertp; // enable RTP multicast for video transport int remote_useudp; // enable UDP unicast for video transport @@ -389,11 +349,6 @@ class config_t { int scr_tunning; /* Fine-tune xine egine SCR (to sync video to graphics output) */ int scr_hz; /* Current SCR speed (Hz), default is 90000 */ - int decoder_mpeg2; /* DECODER_MPEG2_... */ - int decoder_h264; /* DECODER_H264_... */ - int ff_h264_speed_over_accurancy; - int ff_h264_skip_loop_filter; /* FF_H264_SKIP_LOOPFILTER_* */ - config_t(); bool SetupParse(const char *Name, const char *Value); @@ -403,8 +358,6 @@ class config_t { bool IsAudioFile(const char *); bool IsVideoFile(const char *); bool IsPlaylistFile(const char *); - bool IsDvdFolder(const char *); - bool IsDvdImage(const char *); cString AutocropOptions(void); cString SwScaleOptions(void); diff --git a/examples/remote.conf.example b/examples/remote.conf.example index df13bc33..681c2760 100644 --- a/examples/remote.conf.example +++ b/examples/remote.conf.example @@ -43,9 +43,6 @@ XKeySym.Channel- Next XKeySym.Volume+ KP_Add XKeySym.Volume- KP_Subtract XKeySym.Mute m -XKeySym.Info I -XKeySym.Audio A -XKeySym.Subtitles S XKeySym.Schedule F6 XKeySym.Channels F7 XKeySym.Timers F8 @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.59.2.3 2009-06-04 11:58:48 phintuka Exp $ + * $Id: frontend.c,v 1.59.2.2 2008-09-26 13:46:49 phintuka Exp $ * */ @@ -622,9 +622,9 @@ bool cXinelibThread::LogoDisplay(void) if(Setup.FileName()) { cString SetupPath = Setup.FileName(); - const char *end = strrchr(SetupPath, '/'); + char *end = strrchr(SetupPath, '/'); if(end) { - SetupPath.Truncate(end - (const char *)SetupPath); + *end = 0; fd = open(Path=cString::sprintf("%s/plugins/xineliboutput/logo.mpv", *SetupPath), O_RDONLY); } } diff --git a/frontend_local.c b/frontend_local.c index 8f100248..780520a4 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,12 +4,10 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.31.2.1 2009-06-06 13:25:21 phintuka Exp $ + * $Id: frontend_local.c,v 1.31 2008-04-03 08:08:27 phintuka Exp $ * */ -#define __STDC_CONSTANT_MACROS - #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -162,18 +160,17 @@ int64_t cXinelibLocal::GetSTC() { TRACEF("cXinelibLocal::GetSTC"); - union { - char buf[32]; - int64_t pts; - } u = {"GETSTC\r\n"}; + int64_t pts = -1; + char buf[32] = {0}; + strcpy(buf, "GETSTC\r\n"); LOCK_FE; - - if (fe && m_bReady) - if (0 == fe->xine_control(fe, u.buf)) - return u.pts; - - return INT64_C(-1); + if(fe && m_bReady) + if(0 == fe->xine_control(fe, (char*)buf)) + //if(*((int64_t *)buf) < MAX_SCR) + // if(*((int64_t *)buf) >= 0LL) + pts = *((int64_t *)buf); + return pts; } // diff --git a/frontend_svr.c b/frontend_svr.c index 93ccdeab..d0f07b61 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.56.2.5 2009-06-04 13:16:37 phintuka Exp $ + * $Id: frontend_svr.c,v 1.56.2.4 2009-02-12 11:14:15 phintuka Exp $ * */ @@ -1332,12 +1332,11 @@ void cXinelibServer::Handle_Control_HTTP(int cli, const char *arg) else if(!strncmp(m_State[cli]->Uri(), "/PLAYFILE", 9)) { if( *m_FileName && m_bPlayingFile) { - cString file = m_FileName; - const char *pos = strstr(m_FileName, "#subtitle:"); - if(pos) - file.Truncate(pos - m_FileName); - bool Allow = ( !strcmp_escaped(file, m_State[cli]->Uri() + 9) + char *pos = strstr(m_FileName, "#subtitle:"); + if(pos) *pos = 0; + bool Allow = ( !strcmp_escaped(m_FileName, m_State[cli]->Uri() + 9) || (pos && !strcmp_escaped(pos + 10, m_State[cli]->Uri() + 9))); + if(pos) *pos = '#'; if(Allow) { LOGMSG("HTTP streaming media file"); diff --git a/media_player.c b/media_player.c index 0cd2502e..dd437b16 100644 --- a/media_player.c +++ b/media_player.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: media_player.c,v 1.52.2.7 2009-09-16 09:56:11 phintuka Exp $ + * $Id: media_player.c,v 1.52.2.6 2008-12-10 23:00:18 phintuka Exp $ * */ @@ -46,7 +46,6 @@ class cXinelibPlayer : public cPlayer cPlaylist m_Playlist; bool m_Error; - bool m_UseResumeFile; int m_Speed; void UpdateNumTracks(void); @@ -76,7 +75,8 @@ class cXinelibPlayer : public cPlayer bool NextFile(int step); bool Playing(void) { return !(m_Error || cXinelibDevice::Instance().EndOfStreamReached()); } bool Error(void) { return m_Error; } - void UseResumeFile(bool Val) { m_UseResumeFile = Val; } + + bool m_UseResume; /* Playlist access */ cPlaylist& Playlist(void) { return m_Playlist; } @@ -88,7 +88,7 @@ class cXinelibPlayer : public cPlayer cXinelibPlayer::cXinelibPlayer(const char *File, bool Queue, const char *SubFile) { m_ResumeFile = NULL; - m_UseResumeFile = true; + m_UseResume = true; m_Error = false; m_Speed = 1; @@ -210,7 +210,7 @@ void cXinelibPlayer::UpdateNumTracks(void) int count = cXinelibDevice::Instance().PlayFileCtrl("GETAUTOPLAYSIZE CD", 10000); if(count>1) { for(int i=0; i<count; i++) - m_Playlist.Read(cString::sprintf("cdda:/%d", i+1)); + m_Playlist.Read(cString::sprintf("cdda:/%d", i+1)); m_Playlist.Del(m_Playlist.First()); } } @@ -220,9 +220,9 @@ void cXinelibPlayer::Activate(bool On) { int pos = 0, len = 0, fd = -1; if(On) { - if(m_UseResumeFile && !*m_ResumeFile) + if(m_UseResume && !*m_ResumeFile) m_ResumeFile = cString::sprintf("%s.resume", *m_File); - if(m_UseResumeFile && 0 <= (fd = open(m_ResumeFile, O_RDONLY))) { + if(m_UseResume && 0 <= (fd = open(m_ResumeFile, O_RDONLY))) { if(read(fd, &pos, sizeof(int)) != sizeof(int)) pos = 0; close(fd); @@ -232,10 +232,9 @@ void cXinelibPlayer::Activate(bool On) // (those may contain #subtitle, #volnorm etc. directives) cString mrl; if(*m_SubFile) - mrl = cString::sprintf("%s%s#subtitle:%s%s", + mrl = cString::sprintf("%s%s#subtitle:%s", m_File[0] == '/' ? "file:" : "", *cPlaylist::EscapeMrl(m_File), - m_SubFile[0] == '/' ? "file:" : "", *cPlaylist::EscapeMrl(m_SubFile)); else if((*m_File)[0] == '/') mrl = cString::sprintf("%s%s", @@ -244,7 +243,6 @@ void cXinelibPlayer::Activate(bool On) else mrl = cPlaylist::EscapeMrl(m_File); - // Start replay UpdateNumTracks(); m_Error = !cXinelibDevice::Instance().PlayFile(mrl, pos); LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Error ? "FAIL" : "OK"); @@ -267,7 +265,7 @@ void cXinelibPlayer::Activate(bool On) UpdateNumTracks(); } } else { - if(m_UseResumeFile && *m_ResumeFile) { + if(m_UseResume && *m_ResumeFile) { pos = cXinelibDevice::Instance().PlayFileCtrl("GETPOS"); len = cXinelibDevice::Instance().PlayFileCtrl("GETLENGTH"); if(pos>10000 && pos < (len-10000)) { @@ -286,7 +284,7 @@ void cXinelibPlayer::Activate(bool On) } m_ResumeFile = NULL; } - cXinelibDevice::Instance().PlayFile(NULL); + cXinelibDevice::Instance().PlayFile(NULL,0); m_Error = false; } } @@ -457,7 +455,7 @@ cXinelibPlayerControl::cXinelibPlayerControl(eMainMenuMode Mode, const char *Fil number = 0; lastTime.Set(); - m_Player->UseResumeFile( (Mode==ShowFiles) ); + m_Player->m_UseResume = (Mode==ShowFiles); MsgReplaying(*m_Player->Playlist().Current()->Title, *m_Player->File()); } @@ -902,23 +900,21 @@ void cXinelibDvdPlayerControl::Show(void) eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) { - // Check for end of stream and failed open if ( !m_Player->Playing() ) { LOGDBG("cXinelibDvdPlayerControl: EndOfStreamReached"); Hide(); return osEnd; } - - // Update DVD title information - const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle); - if (ti && ti[0] && (!m_CurrentDVDTitle || !strstr(m_CurrentDVDTitle, ti))) { - memset(m_CurrentDVDTitle, 0, 63); - strn0cpy(m_CurrentDVDTitle, ti, 63); - m_Player->Playlist().Current()->Title = m_CurrentDVDTitle; - MsgReplaying(m_CurrentDVDTitle, NULL); + else { + const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle); + if (ti && ti[0] && (!m_CurrentDVDTitle || !strstr(m_CurrentDVDTitle, ti))) { + memset(m_CurrentDVDTitle, 0, 63); + strn0cpy(m_CurrentDVDTitle, ti, 63); + m_Player->Playlist().Current()->Title = m_CurrentDVDTitle; + MsgReplaying(m_CurrentDVDTitle, NULL); + } } - // Handle menu selection if(Menu) { if(Key == kRed) Hide(); @@ -935,13 +931,10 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) return osContinue; } - // Update progress bar display if (m_DisplayReplay) Show(); - // Handle menu navigation - - bool MenuDomain = !xc.dvd_arrow_keys_control_playback; + bool MenuDomain = false; if(Key != kNone || m_DisplayReplay) { const char *dt = cXinelibDevice::Instance().GetMetaInfo(miDvdTitleNo); if(dt && !strcmp("0", dt)) @@ -969,8 +962,6 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) } } - // Handle normal keys - if(!MenuDomain) { switch(Key) { // Replay control @@ -1094,12 +1085,8 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) class cXinelibImagePlayer : public cPlayer { private: - cString m_Mrl; + cString m_File; bool m_Active; - bool m_Error; - cXinelibDevice *m_Dev; - - bool Play(void); protected: virtual void Activate(bool On); @@ -1109,15 +1096,12 @@ class cXinelibImagePlayer : public cPlayer { virtual ~cXinelibImagePlayer(); bool ShowImage(const char *File); - bool Error(void) { return m_Error; } }; cXinelibImagePlayer::cXinelibImagePlayer(const char *File) { - m_Mrl = File; + m_File = File; m_Active = false; - m_Error = false; - m_Dev = &(cXinelibDevice::Instance()); } cXinelibImagePlayer::~cXinelibImagePlayer() @@ -1126,29 +1110,28 @@ cXinelibImagePlayer::~cXinelibImagePlayer() Detach(); } -bool cXinelibImagePlayer::Play(void) -{ - if ((*m_Mrl)[0] == '/') - m_Mrl = cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_Mrl)); - - return m_Dev->PlayFile(m_Mrl, 0, true); -} - void cXinelibImagePlayer::Activate(bool On) { - m_Active = On; - m_Error = false; - if (On) - Play(); - else - m_Dev->PlayFile(NULL); + if(On) { + m_Active = true; + cXinelibDevice::Instance().PlayFile( ( (*m_File)[0]=='/' + ? *cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File)) + : *m_File), + 0, true); + } else { + m_Active = false; + cXinelibDevice::Instance().PlayFile(NULL, 0); + } } bool cXinelibImagePlayer::ShowImage(const char *File) { - m_Mrl = File; - if (m_Active) - return Play(); + m_File = File; + if(m_Active) + return cXinelibDevice::Instance().PlayFile( ( (*m_File)[0] == '/' + ? *cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File)) + : *m_File ), + 0, true); return true; } @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menu.c,v 1.57.2.2 2009-06-06 13:21:27 phintuka Exp $ + * $Id: menu.c,v 1.57.2.1 2009-02-12 11:04:03 phintuka Exp $ * */ @@ -92,7 +92,7 @@ static char *ParentDir(const char *dir) static char *LastDir(const char *dir) { - const char *pt = strrchr(dir, '/'); + char *pt = strrchr(dir, '/'); if(pt && pt[0] && pt[1]) return strdup(pt+1); return NULL; @@ -386,33 +386,36 @@ bool cMenuBrowseFiles::ScanDir(const char *DirName) } else if(m_Mode == ShowImages && xc.IsImageFile(buffer)) { Add(new cFileListItem(e->d_name, false)); - // DVD image (.iso) - } else if (m_Mode == ShowFiles && xc.IsDvdImage(buffer)) { - Add(new cFileListItem(e->d_name, false, false, false, true)); - // video } else if (m_Mode == ShowFiles && xc.IsVideoFile(buffer)) { + bool resume = false, subs = false, dvd = false; + char *pos = strrchr(e->d_name, '.'); cString subfile; - cString resumefile; - - // separate subtitles ? - cString basename = cString::sprintf("%s/%s", DirName, e->d_name); - const char *p = strrchr(basename, '.'); - if (p) - basename.Truncate(p - basename); - int i; - for(i=0; xc.s_subExts[i] && !*subfile; i++) { - cString tmp = cString::sprintf("%s%s", *basename, xc.s_subExts[i]); - if (stat(tmp, &st) == 0) - subfile = tmp; - } + + if(pos) { + // .iso image -> dvd + if(pos && !strcasecmp(pos, ".iso")) + dvd = true; + + // separate subtitles ? + subfile = cString::sprintf("%s/%s____", DirName, e->d_name); + char *p = strrchr(subfile, '.'); + if( p ) { + int i; + for(i=0; xc.s_subExts[i] && !subs; i++) { + strcpy(p, xc.s_subExts[i]); + if (stat(subfile, &st) == 0) + subs = true; + } + } + } // resume file ? - resumefile = cString::sprintf("%s/%s.resume", DirName, e->d_name); - if (stat(resumefile, &st) != 0) - resumefile = NULL; + buffer = cString::sprintf("%s/%s.resume", DirName, e->d_name); + if (stat(buffer, &st) == 0) + resume = true; - Add(new cFileListItem(e->d_name, false, *resumefile, subfile)); + Add(new cFileListItem(e->d_name, false, resume, subs?*subfile:NULL, dvd)); } } } diff --git a/menuitems.c b/menuitems.c index f22c6e57..33b1b9b7 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c,v 1.11.2.2 2009-06-04 13:12:33 phintuka Exp $ + * $Id: menuitems.c,v 1.11.2.1 2008-09-26 13:14:33 phintuka Exp $ * */ @@ -165,7 +165,7 @@ cFileListItem::cFileListItem(const char *name, bool IsDir, void cFileListItem::Set(void) { cString txt; - const char *pt; + char *pt; if(m_ShowFlags) { if(m_IsDir) { if(m_IsDvd) @@ -175,7 +175,7 @@ void cFileListItem::Set(void) } else { txt = cString::sprintf("%c\t%c\t%s", m_HasResume ? ' ' : '*', *m_SubFile ? 'S' : m_IsDvd ? 'D' : ' ', *m_Name); if(NULL != (pt = strrchr(txt,'.'))) - txt.Truncate(pt - txt); + *pt = 0; } } else { if(m_IsDir) { @@ -183,7 +183,7 @@ void cFileListItem::Set(void) } else { txt = m_Name; if(NULL != (pt = strrchr(txt,'.'))) - txt.Truncate(pt - txt); + *pt = 0; } } SetText(txt); diff --git a/setup_menu.c b/setup_menu.c index c377d0ff..646d9eea 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: setup_menu.c,v 1.58.2.2 2009-06-04 13:13:39 phintuka Exp $ + * $Id: setup_menu.c,v 1.58.2.1 2008-10-18 10:41:06 phintuka Exp $ * */ @@ -456,7 +456,7 @@ struct tvtime_s { judder_correction = strstr(str, "judder_correction=0") ? 0 : 1; use_progressive_frame_flag = strstr(str, "use_progressive_frame_flag=0") ? 0 : 1; method=1; - const char *m = strstr(str, "method="); + char *m = strstr(str, "method="); if(m) { char *tmp = strdup(m + 7); if(strchr(tmp, ',')) diff --git a/tools/http.c b/tools/http.c index 0e7de26a..4a529550 100644 --- a/tools/http.c +++ b/tools/http.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: http.c,v 1.7 2009-06-02 08:37:58 phintuka Exp $ + * $Id: http.c,v 1.6 2007-06-21 09:12:52 phintuka Exp $ * */ @@ -297,7 +297,7 @@ bool cHttpStreamer::Seek(void) } /* content type */ - const char *ext = strrchr(m_Filename, '.'); + char *ext = strrchr(m_Filename, '.'); if(ext) { const char *mime = mimetype(ext+1); if(mime) diff --git a/tools/iso639.h b/tools/iso639.h index ae30fa0e..cd0e954f 100644 --- a/tools/iso639.h +++ b/tools/iso639.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: iso639.h,v 1.4 2009-05-29 14:25:06 phintuka Exp $ + * $Id: iso639.h,v 1.1.2.1 2008-09-26 13:49:45 phintuka Exp $ * */ @@ -60,7 +60,6 @@ static const struct { {"guj", "gu"}, {"hau", "ha"}, {"heb", "he"}, - {"heb", "iw"}, {"hin", "hi"}, {"hun", "hu"}, {"ice", "is"}, @@ -158,9 +157,9 @@ static const struct { static const char *iso639_2_to_iso639_1(const char *lang) { if (lang && lang[0]) { - if (lang[1] && !lang[2]) { + if(lang[1] && !lang[2]) { for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++) - if (!memcmp(ISO639_map[i].iso639_1, lang, 2)) + if (((uint16_t*)ISO639_map[i].iso639_1)[0] == ((uint16_t*)lang)[0]) return ISO639_map[i].iso639_2; LOGMSG("Unknown iso639-2 code: %s", lang); } @@ -172,9 +171,10 @@ static const char *iso639_2_to_iso639_1(const char *lang) static const char *iso639_1_to_iso639_2(const char *lang) { if (lang && lang[0]) { - if (lang[1] && lang[2] && !lang[3]) { + if(lang[1] && lang[2] && !lang[3]) { for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++) - if (!memcmp(ISO639_map[i].iso639_2, lang, 3)) + if (((uint16_t*)ISO639_map[i].iso639_2)[0] == ((uint16_t*)lang)[0] && + ((uint8_t *)ISO639_map[i].iso639_2)[2] == ((uint8_t *)lang)[2]) return ISO639_map[i].iso639_1; LOGMSG("Unknown iso639-1 code: %s", lang); } diff --git a/tools/playlist.c b/tools/playlist.c index 652253c6..18f8944b 100644 --- a/tools/playlist.c +++ b/tools/playlist.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: playlist.c,v 1.17.2.4 2009-06-04 21:04:34 phintuka Exp $ + * $Id: playlist.c,v 1.17.2.2 2009-02-12 11:20:24 phintuka Exp $ * */ @@ -36,12 +36,6 @@ #define MAX_PLAYLIST_FILES 1024 -static void strip_extension(cString& fname) -{ - const char *ext = strrchr(fname, '.'); - if (ext) - fname.Truncate(ext - fname); -} // // cPlaylistItem @@ -49,7 +43,7 @@ static void strip_extension(cString& fname) cPlaylistItem::cPlaylistItem(const char *filename) { - const char *pt; + char *pt; Filename = filename; Position = -1; @@ -58,8 +52,9 @@ cPlaylistItem::cPlaylistItem(const char *filename) Title = pt + 1; else Title = filename; - - strip_extension(Title); + + if(NULL != (pt = strrchr(Title, '.'))) + *pt = 0; } cPlaylistItem::cPlaylistItem(const char *filename, @@ -67,6 +62,8 @@ cPlaylistItem::cPlaylistItem(const char *filename, const char *title, int position) { + char *pt; + if(path[strlen(path)-1] != '/') Filename = cString::sprintf("%s/%s", path, filename); else @@ -74,8 +71,8 @@ cPlaylistItem::cPlaylistItem(const char *filename, Position = position; Title = title ?: filename; - if (!title) - strip_extension(Title); + if(!title && (pt = strrchr(Title, '.'))) + *pt = 0; } int cPlaylistItem::Compare(const cListObject &ListObject) const @@ -175,11 +172,11 @@ class cID3Scanner : public cThread while(md_list) { if ((key=EXTRACTOR_getKeywordTypeAsString(md_list->keywordType))) { if (!strcasecmp(key,"title")) - Item->Title = md_list->keyword; + Item->Title = strdup(md_list->keyword); else if (!strcasecmp(key,"artist")) - Item->Artist = md_list->keyword; + Item->Artist = strdup(md_list->keyword); else if (!strcasecmp(key,"album")) - Item->Album = md_list->keyword; + Item->Album = strdup(md_list->keyword); else if (!strcasecmp(key,"track number")) Item->Tracknumber = cString::sprintf("%s%s", strlen(md_list->keyword) == 1 ? "0" : "", md_list->keyword); md_list=md_list->next; @@ -534,7 +531,7 @@ bool cPlaylist::ReadCache(void) int len = strlen(m_Folder); cPlaylistItem *it = NULL; cReadLine r; - const char *pt; + char *pt; while(NULL != (pt = r.Read(f))) { if(!strncmp(pt, "File", 4)) { it = NULL; @@ -765,26 +762,29 @@ int cPlaylist::ReadPlaylist(const char *file) if(f) { LOGDBG("cPlaylist: parsing %s", file); - const char *ext = strrchr(file, '.'); - if(!strcasecmp(ext, ".pls")) + char *pt = strrchr(file, '.'); + if(!strcasecmp(pt, ".pls")) parser = new cPlsReader(*this); - else if(!strcasecmp(ext, ".asx")) + else if(!strcasecmp(pt, ".asx")) parser = new cAsxReader(*this); - else /*if(!strcasecmp(ext, ".m3u"))*/ + else /*if(!strcasecmp(pt, ".m3u"))*/ parser = new cM3uReader(*this); /* parses plain lists (.ram, ...) too ...*/ - /* get folder */ - cString Folder = file; - const char *folder = strrchr(Folder, '/'); - if (folder) - Folder.Truncate(folder - Folder + 1); + cString Base(file); + if(NULL != (pt=strrchr(Base,'/'))) + pt[1]=0; int n = 0; cReadLine r; - char *pt; while(NULL != (pt = r.Read(f)) && n < MAX_PLAYLIST_FILES) { if(NULL != (pt = parser->Parse(pt))) { + if(depth && n==0) { + // TODO + // - add "separator" item + // Add(new cPlaylistItem(NULL, Base, "---"); + } + if(xc.IsPlaylistFile(pt)) { parser->ResetCache(); LOGDBG("cPlaylist: found playlist inside playlist"); @@ -797,7 +797,7 @@ int cPlaylist::ReadPlaylist(const char *file) strchr(pt,'/') - pt < 8)) n += ReadPlaylist(pt); else - n += ReadPlaylist(cString::sprintf("%s%s", *Folder, pt)); + n += ReadPlaylist(cString::sprintf("%s%s", *Base, pt)); depth--; } @@ -811,7 +811,7 @@ int cPlaylist::ReadPlaylist(const char *file) Last()->Title = parser->Title(); } else { // relative path - Add(new cPlaylistItem(pt, Folder, parser->Title())); + Add(new cPlaylistItem(pt, Base, parser->Title())); } Last()->Position = parser->Position(); parser->ResetCache(); @@ -836,10 +836,10 @@ int cPlaylist::ReadPlaylist(const char *file) static cString LastDir(cString& path) { - cString tmp = path; - const char *pt = strrchr(tmp, '/'); + cString tmp = strdup(path); + char *pt = strrchr(tmp, '/'); if(pt && pt > *tmp) { - tmp.Truncate(pt - tmp); + *pt = 0; pt = strrchr(tmp, '/'); if(pt) return cString(pt+1); @@ -854,10 +854,9 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive) // extract playlist root folder if(!*m_Folder) { - const char *pt; m_Folder = PlaylistFile; - if (NULL != (pt=strrchr(m_Folder, '/'))) - m_Folder.Truncate(pt - m_Folder + 1); + if(strrchr(m_Folder, '/')) + *(strrchr(m_Folder, '/') + 1) = 0; } if(xc.IsPlaylistFile(PlaylistFile)) { @@ -866,14 +865,15 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive) m_Origin = ePlaylist; cString dir = LastDir(m_Folder); - const char *name = strrchr(PlaylistFile, '/'); + char *name = strrchr(PlaylistFile, '/'); name = name ? name+1 : NULL; if(*dir && name) m_Name = cString::sprintf("%s - %s", *dir, name); else m_Name = name ?: ""; - strip_extension(m_Name); + if(strrchr(m_Name, '.')) + *(strrchr(m_Name, '.')) = 0; } else if(PlaylistFile[ 0] == '/' && PlaylistFile[strlen(PlaylistFile)-1] == '/') { @@ -884,7 +884,7 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive) if(!*m_Name) { m_Name = PlaylistFile; - m_Name.Truncate( strrchr(m_Name, '/') - m_Name); + *(strrchr(m_Name, '/')) = 0; if(strrchr(m_Name, '/')) { cString dir = LastDir(m_Name); if(*dir) @@ -920,7 +920,7 @@ cString cPlaylist::EscapeMrl(const char *mrl) static const uint8_t hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; const uint8_t *fn = (const uint8_t*)mrl; int size = strlen(mrl) + 16; - char *buf = (char *)malloc(size); + uint8_t *buf = (uint8_t*)malloc(size); int i = 0, found = 0; LOGDBG("cPlaylist::EscapeMrl('%s')", fn); @@ -930,7 +930,7 @@ cString cPlaylist::EscapeMrl(const char *mrl) while (*fn) { if(size-7 < i) - buf = (char *)realloc(buf, (size=size+16)); + buf = (uint8_t *)realloc(buf, (size=size+16)); switch (*fn) { case 1 ... ' ': case 127 ... 255: @@ -973,7 +973,7 @@ cString cPlaylist::EscapeMrl(const char *mrl) buf[i] = 0; LOGDBG(" --> '%s'", buf); - return cString(buf, true); + return cString((const char*)buf, true); } cString cPlaylist::GetEntry(cPlaylistItem *i, bool isPlaylist, bool isCurrent) diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c index 13a59c48..a3c589af 100644 --- a/tools/udp_pes_scheduler.c +++ b/tools/udp_pes_scheduler.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: udp_pes_scheduler.c,v 1.34.2.2 2009-06-06 13:27:41 phintuka Exp $ + * $Id: udp_pes_scheduler.c,v 1.34.2.1 2009-02-12 11:18:37 phintuka Exp $ * */ @@ -821,10 +821,9 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2) if(fd < 0) /* no re-send for RTP */ return; - struct { - stream_udp_header_t hdr; - char mem[64-sizeof(stream_udp_header_t)]; - } udp_ctrl = {{(uint64_t)INT64_C(-1), (uint16_t)-1}, {0}}; + char udp_ctrl[64] = {0}; + ((stream_udp_header_t *)udp_ctrl)->seq = (uint16_t)(-1); + ((stream_udp_header_t *)udp_ctrl)->pos = (uint64_t)(-1); // Handle buffer wrap if(Seq1 > Seq2) @@ -836,10 +835,10 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2) LOGDBG("cUdpScheduler::ReSend: requested range too large (%d-%d)", Seq1, Seq2); - sprintf((char*)udp_ctrl.hdr.payload, + sprintf((udp_ctrl+sizeof(stream_udp_header_t)), "UDP MISSING %d-%d %" PRIu64, Seq1, (Seq2 & UDP_BUFFER_MASK), Pos); - send(fd, &udp_ctrl, sizeof(udp_ctrl), 0); + send(fd, udp_ctrl, sizeof(udp_ctrl), 0); return; } @@ -878,19 +877,21 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2) // buffer has been lost - send packet missing info LOGRESEND("cUdpScheduler::ReSend: missing %d-%d @%d (hdr 0x%llx 0x%x)", - Seq1, Seq1, Pos, udp_ctrl.hdr.pos, udp_ctrl.hdr.seq); + Seq1, Seq1, Pos, + ((stream_udp_header_t *)udp_ctrl)->pos, + ((stream_udp_header_t *)udp_ctrl)->seq); int Seq0 = Seq1; - for(; Seq1 < Seq2; Seq1++) { + for(; Seq1 <= Seq2; Seq1++) { stream_rtp_header_impl_t *frame = m_BackLog->Get(Seq1+1); if(frame && (ntohull(frame->hdr_ext.pos) - Pos < 100000)) break; } - sprintf((char*)udp_ctrl.hdr.payload, + sprintf((udp_ctrl+sizeof(stream_udp_header_t)), "UDP MISSING %d-%d %" PRIu64, Seq0, (Seq1 & UDP_BUFFER_MASK), Pos); - send(fd, &udp_ctrl, sizeof(udp_ctrl), 0); + send(fd, udp_ctrl, sizeof(udp_ctrl), 0); } } diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 46eb173a..61046c8d 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.41.2.11 2009-02-18 21:18:29 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.41.2.10 2009-02-12 12:45:20 phintuka Exp $ * */ @@ -134,7 +134,6 @@ typedef struct sxfe_s { Atom atom_wm_delete_window; Atom atom_sxfe_interrupt; Atom atom_wm_hints, atom_win_layer; - Atom xa_NET_ACTIVE_WINDOW; Atom atom_state, atom_state_add, atom_state_del; Atom atom_state_above, atom_state_fullscreen, atom_state_on_top; @@ -236,7 +235,6 @@ static void set_fullscreen_props(sxfe_t *this) if(this->atom_state == None) { this->atom_win_layer = XInternAtom(this->display, "_WIN_LAYER", False); - this->xa_NET_ACTIVE_WINDOW = XInternAtom(this->display, "_NET_ACTIVE_WINDOW", False); this->atom_state = XInternAtom(this->display, "_NET_WM_STATE", False); this->atom_state_add = XInternAtom(this->display, "_NET_WM_STATE_ADD", False); this->atom_state_del = XInternAtom(this->display, "_NET_WM_STATE_DEL", False); @@ -275,15 +273,6 @@ static void set_fullscreen_props(sxfe_t *this) XSendEvent(this->display, DefaultRootWindow(this->display), False, SubstructureNotifyMask|SubstructureRedirectMask, &ev); XUnlockDisplay(this->display); - - /* _NET_ACTIVE_WINDOW */ - XLockDisplay(this->display); - ev.xclient.message_type = this->xa_NET_ACTIVE_WINDOW; - ev.xclient.data.l[0] = 0; - ev.xclient.data.l[1] = 0; - XSendEvent(this->display, DefaultRootWindow(this->display), False, - SubstructureNotifyMask|SubstructureRedirectMask, &ev); - XUnlockDisplay(this->display); } static void set_border(sxfe_t *this, int border) diff --git a/xineliboutput.c b/xineliboutput.c new file mode 100644 index 00000000..e2eb312e --- /dev/null +++ b/xineliboutput.c @@ -0,0 +1,279 @@ +/* + * vdr-xineliboutput: xine-lib based output device plugin for VDR + * + * Copyright (C) 2003-2008 Petri Hintukainen <phintuka@users.sourceforge.net> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html + * + * + * xineliboutput.c: VDR Plugin interface + * + * $Id: xineliboutput.c,v 1.30.2.4 2009-02-12 10:59:07 phintuka Exp $ + * + */ + +#include <vdr/plugin.h> + +#include "logdefs.h" +#include "i18n.h" +#include "config.h" +#include "device.h" +#include "setup_menu.h" +#include "menu.h" +#include "media_player.h" + +#if VDRVERSNUM < 10400 +# error VDR versions < 1.4.0 are not supported ! +#endif + +//---------------------------------plugin------------------------------------- + +static const char *VERSION = "1.0.4"; +static const char *DESCRIPTION = trNOOP("X11/xine-lib output plugin"); +static const char *MAINMENUENTRY = trNOOP("Media Player"); + +cOsdObject *g_PendingMenuAction = NULL; + +class cPluginXinelibOutput : public cPlugin +{ + private: + // Add any member variables or functions you may need here. + + public: + cPluginXinelibOutput(void); + virtual ~cPluginXinelibOutput(); + + virtual const char *Version(void) { return VERSION; } + virtual const char *Description(void) { return tr(DESCRIPTION); } + virtual const char *CommandLineHelp(void); + + virtual bool ProcessArgs(int argc, char *argv[]); + virtual bool Initialize(void); + virtual bool Start(void); + virtual void Stop(void); + //virtual void Housekeeping(void); + virtual void MainThreadHook(); + //virtual cString Active(void); + //virtual time_t WakeupTime(void); + + virtual const char *MainMenuEntry(void) { return xc.hide_main_menu ? NULL : tr(MAINMENUENTRY); } + virtual cOsdObject *MainMenuAction(void); + + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); + + virtual bool Service(const char *Id, void *Data = NULL); + //virtual const char **SVDRPHelpPages(void); + //virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); +}; + +cPluginXinelibOutput::cPluginXinelibOutput(void) +{ + // Initialize any member variables here. + // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL + // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! +} + +cPluginXinelibOutput::~cPluginXinelibOutput() +{ + // Clean up after yourself! + cXinelibDevice::Dispose(); +} + + +const char cmdLineHelp[] = +" -l NAME --local=NAME Use local frontend NAME\n" +" Supported frontends:\n" +" sxfe (X11)\n" +" fbfe (framebuffer)\n" +" none (only remote frontends)\n" +" -r PORT --remote=PORT Listen PORT for remote clients\n" +" (default "LISTEN_PORT_S")\n" +" none or 0 disables remote mode\n" +" Also local interface address can be specified:\n" +" --remote=<ip>:<port> (default is all interfaces)\n" +" -A NAME --audio=NAME Use audio driver NAME for local frontend\n" +" Supported values:\n" +" auto, alsa, oss, esound, none\n" +" -V NAME --video=NAME Use video driver NAME for local frontend\n" +" Supported values:\n" +" for sxfe: auto, x11, xshm, xv, xvmc, xxmc,\n" +" vidix, sdl, opengl, none\n" +" for fbfe: auto, fb, DirectFB, vidixfb,\n" +" sdl, dxr3, aadxr3, none\n" +#if 0 +" -m M --modeline=M Use modeline M for local frontend\n" +" (example: )\n" +#endif +" -f --fullscreen Fullscreen mode (X11)\n" +#ifdef HAVE_XRENDER +" -D --hud Head Up Display OSD (X11)\n" +#endif +" -w --width=x Window width\n" +" -h --height=x Window width\n" +" -d DISP --display=DISP Use X11 display DISP\n" +" (or framebuffer device name)\n" +" -P NAME --post=NAME Use xine post plugin NAME\n" +" format: pluginname[:arg=val[,arg=val]][,...]\n" +" example: \n" +" --post=upmix;tvtime:enabled=1,cheap_mode=1\n" +" -p --primary Force xineliboutput to be primary device when\n" +" there are active frontend(s)\n" +" -c --exit-on-close Exit vdr when local frontend window is closed\n" +; + +const char *cPluginXinelibOutput::CommandLineHelp(void) +{ + // Return a string that describes all known command line options. + return cmdLineHelp; +} + +bool cPluginXinelibOutput::ProcessArgs(int argc, char *argv[]) +{ + // Implement command line argument processing here if applicable. + return xc.ProcessArgs(argc, argv); +} + +bool cPluginXinelibOutput::Initialize(void) +{ + // Initialize any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Initialize"); + +#if VDRVERSNUM < 10507 + RegisterI18n(Phrases); +#endif + + cXinelibDevice::Instance(); + return true; +} + +bool cPluginXinelibOutput::Start(void) +{ + // Start any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Start"); + return cXinelibDevice::Instance().StartDevice(); +} + +void cPluginXinelibOutput::MainThreadHook(void) +{ + TRACEF("cPluginXinelibOutput::MainThreadHook"); + return cXinelibDevice::Instance().MainThreadHook(); +} + +void cPluginXinelibOutput::Stop(void) +{ + // Start any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Stop"); + return cXinelibDevice::Instance().StopDevice(); +} + +cOsdObject *cPluginXinelibOutput::MainMenuAction(void) +{ + // Perform the action when selected from the main VDR menu. + TRACEF("cPluginXinelibOutput::MainMenuAction"); + + if(xc.main_menu_mode == CloseOsd) { + xc.main_menu_mode = ShowMenu; + return NULL; + } + + if(g_PendingMenuAction) { + cOsdObject *tmp = g_PendingMenuAction; + g_PendingMenuAction = NULL; + return tmp; + } + + if(xc.hide_main_menu) + return NULL; + +#ifdef HAVE_XV_FIELD_ORDER + xc.field_order = xc.field_order ? 0 : 1; + cXinelibDevice::Instance().ConfigureWindow(xc.fullscreen, xc.width, xc.height, + xc.modeswitch, xc.modeline, xc.display_aspect, + xc.scale_video, xc.field_order); +#endif + return new cMenuXinelib(); +} + +cMenuSetupPage *cPluginXinelibOutput::SetupMenu(void) +{ + // Return a setup menu in case the plugin supports one. + TRACEF("cPluginXinelibOutput::SetupMenu"); + return new cMenuSetupXinelib(); +} + +bool cPluginXinelibOutput::SetupParse(const char *Name, const char *Value) +{ + // Parse your own setup parameters and store their values. + return xc.SetupParse(Name, Value); +} + +bool cPluginXinelibOutput::Service(const char *Id, void *Data) +{ + if(Id) { + char *CData = (char*)Data; + + if(!strcmp(Id, "MediaPlayer-1.0")) { + if(CData && *CData) { + LOGMSG("Service(%s, %s)", Id, CData); + cControl::Launch(new cXinelibPlayerControl(ShowFiles, CData)); + return true; + } + LOGMSG("Service(%s) -> true", Id); + return true; + } + + else if(!strcmp(Id, "MusicPlayer-1.0")) { + if(CData && *CData) { + LOGMSG("Service(%s, %s)", Id, CData); + cControl::Launch(new cXinelibPlayerControl(ShowMusic, CData)); + return true; + } + LOGMSG("Service(%s) -> true", Id); + return true; + } + + else if(!strcmp(Id, "DvdPlayer-1.0")) { + if(Data && *CData) { + LOGMSG("Service(%s, %s)", Id, CData); + cControl::Launch(new cXinelibDvdPlayerControl(CData)); + return true; + } + LOGMSG("Service(%s) -> true", Id); + return true; + } + + else if(!strcmp(Id, "ImagePlayer-1.0")) { + if(CData && *CData) { + LOGMSG("Service(%s, %s)", Id, CData); + char **list = new char*[2]; + list[0] = strdup(CData); + list[1] = NULL; + cControl::Launch(new cXinelibImagesControl(list, 0, 1)); + return true; + } + LOGMSG("Service(%s) -> true", Id); + return true; + } + + } + return false; +} + +extern "C" +void *VDRPluginCreator(void) __attribute__((visibility("default"))); + +VDRPLUGINCREATOR(cPluginXinelibOutput); // Don't touch this! |