Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-10 Thread Jorge Ramirez-Ortiz
On 05/10/2018 04:47 PM, wm4 wrote: so what would be the sequence of calls for an libavcodec client to request the DRM format? https://github.com/BayLibre/ffmpeg-drm/blob/master/main.c#L598 Like in 100% of all existing cases in ffmpeg: set a get_format callback, and return the format from it. S

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-10 Thread wm4
On Thu, 10 May 2018 01:24:42 +0200 Jorge Ramirez-Ortiz wrote: > On 05/09/2018 04:11 PM, Mark Thompson wrote: > > On 09/05/18 08:57, Jorge Ramirez-Ortiz wrote: > >> On 05/09/2018 01:33 AM, Mark Thompson wrote: > >>> diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c > >>> index

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Jorge Ramirez-Ortiz
On 05/09/2018 04:11 PM, Mark Thompson wrote: On 09/05/18 08:57, Jorge Ramirez-Ortiz wrote: On 05/09/2018 01:33 AM, Mark Thompson wrote: diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index ed5193ecc1..2b33badb08 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Dave Stevenson
On 9 May 2018 at 00:33, Mark Thompson wrote: > On 08/05/18 19:24, Lukas Rusak wrote: >> + >> +layer->format = avbuf->context->av_pix_fmt == AV_PIX_FMT_NV12 ? >> +DRM_FORMAT_NV12 : DRM_FORMAT_NV21; >> +layer->nb_planes = 2; >> + >> +layer->planes[1].object_index

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Dave Stevenson
On 9 May 2018 at 15:31, Mark Thompson wrote: > On 09/05/18 10:02, Jorge Ramirez-Ortiz wrote: >> On 05/09/2018 01:33 AM, Mark Thompson wrote: diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c index efcb0426e4..9457fadb1e 100644 --- a/libavcodec/v4l2_context.c ++

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Mark Thompson
On 09/05/18 10:02, Jorge Ramirez-Ortiz wrote: > On 05/09/2018 01:33 AM, Mark Thompson wrote: >>> diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c >>> index efcb0426e4..9457fadb1e 100644 >>> --- a/libavcodec/v4l2_context.c >>> +++ b/libavcodec/v4l2_context.c >>> @@ -393,22 +393,54

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Mark Thompson
On 09/05/18 08:57, Jorge Ramirez-Ortiz wrote: > On 05/09/2018 01:33 AM, Mark Thompson wrote: >> diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c >> index ed5193ecc1..2b33badb08 100644 >> --- a/libavcodec/v4l2_m2m_dec.c >> +++ b/libavcodec/v4l2_m2m_dec.c >> @@ -23,12 +23,18 @@ >>  

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Jorge Ramirez-Ortiz
On 05/09/2018 01:33 AM, Mark Thompson wrote: diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c index efcb0426e4..9457fadb1e 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -393,22 +393,54 @@ static int v4l2_release_buffers(V4L2Context* ctx) struct

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-09 Thread Jorge Ramirez-Ortiz
On 05/09/2018 01:33 AM, Mark Thompson wrote: diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index ed5193ecc1..2b33badb08 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -23,12 +23,18 @@ #include #include + +#include "libavutil/hwcontext.h" +

Re: [FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-08 Thread Mark Thompson
On 08/05/18 19:24, Lukas Rusak wrote: > This is V2 of my previous patch. I have worked together with Jorge to get > this working properly. > We have made it so that AV_PIX_FMT_DRM_PRIME output can be selected by > setting avctx->pix_fmt. This isn't how format selection in libavcodec works. Look

[FFmpeg-devel] [PATCH 2/3] libavcodec: v4l2m2m: output AVDRMFrameDescriptor

2018-05-08 Thread Lukas Rusak
This is V2 of my previous patch. I have worked together with Jorge to get this working properly. We have made it so that AV_PIX_FMT_DRM_PRIME output can be selected by setting avctx->pix_fmt. This allows v4l2 to export the buffer so we can use it for zero-copy. If AV_PIX_FMT_DRM_PRIME is not sel