From 7059c15f4af047d29bed9ea8b17a3702980b8442 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Aug 2012 22:47:56 +0200 Subject: mplayer: rip out --capture support While this was an interesting idea, it wasn't actually useful. Basically it dumped the raw data (as requested by the demuxer) into a file. The result is only useful if the file format was raw or maybe some MPEG packet stream, but not with most modern file formats. --- DOCS/man/en/options.rst | 14 -------------- cfg-mplayer.h | 5 ----- command.c | 38 -------------------------------------- input/input.c | 1 - input/input.h | 1 - options.h | 2 -- stream/cache2.c | 2 -- stream/stream.c | 16 ---------------- stream/stream.h | 2 -- 9 files changed, 81 deletions(-) diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index 1fd96565a4..be4bd2ecdd 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -289,16 +289,6 @@ filled to this position rather than performing a stream seek (default: 50). ---capture - Allows capturing the primary stream (not additional audio tracks or other - kind of streams) into the file specified by ``--dumpfile`` or by default. - If this option is given, capturing can be started and stopped by pressing - the key bound to this function (see section `INTERACTIVE CONTROL`_). Same - as for ``--dumpstream``, this will likely not produce usable results for - anything else than MPEG streams. Note that, due to cache latencies, - captured data may begin and end somewhat delayed compared to what you see - displayed. - --cdda= This option can be used to tune the CD Audio reading feature of MPlayer. @@ -514,10 +504,6 @@ double-click (default: 300). Set to 0 to let your windowing system decide what a double-click is (``--vo=directx`` only). ---dumpfile= - Specify which file MPlayer should dump to. Should be used together with - ``--dumpaudio`` / ``--dumpvideo`` / ``--dumpstream`` / ``--capture``. - --dvbin= Pass the following parameters to the DVB input module, in order to override the default ones: diff --git a/cfg-mplayer.h b/cfg-mplayer.h index fd90d19b3f..bce30e12b1 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -750,11 +750,6 @@ const m_option_t mplayer_opts[]={ OPT_FLAG_ON("untimed", untimed, 0), - // dump some stream out instead of playing the file - OPT_STRING("dumpfile", stream_dump_name, 0, OPTDEF_STR("stream.dump")), - - OPT_MAKE_FLAGS("capture", capture_dump, 0), - #ifdef CONFIG_LIRC {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif diff --git a/command.c b/command.c index 6f44aecf47..fb40a0b60f 100644 --- a/command.c +++ b/command.c @@ -1240,40 +1240,6 @@ static int mp_property_colormatrix_output_range(m_option_t *prop, int action, prop, action, arg, mpctx); } -static int mp_property_capture(m_option_t *prop, int action, - void *arg, MPContext *mpctx) -{ - struct MPOpts *opts = &mpctx->opts; - - if (!mpctx->stream) - return M_PROPERTY_UNAVAILABLE; - - if (!opts->capture_dump) { - mp_tmsg(MSGT_GLOBAL, MSGL_ERR, - "Capturing not enabled (forgot -capture parameter?)\n"); - return M_PROPERTY_ERROR; - } - - int capturing = !!mpctx->stream->capture_file; - - int ret = m_property_flag(prop, action, arg, &capturing); - if (ret == M_PROPERTY_OK && capturing != !!mpctx->stream->capture_file) { - if (capturing) { - mpctx->stream->capture_file = fopen(opts->stream_dump_name, "wb"); - if (!mpctx->stream->capture_file) { - mp_tmsg(MSGT_GLOBAL, MSGL_ERR, - "Error opening capture file: %s\n", strerror(errno)); - ret = M_PROPERTY_ERROR; - } - } else { - fclose(mpctx->stream->capture_file); - mpctx->stream->capture_file = NULL; - } - } - - return ret; -} - /// Panscan (RW) static int mp_property_panscan(m_option_t *prop, int action, void *arg, MPContext *mpctx) @@ -2272,8 +2238,6 @@ static const m_option_t mp_properties[] = { 0, 0, 0, NULL }, { "pause", mp_property_pause, CONF_TYPE_FLAG, M_OPT_RANGE, 0, 1, NULL }, - { "capturing", mp_property_capture, CONF_TYPE_FLAG, - M_OPT_RANGE, 0, 1, NULL }, { "pts_association_mode", mp_property_generic_option, &m_option_type_choice, 0, 0, 0, "pts-association-mode" }, { "hr_seek", mp_property_generic_option, &m_option_type_choice, @@ -2454,7 +2418,6 @@ static struct property_osd_display { // general { "loop", 0, -1, _("Loop: %s") }, { "chapter", -1, -1, NULL }, - { "capturing", 0, -1, _("Capturing: %s") }, { "pts_association_mode", 0, -1, "PTS association mode: %s" }, { "hr_seek", 0, -1, "hr-seek: %s" }, { "speed", 0, -1, _("Speed: x %6s") }, @@ -2585,7 +2548,6 @@ static struct { { "chapter", MP_CMD_SEEK_CHAPTER, 0}, { "angle", MP_CMD_SWITCH_ANGLE, 0}, { "pause", MP_CMD_PAUSE, 0}, - { "capturing", MP_CMD_CAPTURING, 1}, // audio { "volume", MP_CMD_VOLUME, 0}, { "mute", MP_CMD_MUTE, 1}, diff --git a/input/input.c b/input/input.c index b1c7f1264e..ed33c83c34 100644 --- a/input/input.c +++ b/input/input.c @@ -195,7 +195,6 @@ static const mp_cmd_t mp_cmds[] = { { MP_CMD_LOADLIST, "loadlist", { ARG_STRING, OARG_INT(0) } }, { MP_CMD_PLAYLIST_CLEAR, "playlist_clear", }, { MP_CMD_RUN, "run", { ARG_STRING } }, - { MP_CMD_CAPTURING, "capturing", }, { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", { ARG_INT, ARG_INT } }, { MP_CMD_TV_TELETEXT_ADD_DEC, "teletext_add_dec", { ARG_STRING } }, { MP_CMD_TV_TELETEXT_GO_LINK, "teletext_go_link", { ARG_INT } }, diff --git a/input/input.h b/input/input.h index 9092e2226d..5b1bb37209 100644 --- a/input/input.h +++ b/input/input.h @@ -42,7 +42,6 @@ enum mp_command_type { MP_CMD_TV_STEP_CHANNEL, MP_CMD_TV_STEP_NORM, MP_CMD_TV_STEP_CHANNEL_LIST, - MP_CMD_CAPTURING, MP_CMD_VO_FULLSCREEN, MP_CMD_SUB_POS, MP_CMD_DVDNAV, diff --git a/options.h b/options.h index 53afe4d805..f87ee16669 100644 --- a/options.h +++ b/options.h @@ -43,8 +43,6 @@ typedef struct MPOpts { char *vobsub_name; int auto_quality; int untimed; - char *stream_dump_name; - int capture_dump; int loop_times; int ordered_chapters; int chapter_merge_threshold; diff --git a/stream/cache2.c b/stream/cache2.c index 47bc76a4f9..4fb663aca6 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -527,8 +527,6 @@ int cache_stream_fill_buffer(stream_t *s){ s->buf_len=len; s->pos+=len; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) - stream_capture_do(s); return len; } diff --git a/stream/stream.c b/stream/stream.c index c4b36dc436..5a0aa7d7dd 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -262,16 +262,6 @@ stream_t *open_output_stream(const char *filename, struct MPOpts *options) //=================== STREAMER ========================= -void stream_capture_do(stream_t *s) -{ - if (fwrite(s->buffer, s->buf_len, 1, s->capture_file) < 1) { - mp_tmsg(MSGT_GLOBAL, MSGL_ERR, "Error writing capture file: %s\n", - strerror(errno)); - fclose(s->capture_file); - s->capture_file = NULL; - } -} - int stream_read_internal(stream_t *s, void *buf, int len) { int orig_len = len; @@ -339,8 +329,6 @@ int stream_fill_buffer(stream_t *s){ s->buf_pos=0; s->buf_len=len; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) - stream_capture_do(s); return len; } @@ -520,10 +508,6 @@ void free_stream(stream_t *s){ #ifdef CONFIG_STREAM_CACHE cache_uninit(s); #endif - if (s->capture_file) { - fclose(s->capture_file); - s->capture_file = NULL; - } if(s->close) s->close(s); if(s->fd>0){ diff --git a/stream/stream.h b/stream/stream.h index 828c364d40..0c17f02389 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -172,7 +172,6 @@ typedef struct stream { streaming_ctrl_t *streaming_ctrl; #endif unsigned char buffer[STREAM_BUFFER_SIZE>STREAM_MAX_SECTOR_SIZE?STREAM_BUFFER_SIZE:STREAM_MAX_SECTOR_SIZE]; - FILE *capture_file; } stream_t; #ifdef CONFIG_NETWORKING @@ -181,7 +180,6 @@ typedef struct stream { int stream_fill_buffer(stream_t *s); int stream_seek_long(stream_t *s, off_t pos); -void stream_capture_do(stream_t *s); #ifdef CONFIG_STREAM_CACHE int stream_enable_cache(stream_t *stream,int size,int min,int prefill); -- cgit v1.2.3