|
|
@ -447,6 +447,7 @@ static int init_convert_timestamp(AVFormatContext *ctx, int64_t ts) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) |
|
|
|
#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) |
|
|
|
|
|
|
|
if (ctx->streams[0]->avg_frame_rate.num) { |
|
|
|
now = av_gettime_monotonic(); |
|
|
|
now = av_gettime_monotonic(); |
|
|
|
if (s->ts_mode == V4L_TS_MONO2ABS || |
|
|
|
if (s->ts_mode == V4L_TS_MONO2ABS || |
|
|
|
(ts <= now + 1 * AV_TIME_BASE && ts >= now - 10 * AV_TIME_BASE)) { |
|
|
|
(ts <= now + 1 * AV_TIME_BASE && ts >= now - 10 * AV_TIME_BASE)) { |
|
|
@ -460,6 +461,7 @@ static int init_convert_timestamp(AVFormatContext *ctx, int64_t ts) |
|
|
|
s->ts_mode = V4L_TS_CONVERT_READY; |
|
|
|
s->ts_mode = V4L_TS_CONVERT_READY; |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
av_log(ctx, AV_LOG_ERROR, "Unknown timestamps\n"); |
|
|
|
av_log(ctx, AV_LOG_ERROR, "Unknown timestamps\n"); |
|
|
|
return AVERROR(EIO); |
|
|
|
return AVERROR(EIO); |
|
|
@ -949,6 +951,7 @@ static int v4l2_read_header(AVFormatContext *s1) |
|
|
|
st->codec->codec_tag = MKTAG('Y', 'V', 'U', '9'); |
|
|
|
st->codec->codec_tag = MKTAG('Y', 'V', 'U', '9'); |
|
|
|
st->codec->width = s->width; |
|
|
|
st->codec->width = s->width; |
|
|
|
st->codec->height = s->height; |
|
|
|
st->codec->height = s->height; |
|
|
|
|
|
|
|
if (st->avg_frame_rate.den) |
|
|
|
st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8; |
|
|
|
st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8; |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|