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.
This commit is contained in:
wm4 2012-08-02 22:47:56 +02:00
parent e48b21dd87
commit 7059c15f4a
9 changed files with 0 additions and 81 deletions

View File

@ -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=<option1:option2>
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=<filename>
Specify which file MPlayer should dump to. Should be used together with
``--dumpaudio`` / ``--dumpvideo`` / ``--dumpstream`` / ``--capture``.
--dvbin=<options>
Pass the following parameters to the DVB input module, in order to
override the default ones:

View File

@ -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

View File

@ -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},

View File

@ -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 } },

View File

@ -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,

View File

@ -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;

View File

@ -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;
}

View File

@ -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){

View File

@ -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);