Steve Lhomme
8a823165b1
va_surface: release all the resources when the va_pool is finally released
7 years ago
Steve Lhomme
8f6e850294
va_surface: call NewSurfacePicContext internally
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
fac459a554
va_surface: add a function to get the surface index in the array
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
dbf64bd9f8
dxva: remove redundant hw.surface_count
It's already read when we setup the decoder.
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
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
e4cc2f846b
directx_va: move the decoder setup out of the generic directx surface setup
7 years ago
Steve Lhomme
377d00bb98
direct_va: store the va_surface in the picture context
So that every clone can get/release a reference to the original surface.
7 years ago
Steve Lhomme
03c4b4f79a
dxva: setup the surface directly in va_pool_SetupDecoder()
7 years ago
Steve Lhomme
b06db75717
dxva: don't store the external pool flag in the dxva helper
It's only used with D3D11VA and will go away with push.
7 years ago
Steve Lhomme
ec672df041
dxva: merge the video service handling in the device creation callbacks
7 years ago
Steve Lhomme
1d0bca7fea
dxva: merge the device manager in the device creation callback
7 years ago
Steve Lhomme
6e82ec2fa0
dxva: pass the va object to the device destroy callback
7 years ago
Steve Lhomme
bbcd07ff21
directx_va: group the pool/device callbacks in a const structure
7 years ago
Steve Lhomme
9e5570a7e0
directx_va: don't use the va when we only need the sys
7 years ago
Steve Lhomme
f4d47b28a5
dxva: remove the video format from the device init
7 years ago
Steve Lhomme
4cd31c8384
directx_va: get the picture_context_t from the va_pool
We can fill the picture outside of this call.
7 years ago
Steve Lhomme
77df17ab89
dxva: pass the actual video_format_t to create the device
In DVXA2 we should check the max decoding resolution.
7 years ago
Steve Lhomme
b60d0a5715
d3d11/d3d9: only include va_surface.h when necessary
7 years ago
Steve Lhomme
1c67faf32e
va_surface_internal: remove unused include
7 years ago
Steve Lhomme
c5af8b55b9
va_surface: only the va_surface handler needs to know what's inside
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
2a7e19a1b5
va_surface: do the setup in 2 parts
1/ allocate the decoder surfaces
2/ allocate the internal va_surface_t
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
65b4993af7
directx_va: move the pre-allocated hw_surface in directx_va
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
09d4f04e49
directx_va: make va_pic_context public via va_surface.h
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
b655a1d725
directx_va: don't pass the AVCodecContext and es_format_t to directx_va_Open
Only to directx_va_Setup (and va_pool_Setup)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
4e28f09f52
dxva: use the surface width/height from input format in create_decoder_surfaces
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
6c18ebc314
dxva: create the context copy when calling va_pool_Get()
via a pf_new_surface_context callback
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
14ca39de8d
directx_va: remove unused parameter
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
2a399242d9
dxva2: move the device check in dxva since it's the only one that supports it
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
f7d5f497bb
dxva: split the directx related parts from the pool/va parts
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
cab3a9749a
directx_va: pass the surface count to pf_create_decoder_surfaces
So it doesn't have to rely on the internal count in directx_sys_t
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
1b894f8795
directx_va: make surface_count unsigned
This is what libavcodec uses anyway.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
bcaca1091f
directx_va: destroy the decoder at the same time as its surfaces
The interface release is also strongly typed
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
7a917e04ae
directx_va: no need to allocate dummy pictures anymore
We don't use their local picture_sys_t anymore
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
a5978cbc50
directx_va: stronger typing of va_surface in picture_sys_t
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
d1a36cdde1
directx_va: remove the unused lock
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
1479c1b232
directx_va: rework the picture picking algorithm
Just rely on an available atomic value to find a usable picture or wait for
the vout to release some pictures.
Similar to the algorithm found in avcodec/VDPAU.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
48dd1615ce
directx_va: replace the internal reference counter by an atomic value
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
51af7cf65a
directx_va: pass the decoder surface via the returned vlc_va_surface_t
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
1ff9f28781
directx_va: make each vlc_va_surface_t more independent
Can be free'd independently
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
a031cf8a17
directx_va: no need to store temporarily the number of threads
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
b6fae848b4
directx_va: type the common variables for D3D11VA and DXVA2
This will avoid a lot of casts.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
570c797ebf
directx_va: add a way to lock/unlock a surface
The surface may not be used by the decoder but still being used for display/filter.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago
Steve Lhomme
79d7926ae5
directx_va: let the va deal with the vlc_va_surface_t storage
To move away from the picture context
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
9 years ago