Steve Lhomme
8a823165b1
va_surface: release all the resources when the va_pool is finally released
7 years ago
Steve Lhomme
f6da761f7c
va_surface: fix reusing a pool already setup
+ simplify the va_pool_SetupDecoder() code
7 years ago
Steve Lhomme
96cabf22cb
va_surface: hold a reference on the va_pool for each surface in flight
7 years ago
Steve Lhomme
5249defb68
va_surface: refcount the va_pool so it can be released with the last picture
The original creator is the one holding the first reference and release it via
va_pool_Close().
Fixes a leak of va_pool after va_pool_Close() is called.
7 years ago
Steve Lhomme
d7971ee0a6
va_surface: allocate all the surfaces in the array with the pool structure
No need for all the mallocs
7 years ago
Steve Lhomme
c23810953a
va_surface: remove unused parameter
7 years ago
Steve Lhomme
8f6e850294
va_surface: call NewSurfacePicContext internally
7 years ago
Steve Lhomme
3d4f30925b
va_surface: create the picture context each time
Rather than doing a copy each time. In other words we don't have one by laying
aroung by default.
7 years ago
Steve Lhomme
2b1761f53b
va_surface: pass the opaque to the picture context creation callback
7 years ago
Steve Lhomme
96f66f06b8
va_surface: don't pass the surface index to allocate a picture context
We get it from the va_surface directly.
7 years ago
Steve Lhomme
6f50851498
va_surface: store the va_pool in each surface
7 years ago
Steve Lhomme
fac459a554
va_surface: add a function to get the surface index in the array
7 years ago
Steve Lhomme
ffa3beb06b
dxva2: access the IDirectXVideoDecoder pointer from the right picture context
7 years ago
Steve Lhomme
00aaa32d67
va_surface: pass an opaque pointer to use with callbacks
We need to keep a local copy of the pool configuration now.
+ rename DestroyVideoDecoder to ReleasePoolSurfaces
7 years ago
Steve Lhomme
8c18fe2201
va_surface: make the va_pool structure private
7 years ago
Steve Lhomme
ff4e03dd0c
va_surface: remove the external pool API
Only D3D11 was using it and it doesn't make sense in push.
7 years ago
Steve Lhomme
d6dd5c1094
d3d11va: clean code after external pool removal
va_surface is always set in picture context
reindent after external pool removal
7 years ago
Steve Lhomme
851a4d09d0
d3d11_fmt: Do not use the external (display) pool anymore
We can push pictures to the display with zero copy as this is the same device.
7 years ago
Steve Lhomme
579a40a48d
d3d11va: store the ID3D11DeviceContext in the video context
We might store a reference to the VA module so the destructor of the module is
not called while the video context is used.
7 years ago
Steve Lhomme
77a5604340
dxva2: store the IDirect3DDevice9 in the video context
7 years ago
Steve Lhomme
389607619a
vaapi: create a dummy video context
7 years ago
Steve Lhomme
66ce8bd409
dxva2: create a video context for the VA
7 years ago
Steve Lhomme
179de0e094
d3d11va: create a video context for the VA
7 years ago
Steve Lhomme
1798f25add
avcodec: get the vlc_video_context created by the VA
For now they don't create one.
7 years ago
Steve Lhomme
027361a5b1
decoder: optionally pass a vlc_video_context in decoder_UpdateVideoOutput()
7 years ago
Steve Lhomme
ccaf412fd0
avcodec: do not use a picture from the display before creating the VA
7 years ago
Steve Lhomme
8f242d9df1
avcodec: vaapi: allocate output pictures locally
The pictures are similar to the ones created in the OpenGL converter.
7 years ago
Steve Lhomme
71a196facf
vaapi: use the decoder device to get the VADisplay
And remove the locally held decoder device that used to come from the
picture_sys_t.
7 years ago
Steve Lhomme
06be6e22a0
dxva2: use the decoder device to init the D3D9 device
rather than the picture_sys
7 years ago
Steve Lhomme
8f1c5c9f1f
d3d11va: use the decoder device to init the D3D11 device
rather than the picture_sys
7 years ago
Steve Lhomme
d5acac3b10
avcodec: provide the vlc_decoder_device from the vout thread to the VA constructor
This is used to initialize the VA instead of the picture_sys_t from the
external decoder pool.
7 years ago
Steve Lhomme
c06a7fd2fd
avcodec: get the decoder device before creating the VA
Only call decoder_GetDecoderDevice() in lavc_UpdateVideoFormat(). The
decoder_UpdateVideoOutput() is done afterwards.
After the call to lavc_UpdateVideoFormat() the received decoder device holds an
extra reference that needs to be released after the VA is created.
decoder_NewPicture() cannot be used until decoder_UpdateVideoOutput() is called.
So this patch temporarily breaks va modules relying on the picture_sys_t data
that used to be passed. It will be via the decoder device we just got.
7 years ago
Steve Lhomme
dbf64bd9f8
dxva: remove redundant hw.surface_count
It's already read when we setup the decoder.
7 years ago
Steve Lhomme
81fe02a5d1
va_surface: fix return value when device creation fails
7 years ago
Steve Lhomme
010801b874
dxva: restrict the supported 8 bit formats
Right now we fallback to 8 bits 4:2:0 for any source format. This is wrong if
we even receive 4:2:2, 4:4:4, 12 bits, 16 bits, etc.
Similar to what is done for VAAPI and VDPAU.
7 years ago
Mathieu Velten
a0e25f1a97
vaapi: add YUVJ420P pixfmt
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
7 years ago
Steve Lhomme
252977d4b7
directx_va: increase the amount of H264 buffers for in-flight pictures
Some samples don't work properly with --vout=dummy otherwise
7 years ago
Steve Lhomme
8730fd0e09
directx_va: the max number of referenced frames for VP9 is 8
Plus one frame to decode
See https://www.webmproject.org/vp9/levels/
7 years ago
Steve Lhomme
a8fb25e68b
va_surface: use a define to count the retries to get a free surface
7 years ago
Steve Lhomme
fa5566fd12
dxva: fix success returned when directx_va_Setup failed
7 years ago
Hugo Beauzée-Luyssen
ff21ec7f17
avcodec: Fix unprotected accesses to pts
7 years ago
Steve Lhomme
bccf352a6f
dxva: fix Close call when the va_pool was not created yet
7 years ago
Steve Lhomme
5fcbf23a34
dxva: allocate the va_pool separately
It might still live with pictures after the va module is deactivated.
7 years ago
Steve Lhomme
fc8b0c8d0b
dxva: balance the surface API and avoid dirty casts
d3d11va/dxva2 only get a va_surface from the API and deal with the references.
They need to create a copy of the internal picture context so it's not released
when the picture is finished in the display. A copy also increments the surface
refcount, so we need to release one after the copy.
7 years ago
Steve Lhomme
fd37d38eb2
dxva: remove unused va_surface.h
Only va_surface_internal.h remains
7 years ago
Steve Lhomme
6705ecda96
d3d11_fmt: do not use the custom VA_PICSYS anymore
There is a common common picture context for all D3D11 opaque formats.
d3d11va adds extra data around the picture context to handle the va_surface
refcounting.
We don't use any directy casts from va_pic_context anymore.
Use common picture_context_t callbacks.
7 years ago
Steve Lhomme
5a435545fd
d3d9_fmt: do not use the custom VA_PICSYS anymore
There is a common common picture context for all D3D9 opaque formats.
dxva2 adds extra data around the picture context to handle the va_surface
refcounting.
We don't use any directy casts from va_pic_context anymore.
Use common picture_context_t callbacks.
7 years ago
Steve Lhomme
9f25d132ac
dxva: change surface context allocation to allow local types for each variant
We don't use a custom/fake VA_PICSYS in the va_surface API. Each type is
responsible for storing the picture_sys_t where they want (if any).
The va_surface API only deals with picture_context_t now.
7 years ago
Steve Lhomme
9144bf872c
directx_va: set the workaround flags directly in directx_va_mode_t
7 years ago
Steve Lhomme
895d174c94
directx_va: check the chroma subpixel format of the source
7 years ago