1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 10:51:51 +00:00

new slave mode command to show text via osd, patch by Lars Gemeinhardt <lars.gemeinhardt at searchbroker.de> (reviewed by albeu)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10117 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
faust3 2003-05-17 09:21:21 +00:00
parent cdf1feb301
commit 0e82afdab5
3 changed files with 16 additions and 0 deletions

View File

@ -59,6 +59,7 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_SUB_DELAY, "sub_delay",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_SUB_STEP, "sub_step",1, { { MP_CMD_ARG_INT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_OSD, "osd",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_OSD_SHOW_TEXT, "osd_show_text", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
{ MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_INT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } },
{ MP_CMD_MUTE, "mute", 0, { {-1,{0}} } },

View File

@ -42,6 +42,7 @@
#endif
#define MP_CMD_SUB_ALIGNMENT 39
#define MP_CMD_TV_LAST_CHANNEL 40
#define MP_CMD_OSD_SHOW_TEXT 41
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001

View File

@ -717,6 +717,7 @@ int eof=0;
int osd_function=OSD_PLAY;
int osd_last_pts=-303;
int osd_show_av_delay = 0;
int osd_show_text = 0;
int osd_show_sub_delay = 0;
int osd_show_sub_pos = 0;
int osd_show_sub_visibility = 0;
@ -1727,6 +1728,7 @@ float time_frame=0; // Timer
//float num_frames=0; // number of frames played
int grab_frames=0;
char osd_text_buffer[64];
char osd_show_text_buffer[64];
int drop_frame=0; // current dropping status
int dropped_frames=0; // how many frames dropped since last non-dropped frame
int too_slow_frame_cnt=0;
@ -2492,6 +2494,14 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
else
osd_level= v > MAX_OSD_LEVEL ? MAX_OSD_LEVEL : v;
} break;
case MP_CMD_OSD_SHOW_TEXT : {
#ifdef USE_OSD
if(osd_level && sh_video){
osd_show_text=sh_video->fps; // 1 sec
strncpy(osd_show_text_buffer, cmd->args[0].v.s, 64);
}
#endif
} break;
case MP_CMD_VOLUME : {
int v = cmd->args[0].v.i;
@ -3263,6 +3273,10 @@ if(rel_seek_secs || abs_seek_pos){
osd_show_tv_channel--;
} else
#endif
if (osd_show_text) {
snprintf(osd_text_tmp, 63, "%s", osd_show_text_buffer);
osd_show_text--;
} else
if (osd_show_sub_visibility) {
snprintf(osd_text_tmp, 63, "Subtitles: %sabled", sub_visibility?"en":"dis");
osd_show_sub_visibility--;