[FFmpeg-devel] [PATCH] Add android_capture indev

Michael Niedermayer michael at niedermayer.cc
Thu Nov 30 15:48:33 EET 2017


On Thu, Nov 30, 2017 at 10:12:53AM +0100, Felix Matouschek wrote:
> Am 29.11.2017 04:31, schrieb Michael Niedermayer:
> 
> >if the identifer and the string always match you could do this
> >with a macro avoiding the neede to duplcate each string
> >see AV_STRINGIFY
> 
> I changed it, is it ok like this?
> 
> >[...]
> >>+static int add_video_stream(AVFormatContext *avctx)
> >>+{
> >>+    AndroidCameraCtx *ctx = avctx->priv_data;
> >>+    AVStream *st;
> >>+    AVCodecParameters *codecpar;
> >>+
> >>+    st = avformat_new_stream(avctx, NULL);
> >>+    if (!st) {
> >>+        return AVERROR(ENOMEM);
> >>+    }
> >>+
> >>+    st->id = VIDEO_STREAM_INDEX;
> >
> >>+    st->avg_frame_rate = (AVRational) { ctx->framerate_range[1], 1 };
> >>+    st->r_frame_rate = (AVRational) { ctx->framerate_range[1], 1 };
> >
> >Are these values always correct ?
> 
> You mean avg_frame_rate and r_frame_rate?
> The framerate can vary between the values in framerate_range[0]
> (min) and framerate_range[1] (max).
> Ideally both values are the same, sometimes min can be lower but for
> the average the framerate should be what is in max.
> Should I set r_frame_rate to min?

I think if you do not know the base or average frame rate you
should not set it.
Or does this lead to some unreasonable latency ?
or are the computed values worse ?


> 
> I fixed all other parts you mentioned.
> 
> Felix
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171130/a6d6860e/attachment.sig>


More information about the ffmpeg-devel mailing list