static int v4l2_prepare_contexts(V4L2m2mContext* s, int probe)
{
struct v4l2_capability cap;
- void *log_ctx = s->priv;
+ void *log_ctx = s->avctx;
int ret;
s->capture.done = s->output.done = 0;
static int v4l2_probe_driver(V4L2m2mContext* s)
{
- void *log_ctx = s->priv;
+ void *log_ctx = s->avctx;
int ret;
s->fd = open(s->devname, O_RDWR | O_NONBLOCK, 0);
static int v4l2_configure_contexts(V4L2m2mContext* s)
{
- void *log_ctx = s->priv;
+ void *log_ctx = s->avctx;
int ret;
struct v4l2_format ofmt, cfmt;
******************************************************************************/
int ff_v4l2_m2m_codec_reinit(V4L2m2mContext* s)
{
- void *log_ctx = s->priv;
+ void *log_ctx = s->avctx;
int ret;
av_log(log_ctx, AV_LOG_DEBUG, "reinit context\n");
ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);
if (ret)
- av_log(priv, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->output.name);
+ av_log(s->avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->output.name);
ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF);
if (ret)
- av_log(priv, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->capture.name);
+ av_log(s->avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->capture.name);
ff_v4l2_context_release(&s->output);
continue;
snprintf(node, sizeof(node), "/dev/%s", entry->d_name);
- av_log(priv, AV_LOG_DEBUG, "probing device %s\n", node);
+ av_log(s->avctx, AV_LOG_DEBUG, "probing device %s\n", node);
strncpy(s->devname, node, strlen(node) + 1);
ret = v4l2_probe_driver(s);
if (!ret)
closedir(dirp);
if (ret) {
- av_log(priv, AV_LOG_ERROR, "Could not find a valid device\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Could not find a valid device\n");
memset(s->devname, 0, sizeof(s->devname));
return ret;
}
- av_log(priv, AV_LOG_INFO, "Using device %s\n", node);
+ av_log(s->avctx, AV_LOG_INFO, "Using device %s\n", node);
return v4l2_configure_contexts(s);
}