[vlc-commits] qtsound: Fix configure detection and build

2018-08-07 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Wed Aug  8 
00:01:39 2018 +0200| [0d181b4172cdeb5bd39b059253b4f8a4da7d0db7] | committer: 
David Fuhrmann

qtsound: Fix configure detection and build

QTKit header includes objc header files, therefore the configure
check must be done with an objc file. Also, fix build of qtsound
module.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d181b4172cdeb5bd39b059253b4f8a4da7d0db7
---

 configure.ac   | 4 +++-
 modules/access/Makefile.am | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5c30b99963..1627c12b79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2018,9 +2018,11 @@ AC_ARG_ENABLE(macosx-qtkit,
 if test "x${enable_macosx_qtkit}" != "xno" &&
   (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
 then
+  AC_LANG_PUSH([Objective C])
   AC_CHECK_HEADERS(QTKit/QTKit.h, [
-  VLC_ADD_PLUGIN([qtsound])
+  VLC_ADD_PLUGIN([access_qtsound])
 ])
+  AC_LANG_POP([Objective C])
 fi
 
 dnl
diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index 3ad3e57aa2..ee4290132f 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -72,7 +72,7 @@ access_LTLIBRARIES += libpulsesrc_plugin.la
 endif
 
 libaccess_qtsound_plugin_la_SOURCES = access/qtsound.m
-libaccess_qtsound_plugin_la_LDFLAGS = -Wl,-framework,QTKit 
-Wl,-framework,CoreAudio
+libaccess_qtsound_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)' 
-Wl,-framework,Foundation -Wl,-framework,QTKit -Wl,-framework,CoreAudio
 access_LTLIBRARIES += $(LTLIBaccess_qtsound)
 EXTRA_LTLIBRARIES += libaccess_qtsound_plugin.la
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contribs: dvbpsi: fix duplicate pkt fake positives

2018-08-07 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Aug  7 
17:46:58 2018 +0200| [82af958a696e2047ccb3c311e3607b1fea7c9483] | committer: 
Francois Cartegnie

contribs: dvbpsi: fix duplicate pkt fake positives

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82af958a696e2047ccb3c311e3607b1fea7c9483
---

 .../dvbpsi/0001-really-identify-duplicates.patch   | 71 ++
 .../dvbpsi/0002-really-reset-packet-counter.patch  | 26 
 contrib/src/dvbpsi/rules.mak   |  2 +
 3 files changed, 99 insertions(+)

diff --git a/contrib/src/dvbpsi/0001-really-identify-duplicates.patch 
b/contrib/src/dvbpsi/0001-really-identify-duplicates.patch
new file mode 100644
index 00..f41204d1d5
--- /dev/null
+++ b/contrib/src/dvbpsi/0001-really-identify-duplicates.patch
@@ -0,0 +1,71 @@
+From 6f7ae04fdcdc52c98003b51318be152c9f51709b Mon Sep 17 00:00:00 2001
+From: Francois Cartegnie 
+Date: Tue, 7 Aug 2018 17:25:52 +0200
+Subject: [PATCH 1/2] really identify duplicates
+
+---
+ src/dvbpsi.c | 21 -
+ src/dvbpsi.h |  1 +
+ 2 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/src/dvbpsi.c b/src/dvbpsi.c
+index b74587f..7a844f0 100644
+--- a/src/dvbpsi.c
 b/src/dvbpsi.c
+@@ -91,6 +91,7 @@ void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
+ p_decoder->i_section_max_size = i_section_max_size;
+ p_decoder->b_discontinuity = b_discontinuity;
+ p_decoder->i_continuity_counter = DVBPSI_INVALID_CC;
++p_decoder->prevpacket[0] = 0;
+ p_decoder->p_current_section = NULL;
+ p_decoder->b_current_valid = false;
+ 
+@@ -285,11 +286,19 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const 
uint8_t* p_data)
+ if (i_expected_counter == ((p_decoder->i_continuity_counter + 1) & 
0xf)
+ && !p_decoder->b_discontinuity)
+ {
+-dvbpsi_error(p_dvbpsi, "PSI decoder",
+- "TS duplicate (received %d, expected %d) for PID %d",
+- p_decoder->i_continuity_counter, i_expected_counter,
+- ((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
+-return false;
++if(!memcmp(p_decoder->prevpacket, p_data, 188))
++{
++dvbpsi_debug(p_dvbpsi, "PSI decoder",
++ "TS duplicate (received %d, expected %d) for PID 
%d",
++ p_decoder->i_continuity_counter, 
i_expected_counter,
++ ((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
++return false;
++}
++else /* Fake duplicate */
++{
++/* force discontinuity */
++i_expected_counter = p_decoder->i_continuity_counter + 1;
++}
+ }
+ 
+ if (i_expected_counter != p_decoder->i_continuity_counter)
+@@ -307,6 +316,8 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* 
p_data)
+ }
+ }
+ 
++memcpy(p_decoder->prevpacket, p_data, 188);
++
+ /* Return if no payload in the TS packet */
+ if (!(p_data[3] & 0x10))
+ return false;
+diff --git a/src/dvbpsi.h b/src/dvbpsi.h
+index 061b928..a0446ba 100644
+--- a/src/dvbpsi.h
 b/src/dvbpsi.h
+@@ -239,6 +239,7 @@ typedef void (* dvbpsi_callback_gather_t)(dvbpsi_t 
*p_dvbpsi,  /*!< pointer to d
+ bool b_discontinuity;  /*!< Discontinuity flag */ 
\
+ bool b_current_valid;  /*!< Current valid indicator */
\
+ uint8_t  i_continuity_counter; /*!< Continuity counter */ 
\
++uint8_t  prevpacket[188];  /*!< Previous packet data */   
\
+ uint8_t  i_last_section_number;/*!< Last received section number */   
\
+ dvbpsi_psi_section_t *p_current_section; /*!< Current section */  
\
+ dvbpsi_psi_section_t *p_sections; /*!< List of received PSI sections */   
\
+-- 
+2.14.4
+
diff --git a/contrib/src/dvbpsi/0002-really-reset-packet-counter.patch 
b/contrib/src/dvbpsi/0002-really-reset-packet-counter.patch
new file mode 100644
index 00..b8b24316d8
--- /dev/null
+++ b/contrib/src/dvbpsi/0002-really-reset-packet-counter.patch
@@ -0,0 +1,26 @@
+From 48a9948b341f2b38cf6c88d275dbb1ad52e18f79 Mon Sep 17 00:00:00 2001
+From: Francois Cartegnie 
+Date: Tue, 7 Aug 2018 17:26:05 +0200
+Subject: [PATCH 2/2] really reset packet counter
+
+---
+ src/dvbpsi.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/dvbpsi.c b/src/dvbpsi.c
+index 7a844f0..cf63702 100644
+--- a/src/dvbpsi.c
 b/src/dvbpsi.c
+@@ -113,6 +113,9 @@ void dvbpsi_decoder_reset(dvbpsi_decoder_t* p_decoder, 
const bool b_force)
+ if (b_force)
+ p_decoder->b_current_valid = false;
+ 
++p_decoder->i_continuity_counter = DVBPSI_INVALID_CC;
++p_decoder->prevpacket[0] = 0;
++
+ /* Clear the section array */
+ dvbpsi_DeletePSISections(p_decoder->p_sections);
+ p_decoder->p_sec

[vlc-commits] d3d11: test if a texture format can be used before deciding to use it

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Aug  7 
13:16:48 2018 +0200| [083e7b6f9b80fdfe16cb989d622947304a15119c] | committer: 
Steve Lhomme

d3d11: test if a texture format can be used before deciding to use it

Some formats are not handled properly by drivers and so we should fallback
to working ones when looking for a display format.

Ref #19162
Ref #20681 (work around the conversion issue which I can't reproduce)

(cherry picked from commit ef69fb83f60cd7b12e8f230269222f588587f1b8)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=083e7b6f9b80fdfe16cb989d622947304a15119c
---

 modules/video_chroma/d3d11_fmt.c | 94 +---
 1 file changed, 69 insertions(+), 25 deletions(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 9f024e5a8c..b6d827da0e 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -428,6 +428,73 @@ int D3D11CheckDriverVersion(d3d11_device_t *d3d_dev, UINT 
vendorId, const struct
 return VLC_SUCCESS;
 }
 
+/* test formats that should work but sometimes have issues on some platforms */
+static bool CanReallyUseFormat(vlc_object_t *obj, d3d11_device_t *d3d_dev,
+   vlc_fourcc_t i_chroma, DXGI_FORMAT dxgi)
+{
+bool result = true;
+if (dxgi == DXGI_FORMAT_UNKNOWN)
+return true;
+
+if (is_d3d11_opaque(i_chroma))
+return true;
+
+ID3D11Texture2D *texture = NULL;
+D3D11_TEXTURE2D_DESC texDesc;
+ZeroMemory(&texDesc, sizeof(texDesc));
+texDesc.MipLevels = 1;
+texDesc.SampleDesc.Count = 1;
+texDesc.MiscFlags = 0; //D3D11_RESOURCE_MISC_SHARED;
+texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+texDesc.Usage = D3D11_USAGE_DYNAMIC;
+texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+texDesc.ArraySize = 1;
+texDesc.Format = dxgi;
+texDesc.Height = 144;
+texDesc.Width = 176;
+HRESULT hr = ID3D11Device_CreateTexture2D( d3d_dev->d3ddevice, &texDesc, 
NULL, &texture );
+if (FAILED(hr))
+{
+msg_Dbg(obj, "cannot allocate a writable texture type %s. (hr=0x%lX)", 
DxgiFormatToStr(dxgi), hr);
+return false;
+}
+
+D3D11_MAPPED_SUBRESOURCE mappedResource;
+hr = ID3D11DeviceContext_Map(d3d_dev->d3dcontext, 
(ID3D11Resource*)texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
+if (FAILED(hr))
+{
+msg_Err(obj, "The texture type %s cannot be mapped. (hr=0x%lX)", 
DxgiFormatToStr(dxgi), hr);
+result = false;
+goto done;
+}
+ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, (ID3D11Resource*)texture, 
0);
+
+if (dxgi == DXGI_FORMAT_YUY2)
+{
+const vlc_chroma_description_t *p_chroma_desc = 
vlc_fourcc_GetChromaDescription( i_chroma );
+if( !p_chroma_desc )
+{
+msg_Err(obj, "No pixel format for %4.4s", (const char*)&i_chroma);
+result = false;
+goto done;
+}
+
+if (mappedResource.RowPitch >= 2 * (texDesc.Width * 
p_chroma_desc->p[0].w.num / p_chroma_desc->p[0].w.den * 
p_chroma_desc->pixel_size))
+{
+msg_Err(obj, "Bogus %4.4s pitch detected type %s. %d should be 
%d", (const char*)&i_chroma,
+  DxgiFormatToStr(dxgi), mappedResource.RowPitch,
+  (texDesc.Width * p_chroma_desc->p[0].w.num / 
p_chroma_desc->p[0].w.den * p_chroma_desc->pixel_size));
+result = false;
+goto done;
+}
+
+}
+done:
+ID3D11Texture2D_Release(texture);
+
+return result;
+}
+
 #undef FindD3D11Format
 const d3d_format_t *FindD3D11Format(vlc_object_t *o,
 d3d11_device_t *d3d_dev,
@@ -456,7 +523,8 @@ const d3d_format_t *FindD3D11Format(vlc_object_t *o,
 else
 textureFormat = output_format->formatTexture;
 
-if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, 
supportFlags ) )
+if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, 
supportFlags ) &&
+CanReallyUseFormat(o, d3d_dev, output_format->fourcc, 
output_format->formatTexture) )
 return output_format;
 }
 return NULL;
@@ -553,30 +621,6 @@ int AllocateTextures( vlc_object_t *obj, d3d11_device_t 
*d3d_dev,
 }
 }
 
-if (!is_d3d11_opaque(fmt->i_chroma) && cfg->formatTexture != 
DXGI_FORMAT_UNKNOWN) {
-D3D11_MAPPED_SUBRESOURCE mappedResource;
-hr = ID3D11DeviceContext_Map(d3d_dev->d3dcontext, 
(ID3D11Resource*)textures[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
-if( FAILED(hr) ) {
-msg_Err(obj, "The texture cannot be mapped. (hr=0x%lX)", hr);
-goto error;
-}
-ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, 
(ID3D11Resource*)textures[0], 0);
-if (mappedResource.RowPitch < p_chroma_desc->pixel_size * 
texDesc.Width) {
-msg_Err( obj, "The texture row pitch is too small (%d

[vlc-commits] d3d11_fmt: pass an object and a d3d11_device_t to FindD3D11Format()

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Aug  7 
13:17:40 2018 +0200| [57af75792baeaeaec276e5a6ec03a54e59bb5664] | committer: 
Steve Lhomme

d3d11_fmt: pass an object and a d3d11_device_t to FindD3D11Format()

So we can test for more errors and log them.

(cherry picked from commit 58739768a0bcafeb10791684a90af55ce740fb57)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=57af75792baeaeaec276e5a6ec03a54e59bb5664
---

 modules/hw/d3d11/d3d11_surface.c| 16 
 modules/video_chroma/d3d11_fmt.c|  6 --
 modules/video_chroma/d3d11_fmt.h|  4 +++-
 modules/video_output/win32/direct3d11.c | 24 
 4 files changed, 27 insertions(+), 23 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commitdiff;h=57af75792baeaeaec276e5a6ec03a54e59bb5664
___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11va: make the OS detection not dependent on the app manifest

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Aug  7 
14:18:04 2018 +0200| [b33c5a26bc1f3d0e644e8b875f56c7e33ada275b] | committer: 
Steve Lhomme

d3d11va: make the OS detection not dependent on the app manifest

hopefully the location won't change in future Windows versions

(cherry picked from commit 28676840e3539b56c3339ee617d6b982e0565ed9)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=b33c5a26bc1f3d0e644e8b875f56c7e33ada275b
---

 modules/codec/avcodec/d3d11va.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index f73f5dfce8..48e40f54da 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -43,8 +43,6 @@
 #include 
 #include 
 
-#include 
-
 #define COBJMACROS
 #include 
 #include 
@@ -320,9 +318,18 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
 return VLC_EGENERIC;
 
+#if !VLC_WINSTORE_APP
 /* Allow using D3D11VA automatically starting from Windows 8.1 */
-if (!va->obj.force && !IsWindows8Point1OrGreater())
-return VLC_EGENERIC;
+if (!va->obj.force)
+{
+bool isWin81OrGreater = false;
+HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+if (likely(hKernel32 != NULL))
+isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") 
!= NULL;
+if (!isWin81OrGreater)
+return VLC_EGENERIC;
+}
+#endif
 
 vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
 if (unlikely(sys == NULL))

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11va: make the OS detection not dependent on the app manifest

2018-08-07 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Aug  7 14:18:04 
2018 +0200| [28676840e3539b56c3339ee617d6b982e0565ed9] | committer: Steve Lhomme

d3d11va: make the OS detection not dependent on the app manifest

hopefully the location won't change in future Windows versions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28676840e3539b56c3339ee617d6b982e0565ed9
---

 modules/codec/avcodec/d3d11va.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 6e5fc20f44..1d6a8f5cc4 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -43,8 +43,6 @@
 #include 
 #include 
 
-#include 
-
 #define COBJMACROS
 #include 
 #include 
@@ -321,9 +319,18 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
 return VLC_EGENERIC;
 
+#if !VLC_WINSTORE_APP
 /* Allow using D3D11VA automatically starting from Windows 8.1 */
-if (!va->obj.force && !IsWindows8Point1OrGreater())
-return VLC_EGENERIC;
+if (!va->obj.force)
+{
+bool isWin81OrGreater = false;
+HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+if (likely(hKernel32 != NULL))
+isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") 
!= NULL;
+if (!isWin81OrGreater)
+return VLC_EGENERIC;
+}
+#endif
 
 vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
 if (unlikely(sys == NULL))

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11va: make the OS detection not dependent on the app manifest

2018-08-07 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Aug  7 14:18:04 
2018 +0200| [c54494b4551bc5d421ab0d33814b6aa65b6ab4bb] | committer: Steve Lhomme

d3d11va: make the OS detection not dependent on the app manifest

hopefully the location won't change in future Windows versions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c54494b4551bc5d421ab0d33814b6aa65b6ab4bb
---

 modules/codec/avcodec/d3d11va.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 6e5fc20f44..9e3a7106ee 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -321,9 +321,18 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
 return VLC_EGENERIC;
 
+#if !VLC_WINSTORE_APP
 /* Allow using D3D11VA automatically starting from Windows 8.1 */
-if (!va->obj.force && !IsWindows8Point1OrGreater())
-return VLC_EGENERIC;
+if (!va->obj.force)
+{
+bool isWin81OrGreater = false;
+HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+if (likely(hKernel32 != NULL))
+isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") 
!= NULL;
+if (!isWin81OrGreater)
+return VLC_EGENERIC;
+}
+#endif
 
 vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
 if (unlikely(sys == NULL))

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11_quad: fix support for rendering for some basic DXGI_FORMAT types

2018-08-07 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Aug  7 13:14:35 
2018 +0200| [88a4aef9b59e48f4918303ab2f1f31f5bbdf716d] | committer: Steve Lhomme

d3d11_quad: fix support for rendering for some basic DXGI_FORMAT types

If they are mentioned in dxgi_fmt they also have to be here (except for
DXGI_FORMAT_420_OPAQUE).

Ref #20681

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=88a4aef9b59e48f4918303ab2f1f31f5bbdf716d
---

 modules/video_output/win32/d3d11_quad.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/win32/d3d11_quad.c 
b/modules/video_output/win32/d3d11_quad.c
index 871dc5c644..24ea952861 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -866,6 +866,8 @@ void D3D11_UpdateViewport(d3d_quad_t *quad, const RECT 
*rect, const d3d_format_t
 case DXGI_FORMAT_B5G6R5_UNORM:
 case DXGI_FORMAT_R10G10B10A2_UNORM:
 case DXGI_FORMAT_R16G16B16A16_UNORM:
+case DXGI_FORMAT_YUY2:
+case DXGI_FORMAT_AYUV:
 if ( display->formatTexture == DXGI_FORMAT_NV12 ||
  display->formatTexture == DXGI_FORMAT_P010 )
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11_fmt: pass an object and a d3d11_device_t to FindD3D11Format()

2018-08-07 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Aug  7 13:17:40 
2018 +0200| [58739768a0bcafeb10791684a90af55ce740fb57] | committer: Steve Lhomme

d3d11_fmt: pass an object and a d3d11_device_t to FindD3D11Format()

So we can test for more errors and log them.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58739768a0bcafeb10791684a90af55ce740fb57
---

 modules/hw/d3d11/d3d11_surface.c| 16 
 modules/video_chroma/d3d11_fmt.c|  6 --
 modules/video_chroma/d3d11_fmt.h|  4 +++-
 modules/video_output/win32/direct3d11.c | 12 ++--
 4 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 1d00ebcf3a..30ed915b52 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -169,10 +169,10 @@ static int assert_staging(filter_t *p_filter, 
picture_sys_t *p_sys)
 texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
 texDesc.BindFlags = 0;
 
-ID3D11Device *p_device;
-ID3D11DeviceContext_GetDevice(p_sys->context, &p_device);
+d3d11_device_t d3d_dev = { .d3dcontext = p_sys->context };
+ID3D11DeviceContext_GetDevice(d3d_dev.d3dcontext, &d3d_dev.d3ddevice);
 sys->staging = NULL;
-hr = ID3D11Device_CreateTexture2D( p_device, &texDesc, NULL, 
&sys->staging);
+hr = ID3D11Device_CreateTexture2D( d3d_dev.d3ddevice, &texDesc, NULL, 
&sys->staging);
 /* test if mapping the texture works ref #18746 */
 if (SUCCEEDED(hr) && FAILED(hr = can_map(sys, p_sys->context)))
 msg_Dbg(p_filter, "can't map default staging texture (hr=0x%0lx)", hr);
@@ -181,21 +181,21 @@ static int assert_staging(filter_t *p_filter, 
picture_sys_t *p_sys)
 /* failed with the this format, try a different one */
 UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD | 
D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT;
 const d3d_format_t *new_fmt =
-FindD3D11Format( p_device, 0, false, 0, false, supportFlags );
+FindD3D11Format( p_filter, &d3d_dev, 0, false, 0, false, 
supportFlags );
 if (new_fmt && texDesc.Format != new_fmt->formatTexture)
 {
 DXGI_FORMAT srcFormat = texDesc.Format;
 texDesc.Format = new_fmt->formatTexture;
-hr = ID3D11Device_CreateTexture2D( p_device, &texDesc, NULL, 
&sys->staging);
+hr = ID3D11Device_CreateTexture2D( d3d_dev.d3ddevice, &texDesc, 
NULL, &sys->staging);
 if (SUCCEEDED(hr))
 {
 texDesc.Usage = D3D11_USAGE_DEFAULT;
 texDesc.CPUAccessFlags = 0;
 texDesc.BindFlags |= D3D11_BIND_RENDER_TARGET;
-hr = ID3D11Device_CreateTexture2D( p_device, &texDesc, NULL, 
&sys->procOutTexture);
+hr = ID3D11Device_CreateTexture2D( d3d_dev.d3ddevice, 
&texDesc, NULL, &sys->procOutTexture);
 if (SUCCEEDED(hr) && SUCCEEDED(hr = can_map(sys, 
p_sys->context)))
 {
-d3d11_device_t d3d_dev = { .d3ddevice = p_device, 
.d3dcontext = p_sys->context };
+d3d11_device_t d3d_dev = { .d3ddevice = d3d_dev.d3ddevice, 
.d3dcontext = p_sys->context };
 if (SetupProcessor(p_filter, &d3d_dev, srcFormat, 
new_fmt->formatTexture))
 {
 ID3D11Texture2D_Release(sys->procOutTexture);
@@ -216,7 +216,7 @@ static int assert_staging(filter_t *p_filter, picture_sys_t 
*p_sys)
 }
 }
 #endif
-ID3D11Device_Release(p_device);
+ID3D11Device_Release(d3d_dev.d3ddevice);
 if (FAILED(hr)) {
 msg_Err(p_filter, "Failed to create a %s staging texture to extract 
surface pixels (hr=0x%0lx)", DxgiFormatToStr(texDesc.Format), hr );
 return VLC_EGENERIC;
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index d011cf7381..c00eb6bfae 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -418,7 +418,9 @@ int D3D11CheckDriverVersion(d3d11_device_t *d3d_dev, UINT 
vendorId, const struct
 return VLC_SUCCESS;
 }
 
-const d3d_format_t *FindD3D11Format(ID3D11Device *d3ddevice,
+#undef FindD3D11Format
+const d3d_format_t *FindD3D11Format(vlc_object_t *o,
+d3d11_device_t *d3d_dev,
 vlc_fourcc_t i_src_chroma,
 bool rgb_only,
 uint8_t bits_per_channel,
@@ -444,7 +446,7 @@ const d3d_format_t *FindD3D11Format(ID3D11Device *d3ddevice,
 else
 textureFormat = output_format->formatTexture;
 
-if( DeviceSupportsFormat( d3ddevice, textureFormat, supportFlags ) )
+if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, 
supportFlags ) )
 return output_format;
 }
 return NULL;
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h

[vlc-commits] d3d11: test if a texture format can be used before deciding to use it

2018-08-07 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Aug  7 13:16:48 
2018 +0200| [ef69fb83f60cd7b12e8f230269222f588587f1b8] | committer: Steve Lhomme

d3d11: test if a texture format can be used before deciding to use it

Some formats are not handled properly by drivers and so we should fallback
to working ones when looking for a display format.

Ref #19162
Ref #20681 (work around the conversion issue which I can't reproduce)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef69fb83f60cd7b12e8f230269222f588587f1b8
---

 modules/video_chroma/d3d11_fmt.c | 94 +---
 1 file changed, 69 insertions(+), 25 deletions(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index c00eb6bfae..432f1d8632 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -418,6 +418,73 @@ int D3D11CheckDriverVersion(d3d11_device_t *d3d_dev, UINT 
vendorId, const struct
 return VLC_SUCCESS;
 }
 
+/* test formats that should work but sometimes have issues on some platforms */
+static bool CanReallyUseFormat(vlc_object_t *obj, d3d11_device_t *d3d_dev,
+   vlc_fourcc_t i_chroma, DXGI_FORMAT dxgi)
+{
+bool result = true;
+if (dxgi == DXGI_FORMAT_UNKNOWN)
+return true;
+
+if (is_d3d11_opaque(i_chroma))
+return true;
+
+ID3D11Texture2D *texture = NULL;
+D3D11_TEXTURE2D_DESC texDesc;
+ZeroMemory(&texDesc, sizeof(texDesc));
+texDesc.MipLevels = 1;
+texDesc.SampleDesc.Count = 1;
+texDesc.MiscFlags = 0; //D3D11_RESOURCE_MISC_SHARED;
+texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+texDesc.Usage = D3D11_USAGE_DYNAMIC;
+texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+texDesc.ArraySize = 1;
+texDesc.Format = dxgi;
+texDesc.Height = 144;
+texDesc.Width = 176;
+HRESULT hr = ID3D11Device_CreateTexture2D( d3d_dev->d3ddevice, &texDesc, 
NULL, &texture );
+if (FAILED(hr))
+{
+msg_Dbg(obj, "cannot allocate a writable texture type %s. (hr=0x%lX)", 
DxgiFormatToStr(dxgi), hr);
+return false;
+}
+
+D3D11_MAPPED_SUBRESOURCE mappedResource;
+hr = ID3D11DeviceContext_Map(d3d_dev->d3dcontext, 
(ID3D11Resource*)texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
+if (FAILED(hr))
+{
+msg_Err(obj, "The texture type %s cannot be mapped. (hr=0x%lX)", 
DxgiFormatToStr(dxgi), hr);
+result = false;
+goto done;
+}
+ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, (ID3D11Resource*)texture, 
0);
+
+if (dxgi == DXGI_FORMAT_YUY2)
+{
+const vlc_chroma_description_t *p_chroma_desc = 
vlc_fourcc_GetChromaDescription( i_chroma );
+if( !p_chroma_desc )
+{
+msg_Err(obj, "No pixel format for %4.4s", (const char*)&i_chroma);
+result = false;
+goto done;
+}
+
+if (mappedResource.RowPitch >= 2 * (texDesc.Width * 
p_chroma_desc->p[0].w.num / p_chroma_desc->p[0].w.den * 
p_chroma_desc->pixel_size))
+{
+msg_Err(obj, "Bogus %4.4s pitch detected type %s. %d should be 
%d", (const char*)&i_chroma,
+  DxgiFormatToStr(dxgi), mappedResource.RowPitch,
+  (texDesc.Width * p_chroma_desc->p[0].w.num / 
p_chroma_desc->p[0].w.den * p_chroma_desc->pixel_size));
+result = false;
+goto done;
+}
+
+}
+done:
+ID3D11Texture2D_Release(texture);
+
+return result;
+}
+
 #undef FindD3D11Format
 const d3d_format_t *FindD3D11Format(vlc_object_t *o,
 d3d11_device_t *d3d_dev,
@@ -446,7 +513,8 @@ const d3d_format_t *FindD3D11Format(vlc_object_t *o,
 else
 textureFormat = output_format->formatTexture;
 
-if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, 
supportFlags ) )
+if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, 
supportFlags ) &&
+CanReallyUseFormat(o, d3d_dev, output_format->fourcc, 
output_format->formatTexture) )
 return output_format;
 }
 return NULL;
@@ -544,30 +612,6 @@ int AllocateTextures( vlc_object_t *obj, d3d11_device_t 
*d3d_dev,
 }
 }
 
-if (!is_d3d11_opaque(fmt->i_chroma) && cfg->formatTexture != 
DXGI_FORMAT_UNKNOWN) {
-D3D11_MAPPED_SUBRESOURCE mappedResource;
-hr = ID3D11DeviceContext_Map(d3d_dev->d3dcontext, 
(ID3D11Resource*)textures[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
-if( FAILED(hr) ) {
-msg_Err(obj, "The texture cannot be mapped. (hr=0x%lX)", hr);
-goto error;
-}
-ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, 
(ID3D11Resource*)textures[0], 0);
-if (mappedResource.RowPitch < p_chroma_desc->pixel_size * 
texDesc.Width) {
-msg_Err( obj, "The texture row pitch is too small (%d instead of 
%d)", mappedResource.RowPitch,
- p_chroma_desc->pixel_

[vlc-commits] demux: avi: workaround broken RGB in Compression usage (fix #20475)

2018-08-07 Thread Francois Cartegnie
vlc/vlc-3.0 | branch: master | Francois Cartegnie  | Tue Aug  
7 11:09:58 2018 +0200| [cfa02ee978523a85b76fd4259a82dc4958920d62] | committer: 
Francois Cartegnie

demux: avi: workaround broken RGB in Compression usage (fix #20475)

refs broken_RV24_as_Compression.avi.bz2

(cherry picked from commit 484ac1b76aa209cb7ab10e33daf65936d7113903)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cfa02ee978523a85b76fd4259a82dc4958920d62
---

 modules/demux/avi/avi.c | 55 -
 1 file changed, 32 insertions(+), 23 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 6f74445c94..3492485a25 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -278,6 +278,30 @@ static void Close ( vlc_object_t * p_this )
 free( p_sys );
 }
 
+static void Set_BMP_RGB_Masks( es_format_t *fmt )
+{
+switch( fmt->i_codec )
+{
+case VLC_CODEC_RGB32:
+fmt->video.i_bmask = 0xff00;
+fmt->video.i_gmask = 0x00ff;
+fmt->video.i_rmask = 0xff00;
+break;
+case VLC_CODEC_RGB24: /* BGR (see biBitCount) */
+fmt->video.i_bmask = 0x00ff;
+fmt->video.i_gmask = 0xff00;
+fmt->video.i_rmask = 0x00ff;
+break;
+case VLC_CODEC_RGB15:
+fmt->video.i_rmask = 0x7c00;
+fmt->video.i_gmask = 0x03e0;
+fmt->video.i_bmask = 0x001f;
+break;
+default:
+break;
+}
+}
+
 /*
  * Open: check file and initializes AVI structures
  */
@@ -591,13 +615,16 @@ static int Open( vlc_object_t * p_this )
 {
 case 32:
 tk->fmt.i_codec = VLC_CODEC_RGB32;
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 24:
-tk->fmt.i_codec = VLC_CODEC_RGB24;
+tk->fmt.i_codec = VLC_CODEC_RGB24; /* BGR (see 
biBitCount) */
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 16: /* Yes it is RV15 */
 case 15:
 tk->fmt.i_codec = VLC_CODEC_RGB15;
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 9: /* <- TODO check that */
 tk->fmt.i_codec = VLC_CODEC_I410;
@@ -610,24 +637,7 @@ static int Open( vlc_object_t * p_this )
 break;
 }
 
-switch( tk->fmt.i_codec )
-{
-case VLC_CODEC_RGB32:
-tk->fmt.video.i_bmask = 0xff00;
-tk->fmt.video.i_gmask = 0x00ff;
-tk->fmt.video.i_rmask = 0xff00;
-break;
-case VLC_CODEC_RGB24: /* BGR (see biBitCount) */
-tk->fmt.video.i_bmask = 0x00ff;
-tk->fmt.video.i_gmask = 0xff00;
-tk->fmt.video.i_rmask = 0x00ff;
-break;
-case VLC_CODEC_RGB15: /* RGB (B least 5 bits) */
-tk->fmt.video.i_rmask = 0x7c00;
-tk->fmt.video.i_gmask = 0x03e0;
-tk->fmt.video.i_bmask = 0x001f;
-break;
-case VLC_CODEC_RGBP:
+if( tk->fmt.i_codec == VLC_CODEC_RGBP )
 {
 const VLC_BITMAPINFO *p_bi = (const VLC_BITMAPINFO *) 
p_vids->p_bih;
 tk->fmt.video.p_palette = malloc( 
sizeof(video_palette_t) );
@@ -645,10 +655,6 @@ static int Open( vlc_object_t * p_this )
 tk->fmt.video.p_palette->i_entries = 
p_vids->p_bih->biClrUsed;
 }
 }
-break;
-default:
-break;
-}
 
 tk->i_width_bytes = p_vids->p_bih->biWidth * 
(p_vids->p_bih->biBitCount >> 3);
 /* RGB DIB are coded from bottom to top */
@@ -663,6 +669,9 @@ static int Open( vlc_object_t * p_this )
 tk->fmt.i_codec   =
 tk->fmt.i_original_fourcc = VLC_FOURCC( 'X', 'V', 'I', 
'D' );
 }
+
+/* Shitty files storing chroma in biCompression */
+Set_BMP_RGB_Masks( &tk->fmt );
 }
 tk->i_samplesize = 0;
 

___
vlc-commits mailing list
vlc

[vlc-commits] demux: ts: restrict HDMV secondary to exact range

2018-08-07 Thread Francois Cartegnie
vlc/vlc-3.0 | branch: master | Francois Cartegnie  | Thu Jun 
28 11:53:23 2018 +0200| [db3dd8dccfb53726f8711f7d0fc9c308daf70910] | committer: 
Francois Cartegnie

demux: ts: restrict HDMV secondary to exact range

(cherry picked from commit 4613998310457312a0ec13100b75d21c1fd80fc6)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=db3dd8dccfb53726f8711f7d0fc9c308daf70910
---

 modules/demux/mpeg/ts_psi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 5706131152..d51acf984d 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -1598,7 +1598,8 @@ static void FillPESFromDvbpsiES( demux_t *p_demux,
 {
 p_pes->p_es->fmt.i_priority = ES_PRIORITY_NOT_DEFAULTABLE;
 }
-else if( p_dvbpsies->i_pid > 0x19ff )
+else if( (p_dvbpsies->i_pid >= 0x1a00 && p_dvbpsies->i_pid <= 0x1a1f) 
||
+ (p_dvbpsies->i_pid >= 0x1b00 && p_dvbpsies->i_pid <= 0x1b1f) )
 {
 /* We might just want to prio, but it will trigger multiple videos 
es */
 p_pes->p_es->fmt.i_priority = ES_PRIORITY_NOT_DEFAULTABLE;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: avi: workaround broken RGB in Compression usage (fix #20475)

2018-08-07 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Aug  7 
11:09:58 2018 +0200| [484ac1b76aa209cb7ab10e33daf65936d7113903] | committer: 
Francois Cartegnie

demux: avi: workaround broken RGB in Compression usage (fix #20475)

refs broken_RV24_as_Compression.avi.bz2

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=484ac1b76aa209cb7ab10e33daf65936d7113903
---

 modules/demux/avi/avi.c | 39 ++-
 1 file changed, 30 insertions(+), 9 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 48f2674f2a..068c2d30b9 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -274,6 +274,30 @@ static void Close ( vlc_object_t * p_this )
 free( p_sys );
 }
 
+static void Set_BMP_RGB_Masks( es_format_t *fmt )
+{
+switch( fmt->i_codec )
+{
+case VLC_CODEC_RGB32:
+fmt->video.i_bmask = 0xff00;
+fmt->video.i_gmask = 0x00ff;
+fmt->video.i_rmask = 0xff00;
+break;
+case VLC_CODEC_RGB24: /* BGR (see biBitCount) */
+fmt->video.i_bmask = 0x00ff;
+fmt->video.i_gmask = 0xff00;
+fmt->video.i_rmask = 0x00ff;
+break;
+case VLC_CODEC_RGB15:
+fmt->video.i_rmask = 0x7c00;
+fmt->video.i_gmask = 0x03e0;
+fmt->video.i_bmask = 0x001f;
+break;
+default:
+break;
+}
+}
+
 /*
  * Open: check file and initializes AVI structures
  */
@@ -596,22 +620,16 @@ static int Open( vlc_object_t * p_this )
 {
 case 32:
 tk->fmt.i_codec = VLC_CODEC_RGB32;
-tk->fmt.video.i_bmask = 0xff00;
-tk->fmt.video.i_gmask = 0x00ff;
-tk->fmt.video.i_rmask = 0xff00;
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 24:
 tk->fmt.i_codec = VLC_CODEC_RGB24; /* BGR (see 
biBitCount) */
-tk->fmt.video.i_bmask = 0x00ff;
-tk->fmt.video.i_gmask = 0xff00;
-tk->fmt.video.i_rmask = 0x00ff;
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 16: /* Yes it is RV15 */
 case 15: /* RGB (B least 5 bits) */
 tk->fmt.i_codec = VLC_CODEC_RGB15;
-tk->fmt.video.i_rmask = 0x7c00;
-tk->fmt.video.i_gmask = 0x03e0;
-tk->fmt.video.i_bmask = 0x001f;
+Set_BMP_RGB_Masks( &tk->fmt );
 break;
 case 9: /* <- TODO check that */
 tk->fmt.i_codec = VLC_CODEC_I410;
@@ -686,6 +704,9 @@ static int Open( vlc_object_t * p_this )
 tk->fmt.i_extra = i_bihextra;
 memcpy( tk->fmt.p_extra, p_bihextra, i_bihextra );
 }
+
+/* Shitty files storing chroma in biCompression */
+Set_BMP_RGB_Masks( &tk->fmt );
 }
 tk->i_samplesize = 0;
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] glwin32: don't activate on XP

2018-08-07 Thread Jean-Baptiste Kempf
vlc/vlc-3.0 | branch: master | Jean-Baptiste Kempf  | Tue 
Aug  7 09:46:20 2018 +0200| [ff9689a819936c3af91dae7cba5e9c59337e1c78] | 
committer: Jean-Baptiste Kempf

glwin32: don't activate on XP

Close #20580

(cherry picked from commit 23e8aa021004679ff212fb95e9244f4ecfeb344c)
Signed-off-by: Jean-Baptiste Kempf 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=ff9689a819936c3af91dae7cba5e9c59337e1c78
---

 modules/video_output/win32/glwin32.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/modules/video_output/win32/glwin32.c 
b/modules/video_output/win32/glwin32.c
index 521270bad1..b6e8fbd6d3 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 
 #define GLEW_STATIC
 #include "../opengl/vout_helper.h"
@@ -113,6 +114,10 @@ static int Open(vlc_object_t *object)
 vout_display_t *vd = (vout_display_t *)object;
 vout_display_sys_t *sys;
 
+/* do not use OpenGL on XP unless forced */
+if(!object->obj.force && !IsWindowsVistaOrGreater())
+return VLC_EGENERIC;
+
 /* Allocate structure */
 vd->sys = sys = calloc(1, sizeof(*sys));
 if (!sys)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] glwin32: don't activate on XP

2018-08-07 Thread Jean-Baptiste Kempf
vlc | branch: master | Jean-Baptiste Kempf  | Tue Aug  7 
09:46:20 2018 +0200| [23e8aa021004679ff212fb95e9244f4ecfeb344c] | committer: 
Jean-Baptiste Kempf

glwin32: don't activate on XP

Close #20580

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=23e8aa021004679ff212fb95e9244f4ecfeb344c
---

 modules/video_output/win32/glwin32.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/modules/video_output/win32/glwin32.c 
b/modules/video_output/win32/glwin32.c
index 0635a184a8..6427ccf658 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 
 #define GLEW_STATIC
 #include "../opengl/vout_helper.h"
@@ -113,6 +114,10 @@ static int Open(vlc_object_t *object)
 vout_display_t *vd = (vout_display_t *)object;
 vout_display_sys_t *sys;
 
+/* do not use OpenGL on XP unless forced */
+if(!object->obj.force && !IsWindowsVistaOrGreater())
+return VLC_EGENERIC;
+
 /* Allocate structure */
 vd->sys = sys = calloc(1, sizeof(*sys));
 if (!sys)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Update NEWS for 3.0.4

2018-08-07 Thread Jean-Baptiste Kempf
vlc/vlc-3.0 | branch: master | Jean-Baptiste Kempf  | Tue 
Aug  7 09:33:03 2018 +0200| [e139904d511af5a749c3f178c816a7cea86972a8] | 
committer: Jean-Baptiste Kempf

Update NEWS for 3.0.4

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e139904d511af5a749c3f178c816a7cea86972a8
---

 NEWS | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 2c8b1dabdb..1fb273eb4e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,21 +4,25 @@ Changes between 3.0.3 and 3.0.4:
 Decoder:
  * Blacklist some intel GPU when decoding HEVC
  * Decode AV1 streams
- * Fix crashes with LPCM streams
+ * Fix playback of low-fps files
  * Fix hardware decoding of low-latency sliced H.264 streams on macOS
  * Fix seeking with streams containing WebVTT subtitles
+ * Fix decoding some CC-608 streams with roll-up
+ * Fix crashes with LPCM streams
+ * Fix colorspace of JPEG, PNG and screen inputs
 
 Demux:
  * Improve FLV fps detection
  * Fix some ogg/flac
  * Improve support for broken HEVC inside MKV
- * Fix some AVI regression for broken files
+ * Fix some AVI regression for broken files and for DVAudio
  * Support files splitted in the .mts%d pattern
  * Fixes for MKV seeking
  * Fix for MP4 disabled track selection
+ * Fix playback of incomplete RAR files (downloading)
 
 Audio Output:
- * Improve iOS session management
+ * Improve iOS session management and resume-from-pause
  * Improve macOS audio performance
  * Support 44.1kHz DTS passthrough
  * Fix crashes on DirectSound output
@@ -28,6 +32,7 @@ Video Output:
  * Fix some broken DVD subtitles rendering (OpenGL, notably)
  * Fix crashes on old mac machines, after some time
  * Fix memleaks on the EGL output (Android notably)
+ * Fix misc display in Direct3D11 due to broken drivers
 
 Text renderer:
  * Fix rendering of arabic fonts fallback on macOS
@@ -36,18 +41,25 @@ Text renderer:
  * Fix some RTL rendering
 
 Misc:
- * Fix live555, macOS-UI, crash
- * Change the extension registration
+ * Fix live555, macOS-UI, screen capture crashes
+ * Change the extension registration names on Windows
  * Fix VLM 'now' date
  * Fixes on the HTTPD server
- * Fix on ntservice registration
+ * Fix on the NTservice registration
  * Fix --stop-time option
+ * Fix ChromeCast compatibility with web interface
+ * Fix subtitles alignment
+ * Fix infinite recursion on directory playback
+ * Fix detection SAT>IP servers
 
 macOS:
  * Fix delay and fps setting in subtitle dialog
  * macOS 10.7.5 is required now. VLC will no longer launch on earlier releases.
  * Modernized and improved support for media keys
 
+Translations:
+ * Update of most translations
+
 
 Changes between 3.0.2 and 3.0.3:
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] lua: fix memory leak

2018-08-07 Thread Hannes Domani
vlc/vlc-3.0 | branch: master | Hannes Domani  | Mon Aug  6 
14:14:17 2018 +0200| [588c9b64afe16f78f6bda09edecb2dc2b8afc742] | committer: 
Jean-Baptiste Kempf

lua: fix memory leak

Signed-off-by: Steve Lhomme 
(cherry picked from commit b9cef2cce0ceb17a10af5db9fe9640e772d07dca)
Signed-off-by: Jean-Baptiste Kempf 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=588c9b64afe16f78f6bda09edecb2dc2b8afc742
---

 modules/lua/vlc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 103d8eb621..53e0204751 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -233,6 +233,8 @@ int vlclua_dir_list(const char *luadirname, char 
***restrict listp)
 /* Source Lua Scripts in architecture-independent data directory */
 if (both || libdir == NULL)
 list = vlclua_dir_list_append(list, datadir, luadirname);
+else
+free(datadir);
 
 *list = NULL;
 return VLC_SUCCESS;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dxva: allow blacklisting for different codecs

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jun 25 
15:38:29 2018 +0200| [578625f6838edc3584faf7373d07cc3a6b12f7e9] | committer: 
Steve Lhomme

dxva: allow blacklisting for different codecs

(cherry picked from commit 79c56aadae985ee55851f2755a351fb8ba9ded86)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=578625f6838edc3584faf7373d07cc3a6b12f7e9
---

 modules/codec/avcodec/d3d11va.c|  32 +--
 modules/codec/avcodec/directx_va.h |   2 +-
 modules/codec/avcodec/dxva2.c  |  26 -
 modules/codec/avcodec/dxva_blacklist.c | 102 -
 4 files changed, 86 insertions(+), 76 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index ad742a487c..08bfb233cc 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -541,24 +541,8 @@ static int DxGetInputList(vlc_va_t *va, input_list_t 
*p_list)
 return VLC_SUCCESS;
 }
 
-extern const GUID DXVA_ModeHEVC_VLD_Main;
 extern const GUID DXVA_ModeHEVC_VLD_Main10;
 extern const GUID DXVA_ModeVP9_VLD_10bit_Profile2;
-static bool CanUseIntelHEVC(vlc_va_t *va)
-{
-vlc_va_sys_t *sys = va->sys;
-IDXGIAdapter *pAdapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice);
-if (!pAdapter)
-return false;
-
-DXGI_ADAPTER_DESC adapterDesc;
-HRESULT hr = IDXGIAdapter_GetDesc(pAdapter, &adapterDesc);
-IDXGIAdapter_Release(pAdapter);
-if (FAILED(hr))
-return false;
-
-return directx_va_canUseHevc( va, adapterDesc.VendorId, 
adapterDesc.DeviceId );
-}
 
 static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t 
*fmt)
 {
@@ -575,9 +559,21 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, 
const video_format_t *
 }
 #endif
 
-if ((IsEqualGUID(input,&DXVA_ModeHEVC_VLD_Main) ||
- IsEqualGUID(input,&DXVA_ModeHEVC_VLD_Main10)) && !CanUseIntelHEVC(va))
+IDXGIAdapter *pAdapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice);
+if (!pAdapter)
+return VLC_EGENERIC;
+
+DXGI_ADAPTER_DESC adapterDesc;
+hr = IDXGIAdapter_GetDesc(pAdapter, &adapterDesc);
+IDXGIAdapter_Release(pAdapter);
+if (FAILED(hr))
+return VLC_EGENERIC;
+
+if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, 
adapterDesc.DeviceId, input))
+{
+msg_Warn(va, "GPU blacklisted for %s codec", 
directx_va_GetDecoderName(input));
 return VLC_EGENERIC;
+}
 
 DXGI_FORMAT processorInput[5];
 int idx = 0;
diff --git a/modules/codec/avcodec/directx_va.h 
b/modules/codec/avcodec/directx_va.h
index 635d8e6eb6..5e72f2188a 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -82,6 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *);
 void directx_va_Close(vlc_va_t *, directx_sys_t *);
 int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, 
