[FFmpeg-devel] [PATCH] Add android_capture indev

Felix Matouschek felix at matouschek.org
Thu Nov 30 11:15:48 EET 2017


Sorry, my mail client swallowed the attachment, sent it again.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avdevice-add-android_camera-indev.patch
Type: application/octet-stream
Size: 35426 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171130/3a19b51f/attachment.obj>
-------------- next part --------------


> Am 30.11.2017 um 10:12 schrieb Felix Matouschek <felix at matouschek.org>:
> 
> 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 fixed all other parts you mentioned.
> 
> Felix
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list