enum CodecID codec_id;
snd_pcm_sw_params_t *sw_params;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->sample_rate > 0)
- s->sample_rate = ap->sample_rate;
-
- if (ap->channels > 0)
- s->channels = ap->channels;
-#endif
-
st = av_new_stream(s1, 0);
if (!st) {
av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
AVRational framerate;
int ret = 0;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->standard) {
- if (!strcasecmp(ap->standard, "pal"))
- s->standard = PAL;
- else if (!strcasecmp(ap->standard, "secam"))
- s->standard = SECAM;
- else if (!strcasecmp(ap->standard, "ntsc"))
- s->standard = NTSC;
- }
-#endif
-
if ((ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
goto out;
av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
goto out;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- width = ap->width;
- if (ap->height > 0)
- height = ap->height;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
st = av_new_stream(s1, 0);
if (!st) {
if (!dv->dv_demux)
goto failed;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->standard) {
- if (!strcasecmp(ap->standard, "pal"))
- dv->format = DV1394_PAL;
- else
- dv->format = DV1394_NTSC;
- }
-
- if (ap->channel)
- dv->channel = ap->channel;
-#endif
-
/* Open and initialize DV1394 device */
dv->fd = open(context->filename, O_RDONLY);
if (dv->fd < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
return ret;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->time_base.num)
- fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
if (!(st = av_new_stream(avctx, 0)))
return AVERROR(ENOMEM);
av_log(c, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", dc1394->framerate);
goto out;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- width = ap->width;
- if (ap->height > 0)
- height = ap->height;
- if (ap->pix_fmt)
- pix_fmt = ap->pix_fmt;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den);
for (fmt = dc1394_frame_formats; fmt->width; fmt++)
if (dc1394_read_common(c,ap,&fmt,&fps) != 0)
return -1;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->channel)
- dc1394->channel = ap->channel;
-#endif
-
/* Now let us prep the hardware. */
dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
if (!dc1394->handle) {
AVStream *st;
int ret;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->sample_rate > 0)
- s->sample_rate = ap->sample_rate;
- if (ap->channels > 0)
- s->channels = ap->channels;
-#endif
-
st = av_new_stream(s1, 0);
if (!st) {
return AVERROR(ENOMEM);
AVStream *st;
int ret;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->sample_rate > 0)
- s->sample_rate = ap->sample_rate;
- if (ap->channels > 0)
- s->channels = ap->channels;
-#endif
-
st = av_new_stream(s1, 0);
if (!st)
return AVERROR(ENOMEM);
/* set tv standard */
if (!ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
-#if FF_API_FORMAT_PARAMETERS
- if (ap->standard) {
- if (!strcasecmp(ap->standard, "pal"))
- s->standard = VIDEO_MODE_PAL;
- else if (!strcasecmp(ap->standard, "secam"))
- s->standard = VIDEO_MODE_SECAM;
- else
- s->standard = VIDEO_MODE_NTSC;
- }
-#endif
tuner.mode = s->standard;
ioctl(video_fd, VIDIOCSTUNER, &tuner);
}
av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
return ret;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->channel > 0)
- s->channel = ap->channel;
- if (ap->time_base.num)
- framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
/* set tv video input */
memset (&input, 0, sizeof (input));
return AVERROR(EIO);
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->standard) {
- av_freep(&s->standard);
- s->standard = av_strdup(ap->standard);
- }
-#endif
-
if (s->standard) {
av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n",
s->standard);
res = AVERROR(EINVAL);
goto out;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- s->width = ap->width;
- if (ap->height > 0)
- s->height = ap->height;
- if (ap->pix_fmt)
- pix_fmt = ap->pix_fmt;
-#endif
capabilities = 0;
s->fd = device_open(s1, &capabilities);
return AVERROR(EIO);
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->time_base.num)
- framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
-
ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
if(!ctx->hwnd) {
av_log(s, AV_LOG_ERROR, "Could not create capture window.\n");
goto fail_bi;
}
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- bi->bmiHeader.biWidth = ap->width;
- if (ap->height > 0)
- bi->bmiHeader.biHeight = ap->height;
-#endif
if (0) {
/* For testing yet unsupported compressions
av_log(s1, AV_LOG_ERROR, "Could not parse framerate: %s.\n", x11grab->framerate);
goto out;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- x11grab->width = ap->width;
- if (ap->height > 0)
- x11grab->height = ap->height;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d height: %d\n",
s1->filename, param, x_off, y_off, x11grab->width, x11grab->height);
av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
return ret;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->pix_fmt != PIX_FMT_NONE)
- pix_fmt = ap->pix_fmt;
- if (ap->width > 0)
- width = ap->width;
- if (ap->height > 0)
- height = ap->height;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
#if FF_API_LOOP_INPUT
if (s1->loop_input)
int len;
int64_t pos;
-#if FF_API_FORMAT_PARAMETERS
- if (ap) {
- if (ap->mpeg2ts_compute_pcr)
- ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr;
- }
-#endif
-
/* read the first 1024 bytes to get packet size */
pos = avio_tell(pb);
len = avio_read(pb, buf, sizeof(buf));
case AVMEDIA_TYPE_AUDIO: {
RawAudioDemuxerContext *s1 = s->priv_data;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->sample_rate)
- st->codec->sample_rate = ap->sample_rate;
- if (ap->channels)
- st->codec->channels = ap->channels;
- else st->codec->channels = 1;
-#endif
+ st->codec->channels = 1;
if (s1->sample_rate)
st->codec->sample_rate = s1->sample_rate;
av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
goto fail;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- width = ap->width;
- if (ap->height > 0)
- height = ap->height;
- if (ap->pix_fmt)
- pix_fmt = ap->pix_fmt;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
av_set_pts_info(st, 64, framerate.den, framerate.num);
st->codec->width = width;
st->codec->height = height;
av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
goto fail;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
st->codec->time_base = (AVRational){framerate.den, framerate.num};
av_set_pts_info(st, 64, 1, 1200000);
return AVERROR(ENOMEM);
rt->real_setup = rt->real_setup_cache + s->nb_streams;
-#if FF_API_FORMAT_PARAMETERS
- if (ap->initial_pause)
- rt->initial_pause = ap->initial_pause;
-#endif
-
if (rt->initial_pause) {
/* do not start immediately */
} else {
av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
goto fail;
}
-#if FF_API_FORMAT_PARAMETERS
- if (ap->width > 0)
- width = ap->width;
- if (ap->height > 0)
- height = ap->height;
- if (ap->time_base.num)
- framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
st->codec->width = width;
st->codec->height = height;
av_set_pts_info(st, 60, framerate.den, framerate.num);
/* simulate tty display speed */
-#if FF_API_FORMAT_PARAMETERS
- if (ap->sample_rate)
- s->chars_per_frame = ap->sample_rate;
-#endif
s->chars_per_frame = FFMAX(av_q2d(st->time_base)*s->chars_per_frame, 1);
if (avctx->pb->seekable) {