const es_format_t *, int flag_xbox);
 char *directx_va_GetDecoderName(const GUID *guid);
-bool directx_va_canUseHevc(vlc_va_t *, UINT VendorId, UINT DeviceId);
+bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const 
GUID *pCodec);
 
 #endif /* AVCODEC_DIRECTX_VA_H */
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index eba36a8b14..c22e6ae92c 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -495,32 +495,26 @@ static int DxGetInputList(vlc_va_t *va, input_list_t 
*p_list)
 return VLC_SUCCESS;
 }
 
-extern const GUID DXVA_ModeHEVC_VLD_Main;
-extern const GUID DXVA_ModeHEVC_VLD_Main10;
-static bool CanUseIntelHEVC(vlc_va_t *va)
+static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t 
*fmt)
 {
+VLC_UNUSED(fmt);
 vlc_va_sys_t *sys = va->sys;
 
 D3DADAPTER_IDENTIFIER9 identifier;
 HRESULT hr = IDirect3D9_GetAdapterIdentifier(sys->hd3d.obj, 
sys->d3d_dev.adapterId, 0, &identifier);
 if (FAILED(hr))
-return false;
-
-return directx_va_canUseHevc( va, identifier.VendorId, identifier.DeviceId 
);
-}
-
-static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t 
*fmt)
-{
-VLC_UNUSED(fmt);
+return VLC_EGENERIC;
 
-if ((IsEqualGUID(input,&DXVA_ModeHEVC_VLD_Main) ||
- IsEqualGUID(input,&DXVA_ModeHEVC_VLD_Main10)) && !CanUseIntelHEVC(va))
+if (!directx_va_canUseDecoder(va, identifier.VendorId, 
identifier.DeviceId, input))
+{
+msg_Warn(va, "GPU blacklisted for %s codec", 
directx_va_GetDecoderName(input));
 return VLC_EGENERIC;
+}
 
 int err = VLC_EGENERIC;
 UINT  output_count = 0;
 D3DFORMAT *output_list = NULL;
-if 
(FAILED(IDirectXVideoDecoderService_GetDecoderRenderTargets(va->sys->dx_sys.d3ddec,
+if 
(FAILED(IDirectXVideoDecoderService_GetDecoderRenderTargets(sys->dx_sys.d3ddec,
input,
  

[vlc-commits] direct3d11: make the OS detection not dependent on the app manifest

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
07:49:33 2018 +0200| [725a46ed02f95d29852145e1c1b8398c2f85d964] | committer: 
Steve Lhomme

direct3d11: make the OS detection not dependent on the app manifest

hopefully the location won't change in future Windows versions

(cherry picked from commit 81e6e779e183ffdeebbc8f72a3c81b241933ff7a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=725a46ed02f95d29852145e1c1b8398c2f85d964
---

 modules/video_output/win32/direct3d11.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 49befa7601..02046d150d 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -36,7 +36,6 @@
 
 #include 
 #include 
-#include 
 
 #define COBJMACROS
 #include 
@@ -514,9 +513,18 @@ static int Open(vlc_object_t *object)
 {
 vout_display_t *vd = (vout_display_t *)object;
 
+#if !VLC_WINSTORE_APP
 /* Allow using D3D11 automatically starting from Windows 8.1 */
-if (!vd->obj.force && !IsWindows8Point1OrGreater())
-return VLC_EGENERIC;
+if (!vd->obj.force)
+{
+bool isWin81OrGreater = false;
+HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+if (likely(hKernel32 != NULL))
+isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") 
!= NULL;
+if (!isWin81OrGreater)
+return VLC_EGENERIC;
+}
+#endif
 
 #if !VLC_WINSTORE_APP
 int ret = OpenHwnd(vd);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d9: use a version check with a better name to disable D3D9

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Jul 31 
15:15:48 2018 +0200| [038e853c0357c61e97d688aee53193de3c1ed8d6] | committer: 
Steve Lhomme

direct3d9: use a version check with a better name to disable D3D9

The VersionHelpers API is available since Win2000

(cherry picked from commit c0abd168d4e9c4d9f60112105da8b9ff5f1df74b)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=038e853c0357c61e97d688aee53193de3c1ed8d6
---

 modules/video_output/win32/direct3d9.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c 
b/modules/video_output/win32/direct3d9.c
index d60e92e7ed..f3d7773f00 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -56,6 +56,7 @@
 #include "builtin_shaders.h"
 
 #include 
+#include 
 
 /*
  * Module descriptor
@@ -251,9 +252,8 @@ static int Open(vlc_object_t *object)
 if ( !vd->obj.force && vd->source.mastering.max_luminance != 0)
 return VLC_EGENERIC; /* let a module who can handle it do it */
 
-OSVERSIONINFO winVer;
-winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-if(GetVersionEx(&winVer) && winVer.dwMajorVersion < 6 && 
!object->obj.force)
+/* do not use D3D9 on XP unless forced */
+if(!object->obj.force && !IsWindowsVistaOrGreater())
 return VLC_EGENERIC;
 
 /* Allocate structure */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] NSIS: Fix Latvian translation

2018-08-07 Thread Jean-Baptiste Kempf
vlc/vlc-3.0 | branch: master | Jean-Baptiste Kempf  | Tue 
Aug  7 09:13:34 2018 +0200| [871e9b0a198785c0e54a32eb17819482ada89c05] | 
committer: Jean-Baptiste Kempf

NSIS: Fix Latvian translation

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=871e9b0a198785c0e54a32eb17819482ada89c05
---

 extras/package/win32/NSIS/languages/LatvianExtra.nsh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/extras/package/win32/NSIS/languages/LatvianExtra.nsh 
b/extras/package/win32/NSIS/languages/LatvianExtra.nsh
index 1347db2f1c..b16e85035d 100644
--- a/extras/package/win32/NSIS/languages/LatvianExtra.nsh
+++ b/extras/package/win32/NSIS/languages/LatvianExtra.nsh
@@ -18,8 +18,7 @@ ${LangFileString} Desc_Section01 \
 ${LangFileString} Desc_Section02a \
 "Vieglākai piekļuvei pievieno ikonas jūsu sākuma izvēlnei"
 ${LangFileString} Desc_Section02b \
-"Vieglākai piekļuvei pievieno ikonu jūsu darbvirsmai
-"
+"Vieglākai piekļuvei pievieno ikonu jūsu darbvirsmai"
 ${LangFileString} Desc_Section03 \
 "VLC Mozilla un Mozilla Firefox spraudnis"
 ${LangFileString} Desc_Section04 \

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d11: don't use D3D11 automatically on OSes older than Win8.1

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Jul 31 
15:18:16 2018 +0200| [3ec6e0859bf9b41dfb4c464d18873a98a05779c0] | committer: 
Steve Lhomme

direct3d11: don't use D3D11 automatically on OSes older than Win8.1

(cherry picked from commit 0d6753dc907403e96db82e3d702a4633832be697)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3ec6e0859bf9b41dfb4c464d18873a98a05779c0
---

 modules/video_output/win32/direct3d11.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index d9834bb8c7..49befa7601 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -36,6 +36,7 @@
 
 #include 
 #include 
+#include 
 
 #define COBJMACROS
 #include 
@@ -513,6 +514,10 @@ static int Open(vlc_object_t *object)
 {
 vout_display_t *vd = (vout_display_t *)object;
 
+/* Allow using D3D11 automatically starting from Windows 8.1 */
+if (!vd->obj.force && !IsWindows8Point1OrGreater())
+return VLC_EGENERIC;
+
 #if !VLC_WINSTORE_APP
 int ret = OpenHwnd(vd);
 #else

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d11: protect the flush from concurrent access from the decoder thread(s)

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Thu Aug  2 
12:37:20 2018 +0200| [cc64d4c6311530a800e253dd8529b07db3d8c3a5] | committer: 
Steve Lhomme

direct3d11: protect the flush from concurrent access from the decoder thread(s)

(cherry picked from commit 83d8394d9b24253e786bc21576155b7a586c1b16)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cc64d4c6311530a800e253dd8529b07db3d8c3a5
---

 modules/video_output/win32/direct3d11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 02046d150d..374abc5be7 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1294,10 +1294,10 @@ static void Prepare(vout_display_t *vd, picture_t 
*picture, subpicture_t *subpic
 }
 }
 
+ID3D11DeviceContext_Flush(sys->d3d_dev.d3dcontext);
+
 if (is_d3d11_opaque(picture->format.i_chroma))
 d3d11_device_unlock( &sys->d3d_dev );
-
-ID3D11DeviceContext_Flush(sys->d3d_dev.d3dcontext);
 }
 
 static void Display(vout_display_t *vd, picture_t *picture, subpicture_t 
*subpicture)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] avcodec:video: log the reason why the format change won't reuse the decoder

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jul 30 
13:59:36 2018 +0200| [47755e9fa436af9b5d326fd7db96c0cc4b6591d5] | committer: 
Steve Lhomme

avcodec:video: log the reason why the format change won't reuse the decoder

Ref: #20343
(cherry picked from commit 923dcb3cda8fa679ebb14809a3e9b7c6d8a40054)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=47755e9fa436af9b5d326fd7db96c0cc4b6591d5
---

 modules/codec/avcodec/video.c | 43 +--
 1 file changed, 29 insertions(+), 14 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index c18d4a58eb..664d045c58 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1524,25 +1524,40 @@ static enum PixelFormat ffmpeg_GetFormat( 
AVCodecContext *p_context,
 can_hwaccel = true;
 }
 
+if (p_sys->pix_fmt == AV_PIX_FMT_NONE)
+goto no_reuse;
+
 /* If the format did not actually change (e.g. seeking), try to reuse the
  * existing output format, and if present, hardware acceleration back-end.
  * This avoids resetting the pipeline downstream. This also avoids
  * needlessly probing for hardware acceleration support. */
-if (p_sys->pix_fmt != AV_PIX_FMT_NONE
- && lavc_GetVideoFormat(p_dec, &fmt, p_context, p_sys->pix_fmt, swfmt) == 0
- && fmt.i_width == p_dec->fmt_out.video.i_width
- && fmt.i_height == p_dec->fmt_out.video.i_height
- && p_context->profile == p_sys->profile
- && p_context->level <= p_sys->level)
-{
-for (size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++)
-if (pi_fmt[i] == p_sys->pix_fmt)
-{
-msg_Dbg(p_dec, "reusing decoder output format %d", pi_fmt[i]);
-return p_sys->pix_fmt;
-}
-}
+ if (lavc_GetVideoFormat(p_dec, &fmt, p_context, p_sys->pix_fmt, swfmt) != 
0)
+ {
+ msg_Dbg(p_dec, "get format failed");
+ goto no_reuse;
+ }
+ if (fmt.i_width  != p_dec->fmt_out.video.i_width ||
+ fmt.i_height != p_dec->fmt_out.video.i_height)
+ {
+ msg_Dbg(p_dec, "mismatched dimensions %ux%u was %ux%u", fmt.i_width, 
fmt.i_height,
+ p_dec->fmt_out.video.i_width, p_dec->fmt_out.video.i_height);
+ goto no_reuse;
+ }
+ if (p_context->profile != p_sys->profile || p_context->level > 
p_sys->level)
+ {
+ msg_Dbg(p_dec, "mismatched profile level %d/%d was %d/%d", 
p_context->profile,
+ p_context->level, p_sys->profile, p_sys->level);
+ goto no_reuse;
+ }
+
+ for (size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++)
+if (pi_fmt[i] == p_sys->pix_fmt)
+{
+msg_Dbg(p_dec, "reusing decoder output format %d", pi_fmt[i]);
+return p_sys->pix_fmt;
+}
 
+no_reuse:
 if (p_sys->p_va != NULL)
 {
 msg_Err(p_dec, "existing hardware acceleration cannot be reused");

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] NSIS: fix French translation

2018-08-07 Thread Jean-Baptiste Kempf
vlc/vlc-3.0 | branch: master | Jean-Baptiste Kempf  | Tue 
Aug  7 09:13:19 2018 +0200| [a70273d7ea6659928669ecfcc221526d890d2af7] | 
committer: Jean-Baptiste Kempf

NSIS: fix French translation

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a70273d7ea6659928669ecfcc221526d890d2af7
---

 extras/package/win32/NSIS/languages/FrenchExtra.nsh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/extras/package/win32/NSIS/languages/FrenchExtra.nsh 
b/extras/package/win32/NSIS/languages/FrenchExtra.nsh
index d498fef2e0..ec34a302ce 100644
--- a/extras/package/win32/NSIS/languages/FrenchExtra.nsh
+++ b/extras/package/win32/NSIS/languages/FrenchExtra.nsh
@@ -57,8 +57,7 @@ ${LangFileString} Action_OnArrivalSVCDMovie "Lecture de film 
SVCD"
 ${LangFileString} Action_OnArrivalVideoFiles "Lecture de fichiers vidéo"
 ${LangFileString} Action_OnArrivalMusicFiles "Lecture de fichiers audio"
 ${LangFileString} Action_OnArrivalDVDAudio "Lecture de DVD audio"
-${LangFileString} Action_OnArrivalBluray "Lecture de Blu-ray
-"
+${LangFileString} Action_OnArrivalBluray "Lecture de Blu-ray"
 
 ${LangFileString} License_NextText "Vous connnaissez  maintenant vos droits. 
Cliquez sur [Suivant] pour continuer."
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] directx_va: DXVA2_ModeMPEG2_VLD also supports the main profile

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Jul 31 
08:15:25 2018 +0200| [5bc3abd7535774c35d5ce18183151104f982cb4c] | committer: 
Steve Lhomme

directx_va: DXVA2_ModeMPEG2_VLD also supports the main profile

Ref #20343

(cherry picked from commit d170d0d79db04a97d0739564421f48752480d93e)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5bc3abd7535774c35d5ce18183151104f982cb4c
---

 modules/codec/avcodec/directx_va.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/directx_va.c 
b/modules/codec/avcodec/directx_va.c
index 9de31587e3..e12704729b 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -48,7 +48,6 @@ struct picture_sys_t {
 #include "../../packetizer/h264_nal.h"
 #include "../../packetizer/hevc_nal.h"
 
-static const int PROF_MPEG2_SIMPLE[] = { FF_PROFILE_MPEG2_SIMPLE, 0 };
 static const int PROF_MPEG2_MAIN[]   = { FF_PROFILE_MPEG2_SIMPLE,
  FF_PROFILE_MPEG2_MAIN, 0 };
 static const int PROF_H264_HIGH[]= { FF_PROFILE_H264_BASELINE,
@@ -176,7 +175,7 @@ static const directx_va_mode_t DXVA_MODES[] = {
 { "MPEG-2 decoder, restricted profile C",  
   &DXVA_ModeMPEG2_C,  0, NULL },
 { "MPEG-2 decoder, restricted profile D",  
   &DXVA_ModeMPEG2_D,  0, NULL },
 
-{ "MPEG-2 variable-length decoder",
   &DXVA2_ModeMPEG2_VLD,   AV_CODEC_ID_MPEG2VIDEO, 
PROF_MPEG2_SIMPLE },
+{ "MPEG-2 variable-length decoder",
   &DXVA2_ModeMPEG2_VLD,   AV_CODEC_ID_MPEG2VIDEO, 
PROF_MPEG2_MAIN },
 { "MPEG-2 & MPEG-1 variable-length decoder",   
   &DXVA2_ModeMPEG2and1_VLD,   AV_CODEC_ID_MPEG2VIDEO, 
PROF_MPEG2_MAIN },
 { "MPEG-2 & MPEG-1 variable-length decoder",   
   &DXVA2_ModeMPEG2and1_VLD,   AV_CODEC_ID_MPEG1VIDEO, NULL },
 { "MPEG-2 motion compensation",
   &DXVA2_ModeMPEG2_MoComp,0, NULL },

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dxva: allow blacklisting based on the driver build

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jun 25 
17:36:35 2018 +0200| [192522b75b36c29bc7219a5c46b469a13cffbde1] | committer: 
Steve Lhomme

dxva: allow blacklisting based on the driver build

Not used for now.

(cherry picked from commit 33cc4f2b1f9dace2b3a63098a458f3172fc6ae41)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=192522b75b36c29bc7219a5c46b469a13cffbde1
---

 modules/codec/avcodec/d3d11va.c|  3 +-
 modules/codec/avcodec/directx_va.h |  2 +-
 modules/codec/avcodec/dxva2.c  |  9 +++-
 modules/codec/avcodec/dxva_blacklist.c | 76 --
 4 files changed, 56 insertions(+), 34 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 08bfb233cc..5e3b052196 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -569,7 +569,8 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, 
const video_format_t *
 if (FAILED(hr))
 return VLC_EGENERIC;
 
-if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, 
adapterDesc.DeviceId, input))
+if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, 
adapterDesc.DeviceId,
+  input, sys->d3d_dev.WDDM.build))
 {
 msg_Warn(va, "GPU blacklisted for %s codec", 
directx_va_GetDecoderName(input));
 return VLC_EGENERIC;
diff --git a/modules/codec/avcodec/directx_va.h 
b/modules/codec/avcodec/directx_va.h
index 5e72f2188a..335cca7bd3 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -82,6 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *);
 void directx_va_Close(vlc_va_t *, directx_sys_t *);
 int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, 
const es_format_t *, int flag_xbox);
 char *directx_va_GetDecoderName(const GUID *guid);
-bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const 
GUID *pCodec);
+bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const 
GUID *pCodec, UINT driverBuild);
 
 #endif /* AVCODEC_DIRECTX_VA_H */
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index c22e6ae92c..7c65b4b227 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -505,7 +505,14 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, 
const video_format_t *
 if (FAILED(hr))
 return VLC_EGENERIC;
 
-if (!directx_va_canUseDecoder(va, identifier.VendorId, 
identifier.DeviceId, input))
+UINT driverBuild = identifier.DriverVersion.LowPart & 0x;
+if (identifier.VendorId == GPU_MANUFACTURER_INTEL && 
(identifier.DriverVersion.LowPart >> 16) >= 100)
+{
+/* new Intel driver format */
+driverBuild += ((identifier.DriverVersion.LowPart >> 16) - 100) * 1000;
+}
+if (!directx_va_canUseDecoder(va, identifier.VendorId, identifier.DeviceId,
+  input, driverBuild))
 {
 msg_Warn(va, "GPU blacklisted for %s codec", 
directx_va_GetDecoderName(input));
 return VLC_EGENERIC;
diff --git a/modules/codec/avcodec/dxva_blacklist.c 
b/modules/codec/avcodec/dxva_blacklist.c
index e6db873a14..f17e2676ec 100644
--- a/modules/codec/avcodec/dxva_blacklist.c
+++ b/modules/codec/avcodec/dxva_blacklist.c
@@ -43,9 +43,16 @@ struct picture_sys_t
 extern const GUID DXVA_ModeHEVC_VLD_Main;
 extern const GUID DXVA_ModeHEVC_VLD_Main10;
 
+enum DriverTestCommand {
+BLAnyDriver,
+BLBelowBuild, /* driverBuild is the first driver version known to work */
+};
+
 struct decoders {
 const UINT deviceID;
 const GUID **decoder_list;
+const enum DriverTestCommand cmd;
+const UINT driverBuild;
 };
 
 static const GUID *NoHEVC[] = {
@@ -56,35 +63,36 @@ static const GUID *NoHEVC[] = {
 
 static struct decoders IntelDevices[] = {
 /* Intel Broadwell GPUs with hybrid HEVC */
-{ 0x1606, NoHEVC }, /* HD Graphics */
-{ 0x160E, NoHEVC }, /* HD Graphics */
-{ 0x1612, NoHEVC }, /* HD Graphics 5600 */
-{ 0x1616, NoHEVC }, /* HD Graphics 5500 */
-{ 0x161A, NoHEVC }, /* HD Graphics P5700 */
-{ 0x161E, NoHEVC }, /* HD Graphics 5300 */
-{ 0x1622, NoHEVC }, /* Iris Pro Graphics 6200 */
-{ 0x1626, NoHEVC }, /* HD Graphics 6000 */
-{ 0x162A, NoHEVC }, /* Iris Pro Graphics P6300 */
-{ 0x162B, NoHEVC }, /* Iris Graphics 6100 */
-
-{ 0x0402, NoHEVC }, /* HD Graphics */
-{ 0x0406, NoHEVC }, /* HD Graphics */
-{ 0x040A, NoHEVC }, /* HD Graphics */
-{ 0x0412, NoHEVC }, /* HD Graphics 4600 */
-{ 0x0416, NoHEVC }, /* HD Graphics 4600 */
-{ 0x041E, NoHEVC }, /* HD Graphics 4400 */
-{ 0x041A, NoHEVC }, /* HD Graphics P4600/P4700 */
-
-{ 0x0A06, NoHEVC }, /* HD Graphics */
-{ 0x0A0E, NoHEVC }, /* HD Graphics */
-{ 0x0A16, NoHEVC }, /* HD Graphics Family */
-{ 0x0A1E, NoHEVC }, /* HD Graphics Family */
-{ 0x0A26, NoHEVC }, /* HD Graphics 5000 

[vlc-commits] direct3d11: log the actual source pixel format, not the assumed decoder one

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Aug  7 
08:07:12 2018 +0200| [d4dc21260f4684619372823a8da13b112ec3e990] | committer: 
Steve Lhomme

direct3d11: log the actual source pixel format, not the assumed decoder one

(cherry picked from commit 44bbb10adad1f2cbae7bb7f44bbec2191dd53ea4)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d4dc21260f4684619372823a8da13b112ec3e990
---

 modules/video_output/win32/direct3d11.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 374abc5be7..d37e73b90c 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1687,10 +1687,9 @@ static int SetupOutputFormat(vout_display_t *vd, 
video_format_t *fmt)
return VLC_EGENERIC;
 }
 
-fmt->i_chroma = decoder_format ? decoder_format->fourcc : 
sys->picQuadConfig->fourcc;
-
 msg_Dbg( vd, "Using pixel format %s for chroma %4.4s", 
sys->picQuadConfig->name,
  (char *)&fmt->i_chroma );
+fmt->i_chroma = decoder_format ? decoder_format->fourcc : 
sys->picQuadConfig->fourcc;
 DxgiFormatMask( sys->picQuadConfig->formatTexture, fmt );
 
 /* check the region pixel format */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dxva: blacklist core 2 duo related chipsets that can't even decoder 720p properly

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jul 30 
10:35:54 2018 +0200| [97faad7f48391e4dd08b1b74e484b8f192b20c44] | committer: 
Steve Lhomme

dxva: blacklist core 2 duo related chipsets that can't even decoder 720p 
properly

(cherry picked from commit 65eed1b9df74850f41c59f29f5ddafae39839312)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=97faad7f48391e4dd08b1b74e484b8f192b20c44
---

 modules/codec/avcodec/dxva_blacklist.c | 46 +-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/dxva_blacklist.c 
b/modules/codec/avcodec/dxva_blacklist.c
index f17e2676ec..0271d862f8 100644
--- a/modules/codec/avcodec/dxva_blacklist.c
+++ b/modules/codec/avcodec/dxva_blacklist.c
@@ -40,8 +40,19 @@ struct picture_sys_t
 
 #include "directx_va.h"
 
-extern const GUID DXVA_ModeHEVC_VLD_Main;
+extern const GUID DXVA2_ModeMPEG2_VLD;
+extern const GUID DXVA2_ModeMPEG2and1_VLD;
+extern const GUID DXVA2_ModeH264_E;
+extern const GUID DXVA2_ModeH264_F;
+extern const GUID DXVA_Intel_H264_NoFGT_ClearVideo;
+extern const GUID DXVA_ModeH264_VLD_WithFMOASO_NoFGT;
+extern const GUID DXVA_ModeH264_VLD_NoFGT_Flash;
+extern const GUID DXVA2_ModeVC1_D;
+extern const GUID DXVA2_ModeVC1_D2010;
 extern const GUID DXVA_ModeHEVC_VLD_Main10;
+extern const GUID DXVA_ModeHEVC_VLD_Main;
+extern const GUID DXVA_ModeVP9_VLD_Profile0;
+extern const GUID DXVA_ModeVP9_VLD_10bit_Profile2;
 
 enum DriverTestCommand {
 BLAnyDriver,
@@ -61,6 +72,23 @@ static const GUID *NoHEVC[] = {
 NULL,
 };
 
+static const GUID *AnyDecoder[] = {
+&DXVA2_ModeMPEG2_VLD,
+&DXVA2_ModeMPEG2and1_VLD,
+&DXVA2_ModeH264_E,
+&DXVA2_ModeH264_F,
+&DXVA_Intel_H264_NoFGT_ClearVideo,
+&DXVA_ModeH264_VLD_WithFMOASO_NoFGT,
+&DXVA_ModeH264_VLD_NoFGT_Flash,
+&DXVA2_ModeVC1_D,
+&DXVA2_ModeVC1_D2010,
+&DXVA_ModeHEVC_VLD_Main,
+&DXVA_ModeHEVC_VLD_Main10,
+&DXVA_ModeVP9_VLD_Profile0,
+&DXVA_ModeVP9_VLD_10bit_Profile2,
+NULL,
+};
+
 static struct decoders IntelDevices[] = {
 /* Intel Broadwell GPUs with hybrid HEVC */
 { 0x1606, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
@@ -92,6 +120,22 @@ static struct decoders IntelDevices[] = {
 { 0x0D22, NoHEVC, BLAnyDriver, 0 }, /* Iris(TM) Pro Graphics 5200 */
 { 0x0D26, NoHEVC, BLAnyDriver, 0 }, /* Iris(TM) Pro Graphics 5200 */
 
+/* Intel Eaglelake/GMA X4500 too old to decode properly */
+{ 0x2A42, AnyDecoder, BLAnyDriver, 0 }, /* Mobile Intel(R) 4 Series 
Express Chipset Family */
+{ 0x2A43, AnyDecoder, BLAnyDriver, 0 }, /* Mobile Intel(R) 4 Series 
Express Chipset Family */
+{ 0x2E02, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) 4 Series Internal 
Chipset */
+{ 0x2E03, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) 4 Series Internal 
Chipset */
+{ 0x2E12, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) Q45/Q43 Express 
Chipset */
+{ 0x2E13, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) Q45/Q43 Express 
Chipset */
+{ 0x2E22, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) G45/G43 Express 
Chipset */
+{ 0x2E23, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) G45/G43 Express 
Chipset */
+{ 0x2E32, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) G41 Express Chipset */
+{ 0x2E33, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) G41 Express Chipset */
+{ 0x2E42, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) B43 Express Chipset */
+{ 0x2E43, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) B43 Express Chipset */
+{ 0x2E92, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) B43 Express Chipset */
+{ 0x2E93, AnyDecoder, BLAnyDriver, 0 }, /* Intel(R) B43 Express Chipset */
+
 {0, NULL, BLAnyDriver, 0}
 };
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d9: make the OS detection not dependent on the app manifest

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
07:56:11 2018 +0200| [eec002ae4d675fd4ebd2e94780f49dbd8ca5bac9] | committer: 
Steve Lhomme

direct3d9: make the OS detection not dependent on the app manifest

(cherry picked from commit 6f6803c954a8e6b4856f281dde2e0a8a93eea4e9)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=eec002ae4d675fd4ebd2e94780f49dbd8ca5bac9
---

 modules/video_output/win32/direct3d9.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c 
b/modules/video_output/win32/direct3d9.c
index f3d7773f00..a97fd59e47 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -56,7 +56,6 @@
 #include "builtin_shaders.h"
 
 #include 
-#include 
 
 /*
  * Module descriptor
@@ -252,9 +251,18 @@ static int Open(vlc_object_t *object)
 if ( !vd->obj.force && vd->source.mastering.max_luminance != 0)
 return VLC_EGENERIC; /* let a module who can handle it do it */
 
+#if !VLC_WINSTORE_APP
 /* do not use D3D9 on XP unless forced */
-if(!object->obj.force && !IsWindowsVistaOrGreater())
-return VLC_EGENERIC;
+if (!vd->obj.force)
+{
+bool isVistaOrGreater = false;
+HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+if (likely(hKernel32 != NULL))
+isVistaOrGreater = GetProcAddress(hKernel32, 
"EnumResourceLanguagesExW") != NULL;
+if (!isVistaOrGreater)
+return VLC_EGENERIC;
+}
+#endif
 
 /* Allocate structure */
 vd->sys = sys = calloc(1, sizeof(vout_display_sys_t));

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11va: don't use D3D11VA automatically on OSes older than Win8.1

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Jul 31 
15:37:34 2018 +0200| [f448a795cb7e4643e16b31ce7ec2e89753a701a0] | committer: 
Steve Lhomme

d3d11va: don't use D3D11VA automatically on OSes older than Win8.1

(cherry picked from commit 2c2eeb8e5a19bbcd35d6cea02ea3dc52e480cc7a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f448a795cb7e4643e16b31ce7ec2e89753a701a0
---

 modules/codec/avcodec/d3d11va.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 5e3b052196..f73f5dfce8 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -43,6 +43,8 @@
 #include 
 #include 
 
+#include 
+
 #define COBJMACROS
 #include 
 #include 
@@ -318,6 +320,10 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
 return VLC_EGENERIC;
 
+/* Allow using D3D11VA automatically starting from Windows 8.1 */
+if (!va->obj.force && !IsWindows8Point1OrGreater())
+return VLC_EGENERIC;
+
 vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
 if (unlikely(sys == NULL))
 return VLC_ENOMEM;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11_fmt: keep the modified build number once and for all

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jun 25 
17:32:08 2018 +0200| [6e842859cd4439864656655a35bd7ac860da8147] | committer: 
Steve Lhomme

d3d11_fmt: keep the modified build number once and for all

(cherry picked from commit 6dd231f7e007a93dace97b45cc5d015b5ebed929)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6e842859cd4439864656655a35bd7ac860da8147
---

 modules/video_chroma/d3d11_fmt.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 1eb44fe148..18738c5bd8 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -208,6 +208,11 @@ void D3D11_GetDriverVersion(vlc_object_t *obj, 
d3d11_device_t *d3d_dev)
 d3d_dev->WDDM.revision = revision;
 d3d_dev->WDDM.build= build;
 msg_Dbg(obj, "%s WDDM driver %d.%d.%d.%d", 
DxgiVendorStr(adapterDesc.VendorId), wddm, d3d_features, revision, build);
+if (adapterDesc.VendorId == GPU_MANUFACTURER_INTEL && revision >= 100)
+{
+/* new Intel driver format */
+d3d_dev->WDDM.build += (revision - 100) * 1000;
+}
 #endif
 }
 
@@ -392,13 +397,6 @@ int D3D11CheckDriverVersion(d3d11_device_t *d3d_dev, UINT 
vendorId, const struct
 if (vendorId && adapterDesc.VendorId != vendorId)
 return VLC_SUCCESS;
 
-int build = d3d_dev->WDDM.build;
-if (adapterDesc.VendorId == GPU_MANUFACTURER_INTEL && 
d3d_dev->WDDM.revision >= 100)
-{
-/* new Intel driver format */
-build += (d3d_dev->WDDM.revision - 100) * 1000;
-}
-
 if (min_ver->wddm)
 {
 if (d3d_dev->WDDM.wddm > min_ver->wddm)
@@ -422,9 +420,9 @@ int D3D11CheckDriverVersion(d3d11_device_t *d3d_dev, UINT 
vendorId, const struct
 }
 if (min_ver->build)
 {
-if (build > min_ver->build)
+if (d3d_dev->WDDM.build > min_ver->build)
 return VLC_SUCCESS;
-else if (build != min_ver->build)
+else if (d3d_dev->WDDM.build != min_ver->build)
 return VLC_EGENERIC;
 }
 return VLC_SUCCESS;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec:png: PNG are always decoded to full range

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
11:36:47 2018 +0200| [61f621c2a4d1753e04676cdccd2da9b82b477f33] | committer: 
Steve Lhomme

codec:png: PNG are always decoded to full range

Ref #19127

(cherry picked from commit 7ab4c048083661579fb620f1eee137af18ec8dc3)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=61f621c2a4d1753e04676cdccd2da9b82b477f33
---

 modules/codec/png.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index 219f355341..37d83347fe 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -125,6 +125,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 /* Set output properties */
 p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
 p_dec->fmt_out.video.transfer = TRANSFER_FUNC_SRGB;
+p_dec->fmt_out.video.b_color_range_full = true;
 
 /* Set callbacks */
 p_dec->pf_decode = DecodeBlock;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11: move the D3D11DeviceContext mutex storage in d3d11_device_t

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Thu Nov 30 
11:22:06 2017 +0100| [9aa42f5d3a39b1aba078c402149ef30eb2f5fdc0] | committer: 
Steve Lhomme

d3d11: move the D3D11DeviceContext mutex storage in d3d11_device_t

(cherry picked from commit 369cf77c1fffe86f0e8e99404f1990dd8c4c1869)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9aa42f5d3a39b1aba078c402149ef30eb2f5fdc0
---

 modules/codec/avcodec/d3d11va.c |  6 ++
 modules/hw/d3d11/d3d11_deinterlace.c| 11 +--
 modules/hw/d3d11/d3d11_filters.c| 11 +--
 modules/video_chroma/d3d11_fmt.h|  1 +
 modules/video_output/win32/direct3d11.c | 31 ++-
 5 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index aa73b0ffe7..596d3d70cb 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -111,8 +111,6 @@ struct vlc_va_sys_t
 ID3D11VideoContext   *d3dvidctx;
 DXGI_FORMAT  render;
 
-HANDLE   context_mutex;
-
 /* pool */
 picture_t*extern_pics[MAX_SURFACE_COUNT];
 
@@ -150,7 +148,7 @@ void SetupAVCodecContext(vlc_va_t *va)
 sys->hw.cfg = &sys->cfg;
 sys->hw.surface_count = dx_sys->va_pool.surface_count;
 sys->hw.surface = dx_sys->hw_surface;
-sys->hw.context_mutex = sys->context_mutex;
+sys->hw.context_mutex = sys->d3d_dev.context_mutex;
 
 if (IsEqualGUID(&dx_sys->input, &DXVA_Intel_H264_NoFGT_ClearVideo))
 sys->hw.workaround |= FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO;
@@ -353,7 +351,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
 if (FAILED(hr))
 msg_Warn(va, "No mutex found to lock the decoder");
-sys->context_mutex = context_lock;
+sys->d3d_dev.context_mutex = context_lock;
 
 sys->d3d_dev.d3dcontext = p_sys->context;
 sys->d3d_dev.owner = false;
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c 
b/modules/hw/d3d11/d3d11_deinterlace.c
index 95b901169f..97a37360e7 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -58,7 +58,6 @@ struct filter_sys_t
 ID3D11VideoProcessor   *videoProcessor;
 ID3D11VideoProcessorEnumerator *procEnumerator;
 
-HANDLE context_mutex;
 union {
 ID3D11Texture2D*outTexture;
 ID3D11Resource *outResource;
@@ -227,13 +226,13 @@ static picture_t *Deinterlace(filter_t *p_filter, 
picture_t *p_pic)
 {
 filter_sys_t *p_sys = p_filter->p_sys;
 
-if( p_sys->context_mutex != INVALID_HANDLE_VALUE )
-WaitForSingleObjectEx( p_sys->context_mutex, INFINITE, FALSE );
+if( p_sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
+WaitForSingleObjectEx( p_sys->d3d_dev.context_mutex, INFINITE, FALSE );
 
 picture_t *res = DoDeinterlacing( p_filter, &p_sys->context, p_pic );
 
-if( p_sys->context_mutex  != INVALID_HANDLE_VALUE )
-ReleaseMutex( p_sys->context_mutex );
+if( p_sys->d3d_dev.context_mutex  != INVALID_HANDLE_VALUE )
+ReleaseMutex( p_sys->d3d_dev.context_mutex );
 
 return res;
 }
@@ -385,7 +384,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
 hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
 if (FAILED(hr))
 msg_Warn(filter, "No mutex found to lock the decoder");
-sys->context_mutex = context_lock;
+sys->d3d_dev.context_mutex = context_lock;
 
 const video_format_t *fmt = &filter->fmt_out.video;
 
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index e8e543fdbf..1ac8fcf663 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -75,7 +75,6 @@ struct filter_sys_t
 ID3D11VideoProcessor   *videoProcessor;
 ID3D11VideoProcessorEnumerator *procEnumerator;
 
-HANDLE context_mutex;
 union {
 ID3D11Texture2D*texture;
 ID3D11Resource *resource;
@@ -246,8 +245,8 @@ static picture_t *Filter(filter_t *p_filter, picture_t 
*p_pic)
 
 picture_CopyProperties( p_outpic, p_pic );
 
-if( p_sys->context_mutex != INVALID_HANDLE_VALUE )
-WaitForSingleObjectEx( p_sys->context_mutex, INFINITE, FALSE );
+if( p_sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
+WaitForSingleObjectEx( p_sys->d3d_dev.context_mutex, INFINITE, FALSE );
 
 ID3D11VideoProcessorInputView *inputs[4] = {
 p_src_sys->processorInput,
@@ -318,8 +317,8 @@ static picture_t *Filter(filter_t *p_filter, picture_t 
*p_pic)
   NULL);
 }
 
-if( p_sys->co

[vlc-commits] direct3d11: use the indirect texture size

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
15:08:22 2018 +0200| [025402260df68db97a8d3c7efdb8f797e3285561] | committer: 
Steve Lhomme

direct3d11: use the indirect texture size

It can have padding for the decoder that is not known to avcodec and we don't
want to show it in vd->fmt to avoid adding a converter.

This padding needs to be taken in account when placing the picture in the 
display area.

We can get rid of the hackish BEFORE_UPDATE_RECTS/AFTER_UPDATE_RECTS macros.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=025402260df68db97a8d3c7efdb8f797e3285561
---

 modules/video_output/win32/direct3d11.c | 31 ++-
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 8b39896165..8b6bc042a9 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -499,6 +499,16 @@ static bool GetRect(const vout_display_sys_win32_t *p_sys, 
RECT *out)
 }
 #endif
 
+static unsigned int GetPictureWidth(const vout_display_t *vd)
+{
+return vd->sys->picQuad.i_width;
+}
+
+static unsigned int GetPictureHeight(const vout_display_t *vd)
+{
+return vd->sys->picQuad.i_height;
+}
+
 static int Open(vlc_object_t *object)
 {
 vout_display_t *vd = (vout_display_t *)object;
@@ -518,6 +528,8 @@ static int Open(vlc_object_t *object)
 #if VLC_WINSTORE_APP
 vd->sys->sys.pf_GetRect = GetRect;
 #endif
+vd->sys->sys.pf_GetPictureWidth  = GetPictureWidth;
+vd->sys->sys.pf_GetPictureHeight = GetPictureHeight;
 
 if (Direct3D11Open(vd)) {
 msg_Err(vd, "Direct3D11 could not be opened");
@@ -999,15 +1011,6 @@ static inline bool RectEquals(const RECT *r1, const RECT 
*r2)
r1->left == r2->left && r1->right == r2->right;
 }
 
-#define BEFORE_UPDATE_RECTS \
-unsigned int i_outside_width  = vd->fmt.i_width; \
-unsigned int i_outside_height = vd->fmt.i_height; \
-vd->fmt.i_width  = vd->sys->picQuad.i_width; \
-vd->fmt.i_height = vd->sys->picQuad.i_height;
-#define AFTER_UPDATE_RECTS \
-vd->fmt.i_width  = i_outside_width; \
-vd->fmt.i_height = i_outside_height;
-
 static int Control(vout_display_t *vd, int query, va_list args)
 {
 vout_display_sys_t *sys = vd->sys;
@@ -1015,9 +1018,7 @@ static int Control(vout_display_t *vd, int query, va_list 
args)
 RECT before_dest_clipped = sys->sys.rect_dest_clipped;
 RECT before_dest = sys->sys.rect_dest;
 
-BEFORE_UPDATE_RECTS;
 int res = CommonControl( vd, query, args );
-AFTER_UPDATE_RECTS;
 
 if (query == VOUT_DISPLAY_CHANGE_VIEWPOINT)
 {
@@ -1046,9 +1047,7 @@ static void Manage(vout_display_t *vd)
 RECT before_dest_clipped = sys->sys.rect_dest_clipped;
 RECT before_dest = sys->sys.rect_dest;
 
-BEFORE_UPDATE_RECTS;
 CommonManage(vd);
-AFTER_UPDATE_RECTS;
 
 if (!RectEquals(&before_src_clipped, &sys->sys.rect_src_clipped) ||
 !RectEquals(&before_dest_clipped, &sys->sys.rect_dest_clipped) ||
@@ -1218,9 +1217,7 @@ static void Prepare(vout_display_t *vd, picture_t 
*picture, subpicture_t *subpic
 sys->picQuad.i_height = texDesc.Height;
 sys->picQuad.i_width = texDesc.Width;
 
-BEFORE_UPDATE_RECTS;
 UpdateRects(vd, NULL, true);
-AFTER_UPDATE_RECTS;
 UpdateSize(vd);
 }
 }
@@ -2086,9 +2083,7 @@ static int Direct3D11CreateFormatResources(vout_display_t 
*vd, const video_forma
 sys->picQuad.i_height = (sys->picQuad.i_height + 0x01) & ~0x01;
 }
 
-BEFORE_UPDATE_RECTS;
 UpdateRects(vd, NULL, true);
-AFTER_UPDATE_RECTS;
 
 #ifdef HAVE_ID3D11VIDEODECODER
 if (!is_d3d11_opaque(fmt->i_chroma) || sys->legacy_shader)
@@ -2172,6 +2167,8 @@ static int 
Direct3D11CreateGenericResources(vout_display_t *vd)
 ID3D11DepthStencilState_Release(pDepthStencilState);
 }
 
+UpdateRects(vd, NULL, true);
+
 hr = UpdateBackBuffer(vd);
 if (FAILED(hr)) {
msg_Err(vd, "Could not update the backbuffer. (hr=0x%lX)", hr);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11: Store context_mutex in the DeviceContext private data

2018-08-07 Thread Hugo Beauzée-Luyssen
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen  | Tue Mar 
13 15:56:09 2018 +0100| [3bc4d221a6218c6a66fd69da2244a874d72207b0] | committer: 
Steve Lhomme

d3d11: Store context_mutex in the DeviceContext private data

And create it as soon as the DeviceContext is created so they have the same
lifetime.

(cherry picked from commit 0d7d3f6e7ab4fc3b1b962ed9d304d81d88df6a4e)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3bc4d221a6218c6a66fd69da2244a874d72207b0
---

 modules/codec/avcodec/d3d11va.c |  2 +-
 modules/hw/d3d11/d3d11_deinterlace.c|  2 +-
 modules/hw/d3d11/d3d11_filters.c|  2 +-
 modules/video_chroma/d3d11_fmt.c| 20 
 modules/video_output/win32/direct3d11.c | 13 -
 5 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 596d3d70cb..5ab8fd2b8b 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -348,7 +348,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum 
PixelFormat pix_fmt,
 ID3D11DeviceContext_GetDevice( p_sys->context, 
&sys->d3d_dev.d3ddevice );
 HANDLE context_lock = INVALID_HANDLE_VALUE;
 UINT dataSize = sizeof(context_lock);
-hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
+hr = ID3D11DeviceContext_GetPrivateData(p_sys->context, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
 if (FAILED(hr))
 msg_Warn(va, "No mutex found to lock the decoder");
 sys->d3d_dev.context_mutex = context_lock;
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c 
b/modules/hw/d3d11/d3d11_deinterlace.c
index 4eb4f1df1e..3d3ec0f393 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -379,7 +379,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
 
 HANDLE context_lock = INVALID_HANDLE_VALUE;
 UINT dataSize = sizeof(context_lock);
-hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
+hr = ID3D11DeviceContext_GetPrivateData(sys->d3d_dev.d3dcontext, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
 if (FAILED(hr))
 msg_Warn(filter, "No mutex found to lock the decoder");
 sys->d3d_dev.context_mutex = context_lock;
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 1ee51e2c9d..4a287681d5 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -380,7 +380,7 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
 
 HANDLE context_lock = INVALID_HANDLE_VALUE;
 UINT dataSize = sizeof(context_lock);
-hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
+hr = ID3D11DeviceContext_GetPrivateData(sys->d3d_dev.d3dcontext, 
&GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
 if (FAILED(hr))
 msg_Warn(filter, "No mutex found to lock the decoder");
 sys->d3d_dev.context_mutex = context_lock;
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 18d9345f00..1eb44fe148 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -20,6 +20,11 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  */
 
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
+# undef _WIN32_WINNT
+# define _WIN32_WINNT _WIN32_WINNT_WIN7
+#endif
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -219,6 +224,13 @@ void D3D11_ReleaseDevice(d3d11_device_t *d3d_dev)
 ID3D11Device_Release(d3d_dev->d3ddevice);
 d3d_dev->d3ddevice = NULL;
 }
+#if defined(HAVE_ID3D11VIDEODECODER)
+if( d3d_dev->owner && d3d_dev->context_mutex != INVALID_HANDLE_VALUE )
+{
+CloseHandle( d3d_dev->context_mutex );
+d3d_dev->context_mutex = INVALID_HANDLE_VALUE;
+}
+#endif
 }
 
 #undef D3D11_CreateDevice
@@ -289,7 +301,15 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, 
d3d11_handle_t *hd3d,
 }
 
 if (SUCCEEDED(hr))
+{
+#if defined(HAVE_ID3D11VIDEODECODER)
+out->context_mutex = CreateMutexEx( NULL, NULL, 0, SYNCHRONIZE );
+ID3D11DeviceContext_SetPrivateData( out->d3dcontext, 
&GUID_CONTEXT_MUTEX,
+sizeof( out->context_mutex ), 
&out->context_mutex );
+#endif
+
 out->owner = true;
+}
 
 return hr;
 }
diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 0e65436600..9939f4b929 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2125,12 +2125,6 @@ static int 
Direct3D11CreateGenericResources(vout_display_t *vd)
 vout_display_sys_t *sys = vd->sys;
 HRESULT hr;

[vlc-commits] codec:jpeg: set the decoder output to sRGB

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jul 30 
15:35:10 2018 +0200| [7f62b64b6468907185c8582382b44700845788dc] | committer: 
Steve Lhomme

codec:jpeg: set the decoder output to sRGB

That's how the decoder is configured in line 522

Ref #19127

(cherry picked from commit 8dc281d2d01e5dfefbe4087c5bc9bec3e5601906)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7f62b64b6468907185c8582382b44700845788dc
---

 modules/codec/jpeg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/jpeg.c b/modules/codec/jpeg.c
index 2c0224cc63..51fa6e65f3 100644
--- a/modules/codec/jpeg.c
+++ b/modules/codec/jpeg.c
@@ -178,6 +178,7 @@ static int OpenDecoder(vlc_object_t *p_this)
 p_dec->pf_decode = DecodeBlock;
 
 p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
+p_dec->fmt_out.video.transfer = TRANSFER_FUNC_SRGB;
 
 return VLC_SUCCESS;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec:jpeg: JPEG are always decoded to full range

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
11:43:11 2018 +0200| [dbe172ceb6dcf13801671212e6980ed940930b80] | committer: 
Steve Lhomme

codec:jpeg: JPEG are always decoded to full range

Ref #19127

(cherry picked from commit 7a64f68ac92617c40d62adbe7bae6749c89f48b5)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=dbe172ceb6dcf13801671212e6980ed940930b80
---

 modules/codec/jpeg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/jpeg.c b/modules/codec/jpeg.c
index 51fa6e65f3..7b631acf47 100644
--- a/modules/codec/jpeg.c
+++ b/modules/codec/jpeg.c
@@ -179,6 +179,7 @@ static int OpenDecoder(vlc_object_t *p_this)
 
 p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
 p_dec->fmt_out.video.transfer = TRANSFER_FUNC_SRGB;
+p_dec->fmt_out.video.b_color_range_full = true;
 
 return VLC_SUCCESS;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vout: win32: direct3d11: fixup of d1e7dc1

2018-08-07 Thread Filip Roséen
vlc/vlc-3.0 | branch: master | Filip Roséen  | Tue Jul 31 
11:58:29 2018 +0200| [7cc7c08c7f6854011b7f6627b8704b17dd939fc6] | committer: 
Steve Lhomme

vout: win32: direct3d11: fixup of d1e7dc1

As d1e7dc1 explicitly adds copying of the relevant fmt after the
function is called, the function itself should not be part of such
copying (to make matters worse, shallow copy is unsafe as the struct
may contain pointers to dynamically allocated resources).

fixes: #20487

Signed-off-by: Steve Lhomme 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7cc7c08c7f6854011b7f6627b8704b17dd939fc6
---

 modules/video_output/win32/direct3d11.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 8b6bc042a9..792c8e5365 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1691,7 +1691,6 @@ static int SetupOutputFormat(vout_display_t *vd, 
video_format_t *fmt)
 Direct3D11DestroyResources(vd);
 return VLC_EGENERIC;
 }
-vd->fmt = *fmt;
 
 return VLC_SUCCESS;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hw:d3d11: fix texture leak

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Feb 26 
11:54:39 2018 +0100| [a4a859994439334a32302989d67f7036cac03d8e] | committer: 
Steve Lhomme

hw:d3d11: fix texture leak

(cherry picked from commit 3f922c78203d08ac6ee6a3a8502148f6d5ec2265)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a4a859994439334a32302989d67f7036cac03d8e
---

 modules/hw/d3d11/d3d11_surface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 44235b78ed..62f33749fa 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -841,6 +841,9 @@ void D3D11CloseConverter( vlc_object_t *obj )
 filter_t *p_filter = (filter_t *)obj;
 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 #if CAN_PROCESSOR
+if (p_sys->procOutTexture)
+ID3D11Texture2D_Release(p_sys->procOutTexture);
+
 if (p_sys->d3dviddev)
 ID3D11VideoDevice_Release(p_sys->d3dviddev);
 if (p_sys->d3dvidctx)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] screen:win32: screen capture is in sRGB and full range

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Fri Aug  3 
07:18:31 2018 +0200| [69f7edf9e9ea271a79fa503d22f96475b2ec1d67] | committer: 
Steve Lhomme

screen:win32: screen capture is in sRGB and full range

The same should probably be done on other screen capture sources but the actual
values may be check with an API for some of them. The Windows HDC API doesn't
provide that.

Fixes #20956

(cherry picked from commit 24627b49a8e239748a0bd6c60e0a93f8841cf590)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=69f7edf9e9ea271a79fa503d22f96475b2ec1d67
---

 modules/access/screen/win32.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c
index 6b94def13f..d64eada92b 100644
--- a/modules/access/screen/win32.c
+++ b/modules/access/screen/win32.c
@@ -133,6 +133,8 @@ int screen_InitCapture( demux_t *p_demux )
 p_sys->fmt.video.i_bits_per_pixel = i_bits_per_pixel;
 p_sys->fmt.video.i_sar_num = p_sys->fmt.video.i_sar_den = 1;
 p_sys->fmt.video.i_chroma = i_chroma;
+p_sys->fmt.video.transfer = TRANSFER_FUNC_SRGB;
+p_sys->fmt.video.b_color_range_full = true;
 
 switch( i_chroma )
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d11_fmt: add helpers to lock/unlock the D3D11VideoContext

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Thu Nov 30 
14:20:47 2017 +0100| [fb14e6ed2046605d2b85233c3e153b4b6df4eb59] | committer: 
Steve Lhomme

d3d11_fmt: add helpers to lock/unlock the D3D11VideoContext

(cherry picked from commit 717daca1c62f298902db807ae6eee82a32d6890d)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=fb14e6ed2046605d2b85233c3e153b4b6df4eb59
---

 modules/hw/d3d11/d3d11_deinterlace.c|  6 ++
 modules/hw/d3d11/d3d11_filters.c|  8 +++-
 modules/video_chroma/d3d11_fmt.h| 12 
 modules/video_output/win32/direct3d11.c | 29 +++--
 4 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c 
b/modules/hw/d3d11/d3d11_deinterlace.c
index 97a37360e7..4eb4f1df1e 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -226,13 +226,11 @@ static picture_t *Deinterlace(filter_t *p_filter, 
picture_t *p_pic)
 {
 filter_sys_t *p_sys = p_filter->p_sys;
 
-if( p_sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
-WaitForSingleObjectEx( p_sys->d3d_dev.context_mutex, INFINITE, FALSE );
+d3d11_device_lock( &p_sys->d3d_dev );
 
 picture_t *res = DoDeinterlacing( p_filter, &p_sys->context, p_pic );
 
-if( p_sys->d3d_dev.context_mutex  != INVALID_HANDLE_VALUE )
-ReleaseMutex( p_sys->d3d_dev.context_mutex );
+d3d11_device_unlock( &p_sys->d3d_dev );
 
 return res;
 }
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 1ac8fcf663..1ee51e2c9d 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -245,9 +245,6 @@ static picture_t *Filter(filter_t *p_filter, picture_t 
*p_pic)
 
 picture_CopyProperties( p_outpic, p_pic );
 
-if( p_sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
-WaitForSingleObjectEx( p_sys->d3d_dev.context_mutex, INFINITE, FALSE );
-
 ID3D11VideoProcessorInputView *inputs[4] = {
 p_src_sys->processorInput,
 p_sys->procInput[0],
@@ -262,6 +259,8 @@ static picture_t *Filter(filter_t *p_filter, picture_t 
*p_pic)
 p_sys->procOutput[1]
 };
 
+d3d11_device_lock( &p_sys->d3d_dev );
+
 size_t idx = 0, count = 0;
 /* contrast */
 if ( ApplyFilter( p_sys,
@@ -317,8 +316,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t 
*p_pic)
   NULL);
 }
 
-if( p_sys->d3d_dev.context_mutex  != INVALID_HANDLE_VALUE )
-ReleaseMutex( p_sys->d3d_dev.context_mutex );
+d3d11_device_unlock( &p_sys->d3d_dev );
 
 picture_Release( p_pic );
 return p_outpic;
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 0c2a3b04ef..8f1dc5ba0e 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -139,4 +139,16 @@ void D3D11_LogProcessorSupport(vlc_object_t*, 
ID3D11VideoProcessorEnumerator*);
 #define D3D11_LogProcessorSupport(a,b) D3D11_LogProcessorSupport( 
VLC_OBJECT(a), b )
 #endif
 
+static inline void d3d11_device_lock(d3d11_device_t *d3d_dev)
+{
+if( d3d_dev->context_mutex != INVALID_HANDLE_VALUE )
+WaitForSingleObjectEx( d3d_dev->context_mutex, INFINITE, FALSE );
+}
+
+static inline void d3d11_device_unlock(d3d11_device_t *d3d_dev)
+{
+if( d3d_dev->context_mutex  != INVALID_HANDLE_VALUE )
+ReleaseMutex( d3d_dev->context_mutex );
+}
+
 #endif /* include-guard */
diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 268f710db1..0e65436600 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -983,24 +983,14 @@ static void UpdateSize(vout_display_t *vd)
 
 UpdateBackBuffer(vd);
 
-#if defined(HAVE_ID3D11VIDEODECODER)
-if( sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
-{
-WaitForSingleObjectEx( sys->d3d_dev.context_mutex, INFINITE, FALSE );
-}
-#endif
+d3d11_device_lock( &sys->d3d_dev );
 
 UpdatePicQuadPosition(vd);
 
 UpdateQuadPosition(vd, &sys->picQuad, &sys->sys.rect_src_clipped,
vd->fmt.orientation);
 
-#if defined(HAVE_ID3D11VIDEODECODER)
-if( sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE )
-{
-ReleaseMutex( sys->d3d_dev.context_mutex );
-}
-#endif
+d3d11_device_unlock( &sys->d3d_dev );
 }
 
 static inline bool RectEquals(const RECT *r1, const RECT *r2)
@@ -1188,10 +1178,9 @@ static void Prepare(vout_display_t *vd, picture_t 
*picture, subpicture_t *subpic
 {
 picture_sys_t *p_sys = ActivePictureSys(picture);
 
-#if defined(HAVE_ID3D11VIDEODECODER)
-if (sys->d3d_dev.context_mutex != INVALID_HANDLE_VALUE && 
is_d3d11_opaque(picture->format.i_chroma))
-WaitForSingleObjectEx( sys->d3d_dev.context_mutex, INFINITE, FALSE 
);
-#endif
+if (is_d3d11_opaque(picture->format.i_chroma))
+   

[vlc-commits] avcodec: add a specific source file to handle GPU blacklisting

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jun 25 
15:00:37 2018 +0200| [9b2310cfd092fa0bd63a77824d934655990633eb] | committer: 
Steve Lhomme

avcodec: add a specific source file to handle GPU blacklisting

(cherry picked from commit ec1313ce0a5a5b9c54f0fa94d0d11afe06de4a0e)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9b2310cfd092fa0bd63a77824d934655990633eb
---

 modules/codec/Makefile.am  |  6 ++-
 modules/codec/avcodec/directx_va.c | 49 ---
 modules/codec/avcodec/dxva_blacklist.c | 88 ++
 3 files changed, 92 insertions(+), 51 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 10132a92f3..6a534c259a 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -432,7 +432,8 @@ libdxva2_plugin_la_SOURCES = \
codec/avcodec/dxva2.c codec/avcodec/directx_va.c 
codec/avcodec/directx_va.h \
codec/avcodec/va_surface.c codec/avcodec/va_surface.h 
codec/avcodec/va_surface_internal.h \
packetizer/h264_nal.c packetizer/h264_nal.h \
-   packetizer/hevc_nal.c packetizer/hevc_nal.h
+   packetizer/hevc_nal.c packetizer/hevc_nal.h \
+   codec/avcodec/dxva_blacklist.c
 libdxva2_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) -lshlwapi -luuid
 if HAVE_AVCODEC_DXVA2
 codec_LTLIBRARIES += libdxva2_plugin.la
@@ -449,7 +450,8 @@ libd3d11va_plugin_la_SOURCES = \
codec/avcodec/d3d11va.c codec/avcodec/directx_va.c 
codec/avcodec/directx_va.h \
 codec/avcodec/va_surface.c codec/avcodec/va_surface.h 
codec/avcodec/va_surface_internal.h \
packetizer/h264_nal.c packetizer/h264_nal.h \
-   packetizer/hevc_nal.c packetizer/hevc_nal.h
+   packetizer/hevc_nal.c packetizer/hevc_nal.h \
+   codec/avcodec/dxva_blacklist.c
 libd3d11va_plugin_la_LIBADD = libd3d11_common.la $(LIBCOM) -luuid
 if HAVE_WINSTORE
 libd3d11va_plugin_la_LIBADD += -ld3d11
diff --git a/modules/codec/avcodec/directx_va.c 
b/modules/codec/avcodec/directx_va.c
index fc5b88c28c..9de31587e3 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -447,52 +447,3 @@ static int FindVideoServiceConversion(vlc_va_t *va, 
directx_sys_t *dx_sys,
 p_list.pf_release(&p_list);
 return err;
 }
-
-static UINT hevc_blacklist[] = {
-/* Intel Broadwell GPUs with hybrid HEVC */
-0x1606, /* HD Graphics */
-0x160E, /* HD Graphics */
-0x1612, /* HD Graphics 5600 */
-0x1616, /* HD Graphics 5500 */
-0x161A, /* HD Graphics P5700 */
-0x161E, /* HD Graphics 5300 */
-0x1622, /* Iris Pro Graphics 6200 */
-0x1626, /* HD Graphics 6000 */
-0x162A, /* Iris Pro Graphics P6300 */
-0x162B, /* Iris Graphics 6100 */
-
-0x0402, /* HD Graphics */
-0x0406, /* HD Graphics */
-0x040A, /* HD Graphics */
-0x0412, /* HD Graphics 4600 */
-0x0416, /* HD Graphics 4600 */
-0x041E, /* HD Graphics 4400 */
-0x041A, /* HD Graphics P4600/P4700 */
-
-0x0A06, /* HD Graphics */
-0x0A0E, /* HD Graphics */
-0x0A16, /* HD Graphics Family */
-0x0A1E, /* HD Graphics Family */
-0x0A26, /* HD Graphics 5000 */
-0x0A2E, /* Iris(TM) Graphics 5100 */
-
-0x0D22, /* Iris(TM) Pro Graphics 5200 */
-0x0D26, /* Iris(TM) Pro Graphics 5200 */
-};
-
-bool directx_va_canUseHevc(vlc_va_t *va, UINT DeviceId)
-{
-if (va->obj.force)
-return true;
-
-for (size_t i=0; i
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include 
+#include 
+#include 
+
+#define D3D_DecoderType IUnknown
+#define D3D_DecoderDevice   IUnknown
+#define D3D_DecoderSurface  IUnknown
+
+struct picture_sys_t
+{
+void *dummy;
+};
+
+#include "directx_va.h"
+
+static UINT hevc_blacklist[] = {
+/* Intel Broadwell GPUs with hybrid HEVC */
+0x1606, /* HD Graphics */
+0x160E, /* HD Graphics */
+0x1612, /* HD Graphics 5600 */
+0x1616, /* HD Graphics 5500 */
+0x161A, /* HD Graphics P5700 */
+0x161E, /* HD Graphics 5300 */
+0x1622, /* Iris Pro Graphics 6200 */
+0x1626, /* HD Graphics 6000 */
+0x162A, /* Iris Pro Graphics P6300 */
+0x162B, /*

[vlc-commits] dxva: allow per-vendor HEVC black listing

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jun 25 
15:20:57 2018 +0200| [cc7d112d68fc73a415857898d77958c343ec0e1e] | committer: 
Steve Lhomme

dxva: allow per-vendor HEVC black listing

(cherry picked from commit 9daba7a1f7f7c793fd36cbd5c0409c8b350c929c)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cc7d112d68fc73a415857898d77958c343ec0e1e
---

 modules/codec/avcodec/d3d11va.c|  5 +
 modules/codec/avcodec/directx_va.h |  2 +-
 modules/codec/avcodec/dxva2.c  |  5 +
 modules/codec/avcodec/dxva_blacklist.c | 29 -
 4 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 5ab8fd2b8b..ad742a487c 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -557,10 +557,7 @@ static bool CanUseIntelHEVC(vlc_va_t *va)
 if (FAILED(hr))
 return false;
 
-if (adapterDesc.VendorId != GPU_MANUFACTURER_INTEL)
-return true;
-
-return directx_va_canUseHevc( va, adapterDesc.DeviceId );
+return directx_va_canUseHevc( va, adapterDesc.VendorId, 
adapterDesc.DeviceId );
 }
 
 static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t 
*fmt)
diff --git a/modules/codec/avcodec/directx_va.h 
b/modules/codec/avcodec/directx_va.h
index 74c7443539..635d8e6eb6 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -82,6 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *);
 void directx_va_Close(vlc_va_t *, directx_sys_t *);
 int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, 
const es_format_t *, int flag_xbox);
 char *directx_va_GetDecoderName(const GUID *guid);
-bool directx_va_canUseHevc(vlc_va_t *, UINT DeviceId);
+bool directx_va_canUseHevc(vlc_va_t *, UINT VendorId, UINT DeviceId);
 
 #endif /* AVCODEC_DIRECTX_VA_H */
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 6ec00e3dcc..eba36a8b14 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -506,10 +506,7 @@ static bool CanUseIntelHEVC(vlc_va_t *va)
 if (FAILED(hr))
 return false;
 
-if (identifier.VendorId != GPU_MANUFACTURER_INTEL)
-return true;
-
-return directx_va_canUseHevc( va, identifier.DeviceId );
+return directx_va_canUseHevc( va, identifier.VendorId, identifier.DeviceId 
);
 }
 
 static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t 
*fmt)
diff --git a/modules/codec/avcodec/dxva_blacklist.c 
b/modules/codec/avcodec/dxva_blacklist.c
index bf8b5ccf46..b7abcf3e3d 100644
--- a/modules/codec/avcodec/dxva_blacklist.c
+++ b/modules/codec/avcodec/dxva_blacklist.c
@@ -27,6 +27,8 @@
 #include 
 #include 
 
+#include "../../video_chroma/dxgi_fmt.h"
+
 #define D3D_DecoderType IUnknown
 #define D3D_DecoderDevice   IUnknown
 #define D3D_DecoderSurface  IUnknown
@@ -38,7 +40,7 @@ struct picture_sys_t
 
 #include "directx_va.h"
 
-static UINT hevc_blacklist[] = {
+static UINT IntelDevices[] = {
 /* Intel Broadwell GPUs with hybrid HEVC */
 0x1606, /* HD Graphics */
 0x160E, /* HD Graphics */
@@ -68,19 +70,36 @@ static UINT hevc_blacklist[] = {
 
 0x0D22, /* Iris(TM) Pro Graphics 5200 */
 0x0D26, /* Iris(TM) Pro Graphics 5200 */
+0
+};
+
+static struct {
+UINT vendor;
+const UINT *devices;
+} hevc_blacklist[] = {
+{ .vendor = GPU_MANUFACTURER_INTEL, .devices = IntelDevices },
 };
 
-bool directx_va_canUseHevc(vlc_va_t *va, UINT DeviceId)
+bool directx_va_canUseHevc(vlc_va_t *va, UINT VendorId, UINT DeviceId)
 {
 if (va->obj.force)
 return true;
 
 for (size_t i=0; ihttps://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vout:win32: read the picture pool size indirectly

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
15:03:23 2018 +0200| [6f51b19abfa7ea811ef679c13e050c5b9554e998] | committer: 
Steve Lhomme

vout:win32: read the picture pool size indirectly

This allows overriding if the internal size is not set in vd->fmt (to avoid
a converter being added if some padding is added internally).

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6f51b19abfa7ea811ef679c13e050c5b9554e998
---

 modules/video_output/win32/common.c | 16 ++--
 modules/video_output/win32/common.h |  2 ++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/common.c 
b/modules/video_output/win32/common.c
index f4787d20c3..ca7c5401e6 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -61,6 +61,16 @@ static bool GetRect(const vout_display_sys_t *sys, RECT *out)
 }
 #endif
 
+static unsigned int GetPictureWidth(const vout_display_t *vd)
+{
+return vd->fmt.i_width;
+}
+
+static unsigned int GetPictureHeight(const vout_display_t *vd)
+{
+return vd->fmt.i_height;
+}
+
 /* */
 int CommonInit(vout_display_t *vd)
 {
@@ -74,6 +84,8 @@ int CommonInit(vout_display_t *vd)
 sys->is_first_display = true;
 sys->is_on_top= false;
 
+sys->pf_GetPictureWidth  = GetPictureWidth;
+sys->pf_GetPictureHeight = GetPictureHeight;
 #if !VLC_WINSTORE_APP
 sys->pf_GetRect = GetRect;
 SetRectEmpty(&sys->rect_display);
@@ -267,8 +279,8 @@ void UpdateRects(vout_display_t *vd,
 /* src image dimensions */
 rect_src.left = 0;
 rect_src.top = 0;
-rect_src.right = vd->fmt.i_width;
-rect_src.bottom = vd->fmt.i_height;
+rect_src.right = sys->pf_GetPictureWidth(vd);
+rect_src.bottom = sys->pf_GetPictureHeight(vd);
 
 /* Clip the source image */
 rect_src_clipped.left = source->i_x_offset +
diff --git a/modules/video_output/win32/common.h 
b/modules/video_output/win32/common.h
index 0fb4e93c02..f3e912845b 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -80,6 +80,8 @@ typedef struct vout_display_sys_win32_t
 int  i_align_dest_size;
 
 bool (*pf_GetRect)(const struct vout_display_sys_win32_t *p_sys, RECT 
*out);
+unsigned int (*pf_GetPictureWidth) (const vout_display_t *);
+unsigned int (*pf_GetPictureHeight)(const vout_display_t *);
 } vout_display_sys_win32_t;
 
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hw:d3d11: fix crash in D3D11_NV12

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Feb 26 
12:17:26 2018 +0100| [6487a7f1712a0e604cee1f43d7b6c7c213b40c10] | committer: 
Steve Lhomme

hw:d3d11: fix crash in D3D11_NV12

The source may not always come from a decoder

(cherry picked from commit 6fc9c9f63eeb5ff4c86dbcf8e44209f283f93007)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6487a7f1712a0e604cee1f43d7b6c7c213b40c10
---

 modules/hw/d3d11/d3d11_surface.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 62f33749fa..268ff3073d 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -435,11 +435,16 @@ static void D3D11_NV12(filter_t *p_filter, picture_t 
*src, picture_t *dst)
 return;
 }
 
-D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;
-ID3D11VideoDecoderOutputView_GetDesc( p_sys->decoder, &viewDesc );
-
+UINT srcSlice;
+if (!p_sys->decoder)
+srcSlice = p_sys->slice_index;
+else
+{
+D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;
+ID3D11VideoDecoderOutputView_GetDesc( p_sys->decoder, &viewDesc );
+srcSlice = viewDesc.Texture2D.ArraySlice;
+}
 ID3D11Resource *srcResource = p_sys->resource[KNOWN_DXGI_INDEX];
-UINT srcSlice = viewDesc.Texture2D.ArraySlice;
 
 #if CAN_PROCESSOR
 if (sys->procEnumerator)
@@ -451,7 +456,7 @@ static void D3D11_NV12(filter_t *p_filter, picture_t *src, 
picture_t *dst)
 .FourCC = 0,
 .ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D,
 .Texture2D.MipSlice = 0,
-.Texture2D.ArraySlice = viewDesc.Texture2D.ArraySlice,
+.Texture2D.ArraySlice = srcSlice,
 };
 
 hr = 
ID3D11VideoDevice_CreateVideoProcessorInputView(sys->d3dviddev,

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d11: fix crash when resource allocation fails

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Wed Aug  1 
14:09:12 2018 +0200| [98de307c0aecd357dd24cb429c80730a8961d8f5] | committer: 
Steve Lhomme

direct3d11: fix crash when resource allocation fails

We release the staging picture twice which is not supported.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=98de307c0aecd357dd24cb429c80730a8961d8f5
---

 modules/video_output/win32/direct3d11.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 792c8e5365..d9834bb8c7 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1613,7 +1613,6 @@ static int Direct3D11Open(vout_display_t *vd)
 
 if (Direct3D11CreateGenericResources(vd)) {
 msg_Err(vd, "Failed to allocate resources");
-Direct3D11DestroyResources(vd);
 return VLC_EGENERIC;
 }
 
@@ -1688,7 +1687,6 @@ static int SetupOutputFormat(vout_display_t *vd, 
video_format_t *fmt)
 
 if (Direct3D11CreateFormatResources(vd, fmt)) {
 msg_Err(vd, "Failed to allocate format resources");
-Direct3D11DestroyResources(vd);
 return VLC_EGENERIC;
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] direct3d11: Lock the device context mutex when presenting the swapchain

2018-08-07 Thread Hugo Beauzée-Luyssen
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen  | Tue Mar 
13 16:55:01 2018 +0100| [c848e040286dcc8cd324eab20eef5d813996bb41] | committer: 
Steve Lhomme

direct3d11: Lock the device context mutex when presenting the swapchain

(cherry picked from commit 572d2a87f6733baf2f6c0dae01b2200497fd7b8b)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c848e040286dcc8cd324eab20eef5d813996bb41
---

 modules/video_output/win32/direct3d11.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 9939f4b929..8b39896165 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1296,12 +1296,14 @@ static void Display(vout_display_t *vd, picture_t 
*picture, subpicture_t *subpic
 
 DXGI_PRESENT_PARAMETERS presentParams;
 memset(&presentParams, 0, sizeof(presentParams));
+d3d11_device_lock( &sys->d3d_dev );
 HRESULT hr = IDXGISwapChain1_Present1(sys->dxgiswapChain, 0, 0, 
&presentParams);
 if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
 {
 /* TODO device lost */
 msg_Dbg(vd, "SwapChain Present failed. (hr=0x%lX)", hr);
 }
+d3d11_device_unlock( &sys->d3d_dev );
 
 picture_Release(picture);
 if (subpicture)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec:png: set the default transfer function to sRGB

2018-08-07 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Mon Jul 30 
15:12:43 2018 +0200| [a01c757ee2515d7f0ac75b8f80874e74b7b6b633] | committer: 
Steve Lhomme

codec:png: set the default transfer function to sRGB

See line 266

Ref #19127

(cherry picked from commit c533dfd94064fef221bca5550cdd898079882b30)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a01c757ee2515d7f0ac75b8f80874e74b7b6b633
---

 modules/codec/png.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index e9bc71c6a7..219f355341 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -124,6 +124,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
 /* Set output properties */
 p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
+p_dec->fmt_out.video.transfer = TRANSFER_FUNC_SRGB;
 
 /* Set callbacks */
 p_dec->pf_decode = DecodeBlock;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits