summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-25 16:42:14 +0200
committerwm4 <wm4@nowhere>2014-10-25 17:20:17 +0200
commit2c11dd543438c039e68f000654c2a85e2528d456 (patch)
tree081a9c1f6ceab279d54138e419fefbd8fc922e7e /stream
parent3c9f2bef92c1b78cc1a72dad77223eb210109ece (diff)
downloadmpv-2c11dd543438c039e68f000654c2a85e2528d456.tar.bz2
mpv-2c11dd543438c039e68f000654c2a85e2528d456.tar.xz
tv: remove duplicated crap
The logging functions already add a prefix. Original MPlayer devs must have liked code duplication a lot.
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_v4l2.c200
1 files changed, 76 insertions, 124 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 2a2dae76ba..49b680d112 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -464,8 +464,8 @@ static int getfmt(priv_t *priv)
priv->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if ((i = v4l2_ioctl(priv->video_fd, VIDIOC_G_FMT, &priv->format)) < 0) {
- MP_ERR(priv, "%s: ioctl get format failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get format failed: %s\n",
+ strerror(errno));
}
return i;
}
@@ -484,16 +484,15 @@ static int getstd(priv_t *priv)
parm.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
if(v4l2_ioctl(priv->video_fd, VIDIOC_G_PARM, &parm) >= 0) {
- MP_WARN(priv, "%s: your device driver does not support VIDIOC_G_STD ioctl,"
- " VIDIOC_G_PARM was used instead.\n", info.short_name);
+ MP_WARN(priv, "your device driver does not support VIDIOC_G_STD ioctl,"
+ " VIDIOC_G_PARM was used instead.\n");
priv->standard.index=0;
priv->standard.id=0;
priv->standard.frameperiod=parm.parm.capture.timeperframe;
return 0;
}
- MP_ERR(priv, "%s: ioctl get standard failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get standard failed: %s\n", strerror(errno));
return -1;
}
do {
@@ -543,8 +542,7 @@ static int set_mute(priv_t *priv, int value)
control.id = V4L2_CID_AUDIO_MUTE;
control.value = value;
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_CTRL, &control) < 0) {
- MP_ERR(priv, "%s: ioctl set mute failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set mute failed: %s\n", strerror(errno));
return 0;
}
return 1;
@@ -558,8 +556,7 @@ static int set_control(priv_t *priv, struct v4l2_control *control, int val_signe
struct v4l2_queryctrl qctrl;
qctrl.id = control->id;
if (v4l2_ioctl(priv->video_fd, VIDIOC_QUERYCTRL, &qctrl) < 0) {
- MP_ERR(priv, "%s: ioctl query control failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl query control failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
@@ -583,11 +580,11 @@ static int set_control(priv_t *priv, struct v4l2_control *control, int val_signe
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_CTRL, control) < 0) {
- MP_ERR(priv, "%s: ioctl set %s %d failed: %s\n",
- info.short_name, qctrl.name, control->value, strerror(errno));
+ MP_ERR(priv, "ioctl set %s %d failed: %s\n",
+ qctrl.name, control->value, strerror(errno));
return TVI_CONTROL_FALSE;
}
- MP_VERBOSE(priv, "%s: set %s: %d [%d, %d]\n", info.short_name,
+ MP_VERBOSE(priv, "set %s: %d [%d, %d]\n",
qctrl.name, control->value, qctrl.minimum, qctrl.maximum);
return TVI_CONTROL_TRUE;
@@ -602,17 +599,15 @@ static int get_control(priv_t *priv, struct v4l2_control *control, int val_signe
qctrl.id = control->id;
if (v4l2_ioctl(priv->video_fd, VIDIOC_QUERYCTRL, &qctrl) < 0) {
- MP_ERR(priv, "%s: ioctl query control failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl query control failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_CTRL, control) < 0) {
- MP_ERR(priv, "%s: ioctl get %s failed: %s\n",
- info.short_name, qctrl.name, strerror(errno));
+ MP_ERR(priv, "ioctl get %s failed: %s\n", qctrl.name, strerror(errno));
return TVI_CONTROL_FALSE;
}
- MP_VERBOSE(priv, "%s: get %s: %d [%d, %d]\n", info.short_name,
+ MP_VERBOSE(priv, "get %s: %d [%d, %d]\n",
qctrl.name, control->value, qctrl.minimum, qctrl.maximum);
if (val_signed) {
@@ -656,20 +651,18 @@ static int do_control(priv_t *priv, int cmd, void *arg)
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_GET_FPS:
*(float *)arg = getfps(priv);
- MP_VERBOSE(priv, "%s: get fps: %f\n", info.short_name,
- *(float *)arg);
+ MP_VERBOSE(priv, "get fps: %f\n", *(float *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_GET_BITS:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
*(int *)arg = pixfmt2depth(priv->format.fmt.pix.pixelformat);
- MP_VERBOSE(priv, "%s: get depth: %d\n", info.short_name,
- *(int *)arg);
+ MP_VERBOSE(priv, "get depth: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_GET_FORMAT:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
*(int *)arg = fcc_vl2mp(priv->format.fmt.pix.pixelformat);
- MP_VERBOSE(priv, "%s: get format: %s\n", info.short_name,
- pixfmt2name(buf, priv->format.fmt.pix.pixelformat));
+ MP_VERBOSE(priv, "get format: %s\n",
+ pixfmt2name(buf, priv->format.fmt.pix.pixelformat));
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_SET_FORMAT:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
@@ -677,11 +670,10 @@ static int do_control(priv_t *priv, int cmd, void *arg)
priv->format.fmt.pix.field = V4L2_FIELD_ANY;
priv->mp_format = *(int *)arg;
- MP_VERBOSE(priv, "%s: set format: %s\n", info.short_name,
+ MP_VERBOSE(priv, "set format: %s\n",
pixfmt2name(buf, priv->format.fmt.pix.pixelformat));
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {
- MP_ERR(priv, "%s: ioctl set format failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set format failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
/* according to the v4l2 specs VIDIOC_S_FMT should not fail, inflexible drivers
@@ -691,8 +683,7 @@ static int do_control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_VID_GET_WIDTH:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
*(int *)arg = priv->format.fmt.pix.width;
- MP_VERBOSE(priv, "%s: get width: %d\n", info.short_name,
- *(int *)arg);
+ MP_VERBOSE(priv, "get width: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_CHK_WIDTH:
return TVI_CONTROL_TRUE;
@@ -707,19 +698,16 @@ static int do_control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_VID_SET_WIDTH:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
priv->format.fmt.pix.width = *(int *)arg;
- MP_VERBOSE(priv, "%s: set width: %d\n", info.short_name,
- *(int *)arg);
+ MP_VERBOSE(priv, "set width: %d\n", *(int *)arg);
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {
- MP_ERR(priv, "%s: ioctl set width failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set width failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_GET_HEIGHT:
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
*(int *)arg = priv->format.fmt.pix.height;
- MP_VERBOSE(priv, "%s: get height: %d\n", info.short_name,
- *(int *)arg);
+ MP_VERBOSE(priv, "get height: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_CHK_HEIGHT:
return TVI_CONTROL_TRUE;
@@ -727,11 +715,9 @@ static int do_control(priv_t *priv, int cmd, void *arg)
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
priv->format.fmt.pix.height = *(int *)arg;
priv->format.fmt.pix.field = V4L2_FIELD_ANY;
- MP_VERBOSE(priv, "%s: set height: %d\n", info.short_name,
- *(int *)arg);
+ MP_VERBOSE(priv, "set height: %d\n", *(int *)arg);
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {
- MP_ERR(priv, "%s: ioctl set height failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set height failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
@@ -817,8 +803,7 @@ static int do_control(priv_t *priv, int cmd, void *arg)
frequency.tuner = 0;
frequency.type = V4L2_TUNER_ANALOG_TV;
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_FREQUENCY, &frequency) < 0) {
- MP_ERR(priv, "%s: ioctl get frequency failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get frequency failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
*(int *)arg = frequency.frequency;
@@ -832,8 +817,7 @@ static int do_control(priv_t *priv, int cmd, void *arg)
frequency.type = V4L2_TUNER_ANALOG_TV;
frequency.frequency = *(int *)arg;
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_FREQUENCY, &frequency) < 0) {
- MP_ERR(priv, "%s: ioctl set frequency failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set frequency failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
#if 0
@@ -842,18 +826,16 @@ static int do_control(priv_t *priv, int cmd, void *arg)
#endif
return TVI_CONTROL_TRUE;
case TVI_CONTROL_TUN_GET_TUNER:
- MP_VERBOSE(priv, "%s: get tuner\n",info.short_name);
+ MP_VERBOSE(priv, "get tuner\n");
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) {
- MP_ERR(priv, "%s: ioctl get tuner failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get tuner failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
case TVI_CONTROL_TUN_SET_TUNER:
- MP_VERBOSE(priv, "%s: set tuner\n",info.short_name);
+ MP_VERBOSE(priv, "set tuner\n");
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_TUNER, &priv->tuner) < 0) {
- MP_ERR(priv, "%s: ioctl set tuner failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set tuner failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
@@ -862,8 +844,7 @@ static int do_control(priv_t *priv, int cmd, void *arg)
return TVI_CONTROL_TRUE;
case TVI_CONTROL_TUN_GET_SIGNAL:
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) {
- MP_ERR(priv, "%s: ioctl get tuner failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get tuner failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
*(int*)arg=100*(priv->tuner.signal>>8)/255;
@@ -871,14 +852,12 @@ static int do_control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_TUN_SET_NORM:
priv->standard.index = *(int *)arg;
if (v4l2_ioctl(priv->video_fd, VIDIOC_ENUMSTD, &priv->standard) < 0) {
- MP_ERR(priv, "%s: ioctl enum norm failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl enum norm failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
- MP_VERBOSE(priv, "%s: set norm: %s\n", info.short_name, priv->standard.name);
+ MP_VERBOSE(priv, "set norm: %s\n", priv->standard.name);
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_STD, &priv->standard.id) < 0) {
- MP_ERR(priv, "%s: ioctl set norm failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set norm failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
@@ -900,22 +879,19 @@ static int do_control(priv_t *priv, int cmd, void *arg)
}
case TVI_CONTROL_SPC_GET_INPUT:
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_INPUT, (int *)arg) < 0) {
- MP_ERR(priv, "%s: ioctl get input failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get input failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
case TVI_CONTROL_SPC_SET_INPUT:
- MP_VERBOSE(priv, "%s: set input: %d\n", info.short_name, *(int *)arg);
+ MP_VERBOSE(priv, "set input: %d\n", *(int *)arg);
priv->input.index = *(int *)arg;
if (v4l2_ioctl(priv->video_fd, VIDIOC_ENUMINPUT, &priv->input) < 0) {
- MP_ERR(priv, "%s: ioctl enum input failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl enum input failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_INPUT, (int *)arg) < 0) {
- MP_ERR(priv, "%s: ioctl set input failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set input failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
return TVI_CONTROL_TRUE;
@@ -923,32 +899,28 @@ static int do_control(priv_t *priv, int cmd, void *arg)
init_audio(priv);
if (!priv->audio_initialized) return TVI_CONTROL_FALSE;
*(int *)arg = AF_FORMAT_S16;
- MP_VERBOSE(priv, "%s: get audio format: %d\n",
- info.short_name, *(int *)arg);
+ MP_VERBOSE(priv, "get audio format: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_AUD_GET_SAMPLERATE:
init_audio(priv);
if (!priv->audio_initialized) return TVI_CONTROL_FALSE;
*(int *)arg = priv->audio_in.samplerate;
- MP_VERBOSE(priv, "%s: get audio samplerate: %d\n",
- info.short_name, *(int *)arg);
+ MP_VERBOSE(priv, "get audio samplerate: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_AUD_GET_CHANNELS:
init_audio(priv);
if (!priv->audio_initialized) return TVI_CONTROL_FALSE;
*(int *)arg = priv->audio_in.channels;
- MP_VERBOSE(priv, "%s: get audio channels: %d\n",
- info.short_name, *(int *)arg);
+ MP_VERBOSE(priv, "get audio channels: %d\n", *(int *)arg);
return TVI_CONTROL_TRUE;
case TVI_CONTROL_AUD_SET_SAMPLERATE:
init_audio(priv);
- MP_VERBOSE(priv, "%s: set audio samplerate: %d\n",
- info.short_name, *(int *)arg);
+ MP_VERBOSE(priv, "set audio samplerate: %d\n", *(int *)arg);
if (audio_in_set_samplerate(&priv->audio_in, *(int*)arg) < 0) return TVI_CONTROL_FALSE;
// setup_audio_buffer_sizes(priv);
return TVI_CONTROL_TRUE;
}
- MP_VERBOSE(priv, "%s: unknown control: %d\n", info.short_name, cmd);
+ MP_VERBOSE(priv, "unknown control: %d\n", cmd);
return TVI_CONTROL_UNKNOWN;
}
@@ -999,24 +971,20 @@ static int uninit(priv_t *priv)
pthread_mutex_destroy(&priv->video_buffer_mutex);
if (priv->streamon) {
- struct v4l2_buffer buf;
-
/* get performance */
frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / 1e6 * getfps(priv));
dropped = frames - priv->frames;
/* turn off streaming */
if (v4l2_ioctl(priv->video_fd, VIDIOC_STREAMOFF, &(priv->map[0].buf.type)) < 0) {
- MP_ERR(priv, "%s: ioctl streamoff failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl streamoff failed: %s\n", strerror(errno));
}
priv->streamon = 0;
/* unqueue all remaining buffers (not sure if this code is correct) */
for (i = 0; i < priv->mapcount; i++) {
if (v4l2_ioctl(priv->video_fd, VIDIOC_DQBUF, &priv->map[i].buf) < 0) {
- MP_ERR(priv, "%s: VIDIOC_DQBUF failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "VIDIOC_DQBUF failed: %s\n", strerror(errno));
}
}
}
@@ -1024,8 +992,7 @@ static int uninit(priv_t *priv)
/* unmap all buffers */
for (i = 0; i < priv->mapcount; i++) {
if (v4l2_munmap(priv->map[i].addr, priv->map[i].len) < 0) {
- MP_ERR(priv, "%s: munmap capture buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "munmap capture buffer failed: %s\n", strerror(errno));
}
}
@@ -1059,10 +1026,10 @@ static int uninit(priv_t *priv)
}
/* show some nice statistics ;-) */
- MP_INFO(priv, "%s: %d frames successfully processed, %d frames dropped.\n",
- info.short_name, priv->frames, dropped);
- MP_VERBOSE(priv, "%s: up to %u video frames buffered.\n",
- info.short_name, priv->video_buffer_size_current);
+ MP_INFO(priv, "%d frames successfully processed, %d frames dropped.\n",
+ priv->frames, dropped);
+ MP_VERBOSE(priv, "up to %u video frames buffered.\n",
+ priv->video_buffer_size_current);
return 1;
}
@@ -1081,21 +1048,18 @@ static int init(priv_t *priv)
/* Open the video device. */
priv->video_fd = v4l2_open(priv->video_dev, O_RDWR);
if (priv->video_fd < 0) {
- MP_ERR(priv, "%s: unable to open '%s': %s\n",
- info.short_name, priv->video_dev, strerror(errno));
+ MP_ERR(priv, "unable to open '%s': %s\n", priv->video_dev, strerror(errno));
uninit(priv);
return 0;
}
- MP_DBG(priv, "%s: video fd: %s: %d\n",
- info.short_name, priv->video_dev, priv->video_fd);
+ MP_DBG(priv, "video fd: %s: %d\n", priv->video_dev, priv->video_fd);
/*
** Query the video capabilities and current settings
** for further control calls.
*/
if (v4l2_ioctl(priv->video_fd, VIDIOC_QUERYCAP, &priv->capability) < 0) {
- MP_ERR(priv, "%s: ioctl query capabilities failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl query capabilities failed: %s\n", strerror(errno));
uninit(priv);
return 0;
}
@@ -1118,8 +1082,7 @@ static int init(priv_t *priv)
*/
if (priv->capability.capabilities & V4L2_CAP_TUNER) {
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) {
- MP_ERR(priv, "%s: ioctl get tuner failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get tuner failed: %s\n", strerror(errno));
uninit(priv);
return 0;
}
@@ -1180,8 +1143,7 @@ static int init(priv_t *priv)
}
i = -1;
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_INPUT, &i) < 0) {
- MP_ERR(priv, "%s: ioctl get input failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl get input failed: %s\n", strerror(errno));
}
char buf[80];
MP_INFO(priv, "\n Current input: %d\n", i);
@@ -1205,8 +1167,7 @@ static int init(priv_t *priv)
priv->format.fmt.pix.width = 640;
priv->format.fmt.pix.height = 480;
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) {
- MP_ERR(priv, "%s: ioctl set format failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set format failed: %s\n", strerror(errno));
uninit(priv);
return 0;
}
@@ -1216,15 +1177,14 @@ static int init(priv_t *priv)
if (priv->capability.capabilities & V4L2_CAP_TUNER) {
struct v4l2_control control;
if (priv->tv_param->amode >= 0) {
- MP_VERBOSE(priv, "%s: setting audio mode\n", info.short_name);
+ MP_VERBOSE(priv, "setting audio mode\n");
priv->tuner.audmode = amode2v4l(priv->tv_param->amode);
if (v4l2_ioctl(priv->video_fd, VIDIOC_S_TUNER, &priv->tuner) < 0) {
- MP_ERR(priv, "%s: ioctl set tuner failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl set tuner failed: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
}
- MP_INFO(priv, "%s: current audio mode is :%s%s%s%s\n", info.short_name,
+ MP_INFO(priv, "current audio mode is :%s%s%s%s\n",
(priv->tuner.audmode == V4L2_TUNER_MODE_MONO) ? " MONO" : "",
(priv->tuner.audmode == V4L2_TUNER_MODE_STEREO) ? " STEREO" : "",
(priv->tuner.audmode == V4L2_TUNER_MODE_LANG1) ? " LANG1" : "",
@@ -1368,15 +1328,13 @@ static int start(priv_t *priv)
request.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
request.memory = V4L2_MEMORY_MMAP;
if (v4l2_ioctl(priv->video_fd, VIDIOC_REQBUFS, &request) < 0) {
- MP_ERR(priv, "%s: ioctl request buffers failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl request buffers failed: %s\n", strerror(errno));
return 0;
}
/* query buffers */
if (!(priv->map = calloc(request.count, sizeof(struct map)))) {
- MP_ERR(priv, "%s: malloc capture buffers failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "malloc capture buffers failed: %s\n", strerror(errno));
return 0;
}
@@ -1386,8 +1344,7 @@ static int start(priv_t *priv)
priv->map[i].buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
priv->map[i].buf.memory = V4L2_MEMORY_MMAP;
if (v4l2_ioctl(priv->video_fd, VIDIOC_QUERYBUF, &(priv->map[i].buf)) < 0) {
- MP_ERR(priv, "%s: ioctl query buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl query buffer failed: %s\n", strerror(errno));
free(priv->map);
priv->map = NULL;
return 0;
@@ -1395,8 +1352,7 @@ static int start(priv_t *priv)
priv->map[i].addr = v4l2_mmap (0, priv->map[i].buf.length, PROT_READ |
PROT_WRITE, MAP_SHARED, priv->video_fd, priv->map[i].buf.m.offset);
if (priv->map[i].addr == MAP_FAILED) {
- MP_ERR(priv, "%s: mmap capture buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "mmap capture buffer failed: %s\n", strerror(errno));
priv->map[i].len = 0;
return 0;
}
@@ -1412,8 +1368,7 @@ static int start(priv_t *priv)
priv->mapcount++;
if (v4l2_ioctl(priv->video_fd, VIDIOC_QBUF, &(priv->map[i].buf)) < 0) {
- MP_ERR(priv, "%s: ioctl queue buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl queue buffer failed: %s\n", strerror(errno));
return 0;
}
}
@@ -1465,10 +1420,9 @@ static void *video_grabber(void *data)
prev_interval = 0;
prev_skew = 0;
- MP_VERBOSE(priv, "%s: going to capture\n", info.short_name);
+ MP_VERBOSE(priv, "going to capture\n");
if (v4l2_ioctl(priv->video_fd, VIDIOC_STREAMON, &(priv->format.type)) < 0) {
- MP_ERR(priv, "%s: ioctl streamon failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl streamon failed: %s\n", strerror(errno));
return 0;
}
priv->streamon = 1;
@@ -1498,12 +1452,11 @@ static void *video_grabber(void *data)
i = select(priv->video_fd + 1, &rdset, NULL, NULL, &timeout);
if (i < 0) {
- MP_ERR(priv, "%s: select failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "select failed: %s\n", strerror(errno));
continue;
}
else if (i == 0) {
- MP_ERR(priv, "%s: select timeout\n", info.short_name);
+ MP_ERR(priv, "select timeout\n");
continue;
}
else if (!FD_ISSET(priv->video_fd, &rdset)) {
@@ -1524,8 +1477,8 @@ static void *video_grabber(void *data)
observed with saa7134 0.2.8
don't know if is it a bug or (mis)feature
*/
- MP_ERR(priv, "%s: ioctl dequeue buffer failed: %s, idx = %d\n",
- info.short_name, strerror(errno), buf.index);
+ MP_ERR(priv, "ioctl dequeue buffer failed: %s, idx = %d\n",
+ strerror(errno), buf.index);
for (i = 0; i < priv->mapcount; i++) {
memset(&buf,0,sizeof(buf));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -1533,14 +1486,14 @@ static void *video_grabber(void *data)
buf.index = i;
ret = v4l2_ioctl(priv->video_fd, VIDIOC_QUERYBUF, &buf);
if (ret < 0) {
- MP_ERR(priv, "%s: ioctl query buffer failed: %s, idx = %d\n",
- info.short_name, strerror(errno), buf.index);
+ MP_ERR(priv, "ioctl query buffer failed: %s, idx = %d\n",
+ strerror(errno), buf.index);
return 0;
}
if ((buf.flags & (V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE)) == V4L2_BUF_FLAG_MAPPED) {
if (v4l2_ioctl(priv->video_fd, VIDIOC_QBUF, &(priv->map[i].buf)) < 0) {
- MP_ERR(priv, "%s: ioctl queue buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl queue buffer failed: %s\n",
+ strerror(errno));
return 0;
}
}
@@ -1630,8 +1583,7 @@ static void *video_grabber(void *data)
priv->video_cnt++;
}
if (v4l2_ioctl(priv->video_fd, VIDIOC_QBUF, &buf) < 0) {
- MP_ERR(priv, "%s: ioctl queue buffer failed: %s\n",
- info.short_name, strerror(errno));
+ MP_ERR(priv, "ioctl queue buffer failed: %s\n", strerror(errno));
return 0;
}
}