summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-26 09:44:20 +0000
committerben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-26 09:44:20 +0000
commitdd0c5220f68a63e34bfac0095ff76e49f3354aab (patch)
treebf054a13b697fd8cae3248410d22795ebc45a268
parent000c89175c7792954da48402908e8d523b564743 (diff)
downloadmpv-dd0c5220f68a63e34bfac0095ff76e49f3354aab.tar.bz2
mpv-dd0c5220f68a63e34bfac0095ff76e49f3354aab.tar.xz
extended slave mode with metadata retrieval commands
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19539 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--input/input.c14
-rw-r--r--input/input.h14
-rw-r--r--mplayer.c95
3 files changed, 123 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c
index 692c470c33..931526d993 100644
--- a/input/input.c
+++ b/input/input.c
@@ -85,6 +85,20 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_GET_PERCENT_POS, "get_percent_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_TIME_POS, "get_time_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } },
+ { MP_CMD_GET_FILENAME, "get_file_name", 0, { {-1,{0}} } },
+ { MP_CMD_GET_VIDEO_CODEC, "get_video_codec", 0, { {-1,{0}} } },
+ { MP_CMD_GET_VIDEO_BITRATE, "get_video_bitrate", 0, { {-1,{0}} } },
+ { MP_CMD_GET_VIDEO_RESOLUTION, "get_video_resolution", 0, { {-1,{0}} } },
+ { MP_CMD_GET_AUDIO_CODEC, "get_audio_codec", 0, { {-1,{0}} } },
+ { MP_CMD_GET_AUDIO_BITRATE, "get_audio_bitrate", 0, { {-1,{0}} } },
+ { MP_CMD_GET_AUDIO_SAMPLES, "get_audio_samples", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_TITLE, "get_meta_title", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_ARTIST, "get_meta_artist", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_ALBUM, "get_meta_album", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_YEAR, "get_meta_year", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_COMMENT, "get_meta_comment", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_TRACK, "get_meta_track", 0, { {-1,{0}} } },
+ { MP_CMD_GET_META_GENRE, "get_meta_genre", 0, { {-1,{0}} } },
{ MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
#ifdef USE_TV
{ MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }},
diff --git a/input/input.h b/input/input.h
index f2251e4b98..53072ceff7 100644
--- a/input/input.h
+++ b/input/input.h
@@ -72,6 +72,20 @@
#define MP_CMD_OSD_SHOW_PROPERTY_TEXT 70
#define MP_CMD_SEEK_CHAPTER 71
#define MP_CMD_FILE_FILTER 72
+#define MP_CMD_GET_FILENAME 73
+#define MP_CMD_GET_VIDEO_CODEC 74
+#define MP_CMD_GET_VIDEO_BITRATE 75
+#define MP_CMD_GET_VIDEO_RESOLUTION 76
+#define MP_CMD_GET_AUDIO_CODEC 77
+#define MP_CMD_GET_AUDIO_BITRATE 78
+#define MP_CMD_GET_AUDIO_SAMPLES 79
+#define MP_CMD_GET_META_TITLE 80
+#define MP_CMD_GET_META_ARTIST 81
+#define MP_CMD_GET_META_ALBUM 82
+#define MP_CMD_GET_META_YEAR 83
+#define MP_CMD_GET_META_COMMENT 84
+#define MP_CMD_GET_META_TRACK 85
+#define MP_CMD_GET_META_GENRE 86
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001
diff --git a/mplayer.c b/mplayer.c
index 4c615028a4..72c85ccc97 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -4942,6 +4942,101 @@ if(step_sec>0) {
mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer));
} break;
+ case MP_CMD_GET_FILENAME : {
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_FILENAME='%s'\n", get_metadata (META_NAME));
+ } break;
+
+ case MP_CMD_GET_VIDEO_CODEC : {
+ char *inf = get_metadata (META_VIDEO_CODEC);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VIDEO_CODEC='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_VIDEO_BITRATE : {
+ char *inf = get_metadata (META_VIDEO_BITRATE);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VIDEO_BITRATE='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_VIDEO_RESOLUTION : {
+ char *inf = get_metadata (META_VIDEO_RESOLUTION);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VIDEO_RESOLUTION='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_AUDIO_CODEC : {
+ char *inf = get_metadata (META_AUDIO_CODEC);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_AUDIO_CODEC='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_AUDIO_BITRATE : {
+ char *inf = get_metadata (META_AUDIO_BITRATE);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_AUDIO_BITRATE='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_AUDIO_SAMPLES : {
+ char *inf = get_metadata (META_AUDIO_SAMPLES);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_AUDIO_SAMPLES='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_TITLE : {
+ char *inf = get_metadata (META_INFO_TITLE);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_TITLE='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_ARTIST : {
+ char *inf = get_metadata (META_INFO_ARTIST);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_ARTIST='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_ALBUM : {
+ char *inf = get_metadata (META_INFO_ALBUM);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_ALBUM='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_YEAR : {
+ char *inf = get_metadata (META_INFO_YEAR);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_YEAR='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_COMMENT : {
+ char *inf = get_metadata (META_INFO_COMMENT);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_COMMENT='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_TRACK : {
+ char *inf = get_metadata (META_INFO_TRACK);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_TRACK='%s'\n", inf);
+ free (inf);
+ } break;
+
+ case MP_CMD_GET_META_GENRE : {
+ char *inf = get_metadata (META_INFO_GENRE);
+ if (!inf) inf = strdup ("");
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_META_GENRE='%s'\n", inf);
+ free (inf);
+ } break;
+
case MP_CMD_GET_VO_FULLSCREEN : {
if(video_out && vo_config_count)
mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs);