Re: [FFmpeg-devel] On in-tree external headers

2017-11-06 Thread Jorge Ramirez
On 11/05/2017 11:12 PM, Jan Ekstrom wrote: I also feel like whatever this rule would look like, it's already practiced that way. There isn't really a way not do decide this on a case by case basis. Luckily it's not something that comes up every other day. If someone would submit random third part

Re: [FFmpeg-devel] [PATCH 1/2] v4l_m2m: add missing AV_CODEC_CAP_DELAY flags

2017-12-14 Thread Jorge Ramirez
On 12/14/2017 07:48 PM, wm4 wrote: This is pretty much a requirement for any codec that handles modern codecs like h264, but it was missing. Potentially could lead to issues like missing frames at the end of a stream. --- Untested. hi, please do not merge this (the capability was not missing, i

Re: [FFmpeg-devel] [PATCH 1/2] v4l_m2m: add missing AV_CODEC_CAP_DELAY flags

2017-12-15 Thread Jorge Ramirez
On 12/14/2017 07:54 PM, Jorge Ramirez wrote: On 12/14/2017 07:48 PM, wm4 wrote: This is pretty much a requirement for any codec that handles modern codecs like h264, but it was missing. Potentially could lead to issues like missing frames at the end of a stream. --- Untested. ok you can add

Re: [FFmpeg-devel] [PATCH 1/2] v4l_m2m: add missing AV_CODEC_CAP_DELAY flags

2017-12-21 Thread Jorge Ramirez
On 12/21/2017 09:54 AM, wm4 wrote: On Fri, 15 Dec 2017 12:46:10 +0100 Jorge Ramirez wrote: On 12/14/2017 07:54 PM, Jorge Ramirez wrote: On 12/14/2017 07:48 PM, wm4 wrote: This is pretty much a requirement for any codec that handles modern codecs like h264, but it was missing. Potentially

Re: [FFmpeg-devel] [PATCH] lavu: Add DRM hwcontext

2017-09-01 Thread Jorge Ramirez
On 09/01/2017 05:44 PM, LongChair . wrote: +static int drm_map_frame(AVHWFramesContext *hwfc, + AVFrame *dst, const AVFrame *src, int flags) +{ +const AVDRMFrameDescriptor*desc = (AVDRMFrameDescriptor*)src->data[0]; +DRMMapping *map; +int err, i, p, plane; +

Re: [FFmpeg-devel] [PATCH] lavu: Add DRM hwcontext

2017-09-01 Thread Jorge Ramirez
On 09/01/2017 05:44 PM, LongChair . wrote: + +static void drm_unmap_frame(AVHWFramesContext *hwfc, +HWMapDescriptor *hwmap) +{ +DRMMapping *map = hwmap->priv; +int i; + +for (i = 0; i < map->nb_regions; i++) { +if (map->address[i]) +munm

Re: [FFmpeg-devel] [PATCH] lavu: Add DRM hwcontext

2017-09-01 Thread Jorge Ramirez
On 09/01/2017 05:44 PM, LongChair . wrote: +} + +static int drm_device_create(AVHWDeviceContext *hwdev, const char *device, + AVDictionary *opts, int flags) +{ +AVDRMDeviceContext *hwctx = hwdev->hwctx; +drmVersionPtr version; + +hwctx->fd = open(device, O_

Re: [FFmpeg-devel] [PATCH] lavu: Add DRM hwcontext

2017-09-01 Thread Jorge Ramirez
On 09/01/2017 05:44 PM, LongChair . wrote: + * @file + * API-specific header for AV_HWDEVICE_TYPE_DRM. + * + * Internal frame allocation is not currently supported - all frames + * must be allocated by the user. Thus AVHWFramesContext is always + * NULL, though this may change if support for fra

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: diff --git a/Changelog b/Changelog index 8309417..c6fcda3 100644 --- a/Changelog +++ b/Changelog @@ -40,6 +40,7 @@ version : They must always be used by name. - FITS demuxer and decoder - FITS muxer and encoder +- V4L2 mem2mem HW accelerated co

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +# check V4L2 codecs available in the API check_header linux/fb.h check_header linux/videodev.h check_header linux/videodev2.h check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: vorbis_data.o OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \ vorbis_data.o +OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o Stray cha

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +REGISTER_ENCDEC (H264_V4L2M2M, h264_v4l2m2m); REGISTER_DECODER(H264_MEDIACODEC, h264_mediacodec); REGISTER_DECODER(H264_MMAL, h264_mmal); REGISTER_DECODER(H264_QSV, h264_qsv); @@ -220,6 +222,7 @@ static vo

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: + +/* memcpy to the v4l2_buffer planes array when needed */ +struct v4l2_plane planes[VIDEO_MAX_PLANES]; +struct v4l2_buffer buf; + +int bytesperline[4]; Why 4? Should this be VIDEO_MAX_PLANES again? yes

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: + +static inline int splane_video(struct v4l2_capability *cap) +{ +if (cap->capabilities & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT) & V4L2_CAP_STREAMING) From videodev2.h: #define V4L2_CAP_VIDEO_CAPTURE 0x0001 /* Is a vide

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +av_log(s->avctx, AV_LOG_ERROR, "setting capture format\n"); +return ret; +} + +/* 5. do lazy initialization */ +ret = ff_v4l2_context_init(&s->capture, s->capture.lazy_init); +if (ret) { +av_log(s->avctx, AV_LOG

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +int ff_v4l2m2m_codec_end(AVCodecContext *avctx) +{ +V4L2m2mContext *s = avctx->priv_data; + +av_log(avctx, AV_LOG_DEBUG, "Closing context\n"); + +return ff_v4l2_m2m_codec_end(s); +} + +int ff_v4l2m2m_codec_init(AVCodecContext *avctx) +{ +

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +/* 0. subscribe to source change event */ +memset(&sub, 0, sizeof(sub)); +sub.type = V4L2_EVENT_SOURCE_CHANGE; +ret = ioctl(s->fd, VIDIOC_SUBSCRIBE_EVENT, &sub); +if ( ret < 0) +av_log(avctx, AV_LOG_WARNING, "decoding does

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +} + +/* 2.1 update the AVCodecContext */ +avctx->pix_fmt = ff_v4l2_v4l2fmt_to_avfmt(capture->format.fmt.pix_mp.pixelformat, AV_CODEC_ID_RAWVIDEO); +capture->av_pix_fmt = avctx->pix_fmt; + +/* 3. set the crop parameters */ +se

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"),\ +.type = AVMEDIA_TYPE_VIDEO,\ +.id = CODEC ,\ +.priv_data_size = sizeof(V4L2m2mContext),\ +.priv_class = &v4l2_m2m_ ##

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: + +val = lfind(&p, profile, &len, sizeof(profile[0]), match_profile); +if (val) +return val->v4l2_val; + +return FF_PROFILE_UNKNOWN; Returning FF_PROFILE_UNKNOWN here is bit weird because it mixes the namespaces. I know that's ho

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 04:56 PM, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"),\ +.type = AVMEDIA_TYPE_VIDEO,\ +.id = CODEC ,\ +.pri

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: # Enable hwaccels by default. -enable_weak d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc +enable_weak d3d11va dxva2 vaapi v4l2_m2m vda vdpau videotoolbox_hwaccel xvmc [This line has disappeared on rebase.] ok, just rebased today and saw

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:53 PM, Mark Thompson wrote: On 03/09/17 13:20, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +# check V4L2 codecs available in the API check_header linux/fb.h check_header linux/videodev.h check_header linux/videodev2.h check_code cc linux

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: +/* in ffmpeg there is a single thread could be queueing/dequeuing buffers so a + * timeout is * required when retrieving a frame in case the driver has not received + * enough input * to start generating output. + * + * once decoding starts, the time

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 02:27 AM, Mark Thompson wrote: + +return 0; +} + +static int v4l2m2m_send_frame(AVCodecContext *avctx, const AVFrame *frame) +{ +V4L2m2mContext *s = avctx->priv_data; +V4L2Context *const output = &s->output; + +return ff_v4l2_enqueue_frame(output, frame); +} + +/* Se

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-03 Thread Jorge Ramirez
On 09/03/2017 08:13 PM, Mark Thompson wrote: On 03/09/17 16:26, Jorge Ramirez wrote: On 09/03/2017 04:56 PM, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/03/2017 08:23 PM, Mark Thompson wrote: On 03/09/17 17:54, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +/* in ffmpeg there is a single thread could be queueing/dequeuing buffers so a + * timeout is * required when retrieving a frame in case the driver has not

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/03/2017 08:06 PM, Mark Thompson wrote: On 03/09/17 15:36, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +} + +/* 2.1 update the AVCodecContext */ +avctx->pix_fmt = ff_v4l2_v4l2fmt_to_avfmt(capture->format.fmt.pix_mp.pixelformat, AV_CODEC_ID_RA

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/04/2017 06:31 PM, Mark Thompson wrote: On 04/09/17 17:00, Jorge Ramirez wrote: On 09/03/2017 08:23 PM, Mark Thompson wrote: On 03/09/17 17:54, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +/* in ffmpeg there is a single thread could be queueing/dequeuing buffers so

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/04/2017 07:01 PM, Jorge Ramirez wrote: On 09/04/2017 06:31 PM, Mark Thompson wrote: On 04/09/17 17:00, Jorge Ramirez wrote: On 09/03/2017 08:23 PM, Mark Thompson wrote: On 03/09/17 17:54, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark Thompson wrote: +/* in ffmpeg there is a single

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/04/2017 07:55 PM, Mark Thompson wrote: On 04/09/17 18:01, Jorge Ramirez wrote: On 09/04/2017 06:31 PM, Mark Thompson wrote: On 04/09/17 17:00, Jorge Ramirez wrote: On 09/03/2017 08:23 PM, Mark Thompson wrote: On 03/09/17 17:54, Jorge Ramirez wrote: On 09/03/2017 02:27 AM, Mark

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/04/2017 10:45 PM, Mark Thompson wrote: On 04/09/17 21:34, Jorge Ramirez wrote: On 09/04/2017 07:55 PM, Mark Thompson wrote: On 04/09/17 18:01, Jorge Ramirez wrote: On 09/04/2017 06:31 PM, Mark Thompson wrote: On 04/09/17 17:00, Jorge Ramirez wrote: On 09/03/2017 08:23 PM, Mark

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-04 Thread Jorge Ramirez
On 09/04/2017 11:29 PM, Mark Thompson wrote: On 04/09/17 22:07, Jorge Ramirez wrote: On 09/04/2017 10:45 PM, Mark Thompson wrote: On 04/09/17 21:34, Jorge Ramirez wrote: On 09/04/2017 07:55 PM, Mark Thompson wrote: On 04/09/17 18:01, Jorge Ramirez wrote: On 09/04/2017 06:31 PM, Mark

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-05 Thread Jorge Ramirez
On 09/05/2017 12:16 AM, Mark Thompson wrote: On 04/09/17 22:55, Jorge Ramirez wrote: On 09/04/2017 11:29 PM, Mark Thompson wrote: ... stuff ... So the sequence of calls is: send_frame(frame 0) -> success receive_packet() -> EAGAIN send_frame(frame 1) -> success receive_packet()

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-05 Thread Jorge Ramirez
On 09/05/2017 09:16 AM, Jorge Ramirez wrote: On 09/05/2017 12:16 AM, Mark Thompson wrote: On 04/09/17 22:55, Jorge Ramirez wrote: On 09/04/2017 11:29 PM, Mark Thompson wrote: ... stuff ... So the sequence of calls is: send_frame(frame 0) -> success receive_packet() -> EAGAIN send

Re: [FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-05 Thread Jorge Ramirez
On 09/05/2017 10:27 AM, wm4 wrote: On Tue, 5 Sep 2017 10:03:49 +0200 Jorge Ramirez wrote: On 09/05/2017 09:16 AM, Jorge Ramirez wrote: On 09/05/2017 12:16 AM, Mark Thompson wrote: On 04/09/17 22:55, Jorge Ramirez wrote: On 09/04/2017 11:29 PM, Mark Thompson wrote: ... stuff ... So the

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-17 Thread Jorge Ramirez
On 10/17/2017 08:25 PM, wm4 wrote: On Tue, 17 Oct 2017 19:20:50 +0200 Jorge Ramirez-Ortiz wrote: A user can close the codec while keeping references to some of the capture buffers. When the codec is closed, the structure that keeps the contexts, state and the driver file descriptor is freed

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Jorge Ramirez
On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mContext *m2m, *s = avctx->priv_data; +int i, ret; ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Jorge Ramirez
On 10/18/2017 03:28 PM, Mark Thompson wrote: On 18/10/17 08:46, Jorge Ramirez wrote: On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mContext *m2m, *s = avctx->pri

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-19 Thread Jorge Ramirez
On 10/18/2017 09:40 PM, Michael Niedermayer wrote: On Wed, Oct 18, 2017 at 09:46:40AM +0200, Jorge Ramirez wrote: On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mCont

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-19 Thread Jorge Ramirez
On 10/19/2017 02:10 AM, Mark Thompson wrote: Refcount all of the context information. --- As discussed in the other thread, something like this. We move most of the context into a refcounted buffer and AVCodecContext.priv_data is left as a stub holding a reference to it. um, ok ... please co

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-19 Thread Jorge Ramirez
On 10/19/2017 02:10 AM, Mark Thompson wrote: Refcount all of the context information. --- As discussed in the other thread, something like this. We move most of the context into a refcounted buffer and AVCodecContext.priv_data is left as a stub holding a reference to it. Thoughts: * Change is

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-19 Thread Jorge Ramirez
On 10/19/2017 11:49 AM, Mark Thompson wrote: On 19/10/17 08:28, Jorge Ramirez wrote: On 10/19/2017 02:10 AM, Mark Thompson wrote: Refcount all of the context information. --- As discussed in the other thread, something like this. We move most of the context into a refcounted buffer and

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-19 Thread Jorge Ramirez
On 10/19/2017 07:55 PM, Jorge Ramirez wrote: On 10/19/2017 11:49 AM, Mark Thompson wrote: On 19/10/17 08:28, Jorge Ramirez wrote: On 10/19/2017 02:10 AM, Mark Thompson wrote: Refcount all of the context information. --- As discussed in the other thread, something like this. We move most of

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-20 Thread Jorge Ramirez
On 10/19/2017 07:55 PM, Jorge Ramirez wrote: ok so I guess there is no point to discuss further what I tried to put forward (I could provide my implementation to compare against this RFC - it is just a handful of lines of code - but I guess there is no point given that everyone is

Re: [FFmpeg-devel] [RFC] v4l2_m2m: Fix races around freeing data on close

2017-10-23 Thread Jorge Ramirez
On 10/23/2017 01:47 AM, Mark Thompson wrote: so let's make this work then and fix the SIGSEGV present in master asap (btw this RFC also seg-fault when the above is applied) Where does that version segfault? (It doesn't for me.) the patch will segfault if the changes below are applied to the

Re: [FFmpeg-devel] [PATCH] ffplay: terminate program on EOF.

2017-07-21 Thread Jorge Ramirez
On 07/21/2017 02:41 PM, Clément Bœsch wrote: On Fri, Jul 21, 2017 at 02:26:03PM +0200, Jorge Ramirez-Ortiz wrote: ffplay always requires user intervention via the GUI to close the video at the end of the file. This commit, stops playing and terminates the program when EOF is received

Re: [FFmpeg-devel] [PATCH 1/4] Move lavd/v4l2-common.* to lavc

2017-07-25 Thread Jorge Ramirez
On 07/25/2017 08:09 PM, Michael Niedermayer wrote: On Mon, Jul 24, 2017 at 09:08:46PM +0200, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier In preparation to support the integation of the V4L2 API for encoding and decoding, move v4l2 related files to libavcodec. Signed-off-by: Alexis

Re: [FFmpeg-devel] [PATCH 4/4] libavcodec/dev: v4l2: add support for v4l2 mem2mem codecs

2017-07-26 Thread Jorge Ramirez
On 07/26/2017 04:04 PM, Michael Niedermayer wrote: On Mon, Jul 24, 2017 at 09:08:49PM +0200, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier This patchset enhances Alexis Ballier's original patch and validates it using Qualcomm's Venus hardware (driver recently landed upstream [1]).

Re: [FFmpeg-devel] [PATCH 4/4] libavcodec/dev: v4l2: add support for v4l2 mem2mem codecs

2017-07-28 Thread Jorge Ramirez
On 07/28/2017 12:45 AM, Michael Niedermayer wrote: On Thu, Jul 27, 2017 at 08:44:37AM +0200, Jorge Ramirez wrote: On 07/26/2017 04:04 PM, Michael Niedermayer wrote: On Mon, Jul 24, 2017 at 09:08:49PM +0200, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier This patchset enhances Alexis

Re: [FFmpeg-devel] [PATCHv2 1/4] Move lavd/v4l2-common.* to lavc

2017-08-01 Thread Jorge Ramirez
On 08/01/2017 02:58 PM, Nicolas George wrote: Le quartidi 14 thermidor, an CCXXV, Jorge Ramirez-Ortiz a écrit : From: Alexis Ballier In preparation to support the integation of the V4L2 API for encoding and decoding, move v4l2 related files to libavcodec. Signed-off-by: Alexis Ballier

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-01 Thread Jorge Ramirez
On 08/01/2017 02:54 PM, Jorge Ramirez-Ortiz wrote: diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f55bd90..0fbd10a 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -6,6 +6,7 @@ HEADERS = avcodec.h

Re: [FFmpeg-devel] [PATCHv3 1/4] Move lavd/v4l2-common.* to lavc

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 10:29 AM, Nicolas George wrote: Le quintidi 15 thermidor, an CCXXV, Jorge Ramirez-Ortiz a écrit : From: Alexis Ballier In preparation to support the integation of the V4L2 API for encoding and decoding, move v4l2 related files to libavcodec. Signed-off-by: Alexis Ballier

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 09:33 AM, Hendrik Leppkes wrote: On Tue, Aug 1, 2017 at 2:54 PM, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier This patchset enhances Alexis Ballier's original patch and validates it using Qualcomm's Venus hardware (driver recently landed upstream [1]). This has b

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 12:16 PM, Mark Thompson wrote: On 02/08/17 08:32, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier This patchset enhances Alexis Ballier's original patch and validates it using Qualcomm's Venus hardware (driver recently landed upstream [1]). This has been tested on

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 02:43 PM, Hendrik Leppkes wrote: On Wed, Aug 2, 2017 at 11:39 AM, Jorge Ramirez wrote: On 08/02/2017 09:33 AM, Hendrik Leppkes wrote: On Tue, Aug 1, 2017 at 2:54 PM, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier This patchset enhances Alexis Ballier's original patc

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 04:34 PM, Hendrik Leppkes wrote: On Wed, Aug 2, 2017 at 3:30 PM, Jorge Ramirez wrote: On 08/02/2017 02:43 PM, Hendrik Leppkes wrote: On Wed, Aug 2, 2017 at 11:39 AM, Jorge Ramirez wrote: On 08/02/2017 09:33 AM, Hendrik Leppkes wrote: On Tue, Aug 1, 2017 at 2:54 PM, Jorge

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
I am probably not the best person to discuss why other libraries/codecs are managed the way they are(I lack the background and I would probably be spawning discussions that have been already had); We could ask it the other way around: do you propose that every single application that wants to u

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 07:40 PM, Hendrik Leppkes wrote: On Wed, Aug 2, 2017 at 7:14 PM, Jorge Ramirez wrote: I just think is wrong and I am a bit surprised we could have no real argument on the matter. I've asked for your arguments on why v4l2 is so special that it warrants special treatment

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-02 Thread Jorge Ramirez
On 08/02/2017 10:51 PM, Reimar Döffinger wrote: On 02.08.2017, at 19:53, Jorge Ramirez wrote: On 08/02/2017 07:40 PM, Hendrik Leppkes wrote: On Wed, Aug 2, 2017 at 7:14 PM, Jorge Ramirez wrote: I just think is wrong and I am a bit surprised we could have no real argument on the matter

Re: [FFmpeg-devel] [PATCHv2 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-03 Thread Jorge Ramirez
On 08/03/2017 11:22 AM, Nicolas George wrote: I still hope you can be convinced to understand proper design principles. But if that cannot be achieved,then authority it is. if it is ok with you, let's move on. ___ ffmpeg-devel mailing list ffmpeg-deve

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-03 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: On 02/08/17 08:32, Jorge Ramirez-Ortiz wrote: ... diff --git a/compat/v4l2/v4l2-common.h b/compat/v4l2/v4l2-common.h diff --git a/compat/v4l2/videodev2.h b/compat/v4l2/videodev2.h These are discussed in other threads. I don't really hav

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-04 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: agree with all your previous comments up to here (will fix). +case V4L2_BUF_TYPE_VIDEO_OUTPUT: +case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: +pfd.events = POLLOUT | POLLERR | POLLWRNORM; +break; +default: +pfd.events =

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-04 Thread Jorge Ramirez
On 08/04/2017 01:51 PM, Mark Thompson wrote: +REGISTER_ENCDEC (VP8_V4L2M2M, vp8_v4l2m2m); REGISTER_DECODER(VP9, vp9); +REGISTER_DECODER(VP9_V4L2M2M, vp9_v4l2m2m); REGISTER_DECODER(VQA, vqa); REGISTER_DECODER(BITPACKED, bitp

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-04 Thread Jorge Ramirez
On 08/04/2017 01:51 PM, Mark Thompson wrote: +if (ret) +return 0; + +return avpriv_v4l_dequeue(cap_pool, frame, NULL, timeout); +} What happens to the decoder if some parameters like resolution change mid-stream? (Try the stream h264/reinit-large_420_8-to-small_420_8.h264 in th

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/04/2017 03:32 PM, Mark Thompson wrote: On 04/08/17 14:06, Jorge Ramirez wrote: On 08/04/2017 01:51 PM, Mark Thompson wrote: +if (ret) +return 0; + +return avpriv_v4l_dequeue(cap_pool, frame, NULL, timeout); +} What happens to the decoder if some parameters like

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/04/2017 01:51 PM, Mark Thompson wrote: +break; +case AV_CODEC_ID_H263: +qmin = MPEG_CID(H263_MIN_QP); +qmax = MPEG_CID(H263_MAX_QP); +break; +case AV_CODEC_ID_VP8: +case AV_CODEC_ID_VP9: +qmin = MPEG_CID(VPX_MIN_QP); +qmax = MPEG_C

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: + +static int v4lbuf_to_avframe(AVFrame *frame, V4LBuffer *avbuf) +{ +int i, ret; + +av_frame_unref(frame); + +for (i = 0; i < avbuf->num_planes; i++) { +ret = v4l2bufref(avbuf, i, &frame->buf[i]);> +if (ret) +re

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +return AVERROR(errno); + +bp->streamon = (cmd == VIDIOC_STREAMON); + +return 0; +} + +int avpriv_v4l_enqueue(V4LBufferPool* bp, const AVFrame* f, const AVPacket* pkt) Just make separate functions. done in v4 thanks

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +static int probe_and_set(V4Lm2mContext* s, void *log_ctx, int set) +{ +int fail_log_level = ( set ? AV_LOG_ERROR : AV_LOG_DEBUG); +int ret; + +s->fd = open(s->devname, O_RDWR, 0); O_NONBLOCK, given DQBUF is used as if it is? ack ___

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +return ret; +} + +av_log(log_ctx, AV_LOG_INFO, "Using device %s\n", tmpbuf); +ret = probe_and_set(s, log_ctx, 1); +s->devname = devname_save; This probing structure feels very fragile and possibly harmful (opening random devi

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: + +/* this will report the size of the frame back (see a4lbuf_to_avframe) */ +cap_pool->height = avctx->coded_height; +cap_pool->width = avctx->coded_width; Does coded_height/width need to be set to anything sensible here? That won't be

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +if (ret) +return 0; + +return avpriv_v4l_dequeue(cap_pool, frame, NULL, timeout); I feel like if the stream has a lot of delay then you will end up needing to wait for the timeout to get the required EAGAIN, which at 1s is very large

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +default: +return 0; +} + +SET_V4L_EXT_CTRL(value, qmin, avctx->qmin, "minimum video quantizer scale"); +SET_V4L_EXT_CTRL(value, qmax, avctx->qmax, "maximum video quantizer scale"); + +return 0; +} This doesn't set extrad

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +} + +dequeue: + +ret = avpriv_v4l_dequeue(cap_pool, NULL, pkt, timeout); +if (ret == AVERROR(EAGAIN)) +return 0; +if (!ret) +*got_packet = 1; + +return ret; +} Does this actually work for a long stream? You won't

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/03/2017 01:53 AM, Mark Thompson wrote: +AV_OPT_TYPE_INT,\ +{.i64 = V4L2_MEMORY_MMAP},\ +0, INT_MAX, FLAGS },\ +{ "output_memory",\ +"Output memory model: See V4L2_MEMORY_* in videodev2.h. This depends on the HW but default should work with most.",\ +

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/08/2017 12:01 AM, Mark Thompson wrote: great, thanks for that. The issue I have is that the V4L2 driver I am using to test - yes this needs to be detected by the decoder- has not implemented the feature yet. Will keep it in mind before sending the last series of the patchset. Are they ac

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-07 Thread Jorge Ramirez
On 08/07/2017 11:55 PM, Mark Thompson wrote: would you know where can I get this information from (qmin/qmx for the other encoders)? From the relevant language standards. H.263 / MPEG-4 part 2: [1, 31] (: PQUANT, GQUANT.) H.264 / MPEG-4 part 10 / AVC:

Re: [FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-08 Thread Jorge Ramirez
On 08/08/2017 10:23 AM, Martin Storsjö wrote: This doesn't set extradata - you need to extract the codec global headers (such as H.264 SPS and PPS) at init time to be able to write correct files for some codecs (such as H.264) with muxers requiring global headers (such as MP4). It kindof wo

Re: [FFmpeg-devel] [PATCHv4 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-08 Thread Jorge Ramirez
On 08/08/2017 06:07 PM, Jorge Ramirez-Ortiz wrote: OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec_other.o OBJS-$(CONFIG_VP8_VAAPI_ENCODER) += vaapi_encode_vp8.o +OBJS-$(CONFIG_VP8_V4L2M2M_DECODER) += v4l2_m2m_dec.o +OBJS

Re: [FFmpeg-devel] [PATCHv4 3/4] libavcodec: v4l2: add codec formats

2017-08-08 Thread Jorge Ramirez
On 08/09/2017 03:37 AM, Michael Niedermayer wrote: On Tue, Aug 08, 2017 at 06:07:07PM +0200, Jorge Ramirez-Ortiz wrote: In addition, enable the multi planar raw formats. Reviewed-by: Jorge Ramirez Tested-by: Jorge Ramirez --- libavcodec/v4l2_fmt.c | 38

Re: [FFmpeg-devel] [PATCHv4 3/4] libavcodec: v4l2: add codec formats

2017-08-09 Thread Jorge Ramirez
On 08/09/2017 07:51 AM, Jorge Ramirez wrote: On 08/09/2017 03:37 AM, Michael Niedermayer wrote: On Tue, Aug 08, 2017 at 06:07:07PM +0200, Jorge Ramirez-Ortiz wrote: In addition, enable the multi planar raw formats. Reviewed-by: Jorge Ramirez Tested-by: Jorge Ramirez --- libavcodec

Re: [FFmpeg-devel] [PATCHv4 3/4] libavcodec: v4l2: add codec formats

2017-08-09 Thread Jorge Ramirez
On 08/09/2017 09:39 AM, Jorge Ramirez wrote: The previous version was missing the last field which would have left it un-initialized (so just added a null flag since I assume this was simply an error case that would not be processed?) I will fix it in v5 and enable the two flags for clarity

Re: [FFmpeg-devel] V4L2 M2M version 5

2017-08-20 Thread Jorge Ramirez
On 08/09/2017 01:19 PM, Jorge Ramirez-Ortiz wrote: This commit fixes the broken build on platforms not support v4l2_m2m but supporting v4l - this has been tested on ubuntu 10.04, 2.6.xx kernel. It also fixes a regression introduced in libavcodec/Makefile with v4. Fate suite and encoders

Re: [FFmpeg-devel] [PATCHv6 1/4] Move lavd/v4l2-common.* to lavc

2017-08-25 Thread Jorge Ramirez
On 08/25/2017 02:50 PM, Paul B Mahol wrote: On 8/25/17, Jorge Ramirez-Ortiz wrote: From: Alexis Ballier In preparation to support the integation of the V4L2 API for encoding and decoding, move v4l2 related files to libavcodec. v4l2-common was renamed to v4l2_fmt for clarity (v4l2-common.h

Re: [FFmpeg-devel] [PATCHv6 1/4] Move lavd/v4l2-common.* to lavc

2017-08-27 Thread Jorge Ramirez
On 08/25/2017 09:03 PM, Paul B Mahol wrote: Does lavd stuff now depends on lavc? um yes, v4l2 in/out devices (lavd) do use a common file now present in lavc (ie: v4l2_fmt.c). see libavcodec/Makefile: OBJS-$(CONFIG_V4L2)+= v4l2_fmt.o OBJS-$(CONFIG_V4L2_M2M)+=

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-27 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +#define WIDTH(__ctx, __fmt) \ +(V4L2_TYPE_IS_MULTIPLANAR((__ctx)->type) ? __fmt.fmt.pix_mp.width : __fmt.fmt.pix.width) + +#define HEIGHT(__ctx, __fmt) \ +(V4L2_TYPE_IS_MULTIPLANAR((__ctx)->type) ? __fmt.fmt.pix_mp.height : __fmt.fmt.pix.height) Thes

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-27 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: That looks generally OK. Is there any chance a hwaccel approach would be possible instead? If I've learned anything about hardware decoding, then that hwaccel is vastly superior to vendor-implemented full stream decoders. could you help me understand what woul

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-27 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +static inline int buffer_ops_v4l2buf_to_bufref(V4L2Buffer *in, int plane, AVBufferRef **buf) +{ +if (plane >= in->num_planes) +return AVERROR(EINVAL); + +/* even though most encoders return 0 in data_offset encoding vp8 does require this value

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-27 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +static int buffer_ops_v4l2buf_to_avframe(AVFrame *frame, V4L2Buffer *avbuf) +{ +int i, ret; + +av_frame_unref(frame); + +/* 1. get references to the actual data */ +for (i = 0; i < avbuf->num_planes; i++) { +ret = avbuf->ops.buf_to_bufre

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-27 Thread Jorge Ramirez
On 08/27/2017 09:09 PM, Jorge Ramirez wrote: On 08/25/2017 05:35 PM, wm4 wrote: +static int buffer_ops_v4l2buf_to_avframe(AVFrame *frame, V4L2Buffer *avbuf) +{ +int i, ret; + +av_frame_unref(frame); + +/* 1. get references to the actual data */ +for (i = 0; i < avbuf->num_

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +static V4L2Buffer* context_ops_dequeue_v4l2buf(V4L2Context *ctx, unsigned int timeout) +{ +struct v4l2_plane planes[VIDEO_MAX_PLANES]; +struct v4l2_buffer buf = { 0 }; +V4L2Buffer* avbuf = NULL; +struct pollfd pfd = { +.events = POLLIN

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: + +dirp = opendir("/dev"); +if (!dirp) +return AVERROR(errno); + +for (entry = readdir(dirp); entry; entry = readdir(dirp)) { + +if (strncmp(entry->d_name, "video", 5)) +continue; + +snprintf(node, sizeof(node), "/

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +int avpriv_v4l2m2m_reinit(V4L2Context* ctx) +{ +V4L2m2mContext *s = container_of(ctx, V4L2m2mContext, capture); +int ret; + +av_log(ctx->log_ctx, AV_LOG_DEBUG, "%s reinit context\n", ctx->name); + +/* 1. streamoff */ +ret = avpriv_v4l2_conte

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +/* + * increase the number of buffers to support h.264/h.265 + * default (configurable via option) is 16 + */ +switch (avctx->codec_id) { +case AV_CODEC_ID_H264: +case AV_CODEC_ID_HEVC: +output->num_buffers += 4; +bre

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: +#if CONFIG_VP8_V4L2M2M_DECODER +M2MDEC(vp8, "VP8", AV_CODEC_ID_VP8, NULL); +#endif + +#if CONFIG_VP9_V4L2M2M_DECODER +M2MDEC(vp9, "VP9", AV_CODEC_ID_VP9, NULL); +#endif + +#if CONFIG_HEVC_V4L2M2M_DECODER +M2MDEC(hevc, "HEVC", AV_CODEC_ID

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/28/2017 11:26 AM, Alexis Ballier wrote: Hi, On Sun, 27 Aug 2017 21:41:06 +0200 Jorge Ramirez wrote: On 08/27/2017 09:09 PM, Jorge Ramirez wrote: On 08/25/2017 05:35 PM, wm4 wrote: +static int buffer_ops_v4l2buf_to_avframe(AVFrame *frame, V4L2Buffer *avbuf) +{ +int i, ret

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/28/2017 12:04 PM, wm4 wrote: yes in response to your previous comment on the subject, I am trying to address that in v7 not releasing the context while there are buffers on the fly This is what I came up with (if you can suggest something better - ie, a way to block until the AVBufferR

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/28/2017 12:47 PM, wm4 wrote: I guess that instead of polling for the AVBufferRef to be unreferenced, I can associate a sync (ie a sempahore) to each buffer, take it on release and post the semaphore on the AVBufferRefs being unreferenced. that is actually pretty clean in terms of cpu usage.

Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-28 Thread Jorge Ramirez
On 08/25/2017 05:35 PM, wm4 wrote: + +#define SET_V4L2_EXT_CTRL(TYPE, ID, VALUE, NAME)\ +{ \ +struct v4l2_ext_control ctrl = { 0 }; \ +struct v4l2_ext_controls ctrls = { 0 };

  1   2   3   >