[vlc-commits] macosx: FIXME for ModuleListConfigControl's resetValues
vlc | branch: master | Marvin Scholz| Fri Nov 24 02:19:44 2017 +0100| [525fbd67d34cb9137345ea84da8daa432f0d367c] | committer: Marvin Scholz macosx: FIXME for ModuleListConfigControl's resetValues > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=525fbd67d34cb9137345ea84da8daa432f0d367c --- modules/gui/macosx/prefs_widgets.m | 6 ++ 1 file changed, 6 insertions(+) diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m index 8d137af46b..29900aa3fc 100644 --- a/modules/gui/macosx/prefs_widgets.m +++ b/modules/gui/macosx/prefs_widgets.m @@ -2133,6 +2133,12 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\ return strdup([[o_textfield stringValue] UTF8String]); } +/* FIXME: + * This is supposed to load the module list state from preferences + * and set the table items state (selected or unselected) accordingly, + * as far as I could figure out by reading the commit in which this was + * introduced. (d66f3c874786e9dd4692f9775bdd54b386c583dd) + */ -(void)resetValues { #warning Reset prefs of the module selector is broken atm. ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dxva2: fix crash if dxva2.dll is not present (winXP)
vlc | branch: master | Pierre Lamot| Thu Nov 23 15:24:11 2017 +0100| [fe367b762364e7935f7cc541370234e712e6a129] | committer: Jean-Baptiste Kempf dxva2: fix crash if dxva2.dll is not present (winXP) Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe367b762364e7935f7cc541370234e712e6a129 --- modules/codec/avcodec/dxva2.c | 5 + 1 file changed, 5 insertions(+) diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c index f6ecc020e7..197116a1bd 100644 --- a/modules/codec/avcodec/dxva2.c +++ b/modules/codec/avcodec/dxva2.c @@ -239,6 +239,8 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) static void Close(vlc_va_t *va, void **ctx) { vlc_va_sys_t *sys = va->sys; +if ( sys == NULL ) +return; (void) ctx; @@ -269,6 +271,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, /* Load dll*/ if (D3D9_Create(va, >hd3d) != VLC_SUCCESS) { msg_Warn(va, "cannot load d3d9.dll"); +free( sys ); goto error; } @@ -276,6 +279,8 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, sys->dxva2_dll = LoadLibrary(TEXT("DXVA2.DLL")); if (!sys->dxva2_dll) { msg_Warn(va, "cannot load DXVA2 decoder DLL"); +D3D9_Destroy( >hd3d ); +free( sys ); goto error; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] Qt: fix a wrong logic for the check of the fullscreen screen number
vlc | branch: master | Adrien Maglo| Thu Nov 23 17:40:13 2017 +0100| [cd6598579be9e5e0cf4c6d38ff31fdffb2cf5e79] | committer: Jean-Baptiste Kempf Qt: fix a wrong logic for the check of the fullscreen screen number Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd6598579be9e5e0cf4c6d38ff31fdffb2cf5e79 --- modules/gui/qt/components/controller.cpp | 2 +- modules/gui/qt/main_interface.cpp| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp index 08a08d2212..2a732d1f12 100644 --- a/modules/gui/qt/components/controller.cpp +++ b/modules/gui/qt/components/controller.cpp @@ -986,7 +986,7 @@ void FullscreenControllerWidget::toggleFullwidth() int FullscreenControllerWidget::targetScreen() { -if( i_screennumber < 0 || i_screennumber > QApplication::desktop()->screenCount() ) +if( i_screennumber < 0 || i_screennumber >= QApplication::desktop()->screenCount() ) return QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi ); return i_screennumber; } diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp index 787abbf81f..3fbd58e5eb 100644 --- a/modules/gui/qt/main_interface.cpp +++ b/modules/gui/qt/main_interface.cpp @@ -860,7 +860,7 @@ void MainInterface::setVideoFullScreen( bool fs ) * than current number of screens, take screennumber where current interface * is */ -if( numscreen == -1 || numscreen > QApplication::desktop()->screenCount() ) +if( numscreen < 0 || numscreen >= QApplication::desktop()->screenCount() ) numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi ); QRect screenres = QApplication::desktop()->screenGeometry( numscreen ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mkv: only allow one video track at a time
vlc | branch: master | Steve Lhomme| Thu Nov 23 15:25:39 2017 +0100| [32ab4fc98d97b6b0cb1728be79ebbd74d19b3e79] | committer: Jean-Baptiste Kempf mkv: only allow one video track at a time This is how Matroska is supposed to work Fixes #19129 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=32ab4fc98d97b6b0cb1728be79ebbd74d19b3e79 --- modules/demux/mkv/matroska_segment.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp index 58de05f464..52be3711c7 100644 --- a/modules/demux/mkv/matroska_segment.cpp +++ b/modules/demux/mkv/matroska_segment.cpp @@ -1108,6 +1108,8 @@ bool matroska_segment_c::ESCreate() { /* add all es */ msg_Dbg( , "found %d es", static_cast( tracks.size() ) ); +es_out_Control( sys.demuxer.out, ES_OUT_SET_ES_CAT_POLICY, VIDEO_ES, +ES_OUT_ES_POLICY_EXCLUSIVE ); for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it ) { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] includes/aout: fix incorrect mention of 24-bit support
vlc | branch: master | Lyndon Brown| Wed May 24 21:18:44 2017 +0100| [9e64d40264f126ac02f3cd645af2deb348616578] | committer: Jean-Baptiste Kempf includes/aout: fix incorrect mention of 24-bit support Left over from 8d73a4d79b1fe7423d07d106281a96393f60115c Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9e64d40264f126ac02f3cd645af2deb348616578 --- include/vlc_aout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vlc_aout.h b/include/vlc_aout.h index db9ec90bfc..5e5690fb1d 100644 --- a/include/vlc_aout.h +++ b/include/vlc_aout.h @@ -273,7 +273,7 @@ VLC_API bool aout_CheckChannelExtraction( int *pi_selection, uint32_t *pi_layout * aout_CheckChannelExtraction. * * XXX this function does not work in place (p_dst and p_src must not overlap). - * XXX Only 8, 16, 24, 32, 64 bits per sample are supported. + * XXX Only 8, 16, 32, 64 bits per sample are supported. */ VLC_API void aout_ChannelExtract( void *p_dst, int i_dst_channels, const void *p_src, int i_src_channels, int i_sample_count, const int *pi_selection, int i_bits_per_sample ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] httpd: Remove obsolete enum
vlc | branch: master | Lyndon Brown| Wed Aug 16 16:46:39 2017 +0100| [2e65002479e64839c16e65101ebd6e4a50341690] | committer: Jean-Baptiste Kempf httpd: Remove obsolete enum Un-named enum contains HTTPD_CLIENT_FILE and HTTPD_CLIENT_STREAM, which became obsolete in 56ee33a212e60fecf7b0e075b67618e3e4744df2, replaced with the b_stream_mode boolean. Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2e65002479e64839c16e65101ebd6e4a50341690 --- src/network/httpd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/network/httpd.c b/src/network/httpd.c index 3e27406b5c..1ff4f14d60 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -135,13 +135,6 @@ enum HTTPD_CLIENT_TLS_HS_OUT }; -/* mode */ -enum -{ -HTTPD_CLIENT_FILE, /* default */ -HTTPD_CLIENT_STREAM,/* regulary get data from cb */ -}; - struct httpd_client_t { httpd_url_t *url; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] aout/common: add missing case for 2F2M2R (Dolby 6.0) in aout_FormatPrintChannels
vlc | branch: master | Lyndon Brown| Sun Apr 9 18:06:06 2017 +0100| [19fa2ebc91bdedfcb4302f9a893c837d17bf6825] | committer: Jean-Baptiste Kempf aout/common: add missing case for 2F2M2R (Dolby 6.0) in aout_FormatPrintChannels Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19fa2ebc91bdedfcb4302f9a893c837d17bf6825 --- src/audio_output/common.c | 4 1 file changed, 4 insertions(+) diff --git a/src/audio_output/common.c b/src/audio_output/common.c index 391abf0557..8fb9a00cf7 100644 --- a/src/audio_output/common.c +++ b/src/audio_output/common.c @@ -197,6 +197,10 @@ const char * aout_FormatPrintChannels( const audio_sample_format_t * p_format ) case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE: return "3F2M/LFE"; +case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT + | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT + | AOUT_CHAN_MIDDLERIGHT: +return "2F2M2R"; case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT: ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] aout/common: fix type for S16N interleaving
vlc | branch: master | Lyndon Brown| Sat Mar 18 17:34:25 2017 +| [34ad26ff6cef1b0c6745a784f9051fb03375d301] | committer: Jean-Baptiste Kempf aout/common: fix type for S16N interleaving This mistake happens to have no impact at all on computations, but deserved correction. Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34ad26ff6cef1b0c6745a784f9051fb03375d301 --- src/audio_output/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio_output/common.c b/src/audio_output/common.c index 8fb9a00cf7..f7dbc57557 100644 --- a/src/audio_output/common.c +++ b/src/audio_output/common.c @@ -381,7 +381,7 @@ do { \ switch( fourcc ) { case VLC_CODEC_U8: INTERLEAVE_TYPE(uint8_t); break; -case VLC_CODEC_S16N: INTERLEAVE_TYPE(uint16_t); break; +case VLC_CODEC_S16N: INTERLEAVE_TYPE(int16_t); break; case VLC_CODEC_FL32: INTERLEAVE_TYPE(float);break; case VLC_CODEC_S32N: INTERLEAVE_TYPE(int32_t); break; case VLC_CODEC_FL64: INTERLEAVE_TYPE(double); break; @@ -417,7 +417,7 @@ do { \ switch( fourcc ) { case VLC_CODEC_U8: DEINTERLEAVE_TYPE(uint8_t); break; -case VLC_CODEC_S16N: DEINTERLEAVE_TYPE(uint16_t); break; +case VLC_CODEC_S16N: DEINTERLEAVE_TYPE(int16_t); break; case VLC_CODEC_FL32: DEINTERLEAVE_TYPE(float);break; case VLC_CODEC_S32N: DEINTERLEAVE_TYPE(int32_t); break; case VLC_CODEC_FL64: DEINTERLEAVE_TYPE(double); break; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] MODULES_LIST: fix count
vlc | branch: master | Lyndon Brown| Wed Apr 26 15:07:29 2017 +0100| [8835da90323de306796e150aeacd2e4b300c3dce] | committer: Jean-Baptiste Kempf MODULES_LIST: fix count Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8835da90323de306796e150aeacd2e4b300c3dce --- modules/MODULES_LIST | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST index cc00647b51..801c85fd32 100644 --- a/modules/MODULES_LIST +++ b/modules/MODULES_LIST @@ -1,5 +1,6 @@ -List of vlc plugins (475) +List of vlc plugins (490): $Id$ + * a52: A/52 audio decoder plugin, using liba52 * aa: Ascii art video output * access_alsa: Alsa access module ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] MODULES_LIST: add missing entries
vlc | branch: master | Lyndon Brown| Fri May 12 20:50:16 2017 +0100| [4fcb76f200c3171ed54789901ca86da142d2ff74] | committer: Jean-Baptiste Kempf MODULES_LIST: add missing entries * libdirectory_demux_plugin * libsimple_channel_mixer_plugin_arm_neon Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4fcb76f200c3171ed54789901ca86da142d2ff74 --- modules/MODULES_LIST | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST index 801c85fd32..6349054068 100644 --- a/modules/MODULES_LIST +++ b/modules/MODULES_LIST @@ -1,4 +1,4 @@ -List of vlc plugins (490): +List of vlc plugins (492): $Id$ * a52: A/52 audio decoder plugin, using liba52 @@ -115,6 +115,7 @@ $Id$ * direct3d9_adjust: adjust filter for Direct3D9 video decoding * direct3d9_deinterlace: deinterlacer for Direct3D9/DxVA video decoding * directdraw: video output module using the DirectDraw API + * directory_demux: Ouput folder contents to playlist * directsound: audio output module using the DirectSound API * dmo: a DirectMediaObject decoder that uses DirectMedia to decode video (WMV3) * dolby_surround_decoder: simple decoder for dolby surround encoded streams @@ -361,6 +362,7 @@ $Id$ * shm: Shared memory framebuffer access module * sid: Sidplay demuxer * simple_channel_mixer: channel mixer + * simple_channel_mixer_arm_neon: channel mixer, optimized for ARM Neon * skins2: Skinnable interface, new generation * skiptags: APE & ID3 tags-skipping stream filter * smb: SMB shares access module ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] Update NEWS from 2.2.x branch
vlc | branch: master | Jean-Baptiste Kempf| Thu Nov 23 10:36:26 2017 +0100| [fc063b5195e11e03ac773874432757cbeef2693b] | committer: Jean-Baptiste Kempf Update NEWS from 2.2.x branch > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc063b5195e11e03ac773874432757cbeef2693b --- NEWS | 54 +++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 5c912657c1..ddd1626f37 100644 --- a/NEWS +++ b/NEWS @@ -314,17 +314,65 @@ Removed modules * RAOP stream output module -Changes between 2.2.5 and 2.2.5.1: +Changes between 2.2.7 and 2.2.8: + + +Demuxers: + * Fix AVI invalid pointer dereferences + +Translations updates + + +Changes between 2.2.6 and 2.2.7: +Decoders: + * Fix flac heap write overflow on format change + * Fix crash in libavcodec module (heap write out-of band) (CVE-2017-10699) + * Fix infinite loop in sami subtitle + * Fix AAC 7.1 channels detection + +Demuxers: + * Fix potential crash in ASX parser + * Fix AVI read/write overflow + +Mac OS X: + * Fix compatibility with macOS High Sierra + * Fix regression in ASS subtitle decoding + * Fix crash during automatic update. Some users might need to manually + update to the newest version. + +Video Output: + * Fix Direct3D9 output with odd offsets + +Misc: + * Fix crash in MTP + * Support libupnp 1.8 + +Translations updates + + +Changes between 2.2.5.1 and 2.2.6: +-- + +Video output: + * Fix systematic green line on nvidia + * Fix direct3d SPU texture offsets handling + +Demuxer: + * Fix heap buffer overflows (CVE-2017-8310, 8311, 8312, 8313) + +Changes between 2.2.5 and 2.2.5.1: +-- + Security hardening for DLL hijacking environments Translations updates Misc: * Update for Soundcloud, liveleak and Youtube scripts - * Fix potential out-of-band dereference in flac decoder - * Fix potential out-of-band reads in mpeg packetizers + * Fix potential out-of-band dereference in flac decoder (CVE-2017-9300) + * Fix potential out-of-band reads in mpeg packetizers (CVE-2017-9301) * Fix infinite loop in subtitles demuxer * Fix incorrect memory free in ogg demuxer * Fix potential out-of-band reads in subtitle decoders and demuxers ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] Revert "satip: Add missing allocation check"
vlc | branch: master | Hugo Beauzée-Luyssen| Thu Nov 23 11:04:47 2017 +0100| [8a9ffc70f337a6d1adc3fe0589501f1cb0be8015] | committer: Hugo Beauzée-Luyssen Revert "satip: Add missing allocation check" This reverts commit e95b11e2c0c730599d66241047de0760e0bea40f. This breaks the logic a few lines below > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8a9ffc70f337a6d1adc3fe0589501f1cb0be8015 --- modules/access/satip.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/access/satip.c b/modules/access/satip.c index eed3cf5b4a..2da403dbf8 100644 --- a/modules/access/satip.c +++ b/modules/access/satip.c @@ -632,8 +632,6 @@ static int satip_open(vlc_object_t *obj) msg_Dbg(access, "try to open '%s'", access->psz_url); char *psz_host = var_InheritString(access, "satip-host"); -if (psz_host == NULL) -return VLC_ENOMEM; sys->udp_sock = -1; sys->rtcp_sock = -1; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] l10n: Dutch update Dutch translation update for 2.2.x send per request from Thomas De Rocker (dutch translator)
vlc/vlc-2.2 | branch: master | Michał Trzebiatowski| Wed Nov 22 23:45:26 2017 +0100| [57f930321f82fb1642ed0a9e56b20d9aacb243d4] | committer: Jean-Baptiste Kempf l10n: Dutch update Dutch translation update for 2.2.x send per request from Thomas De Rocker (dutch translator) Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=57f930321f82fb1642ed0a9e56b20d9aacb243d4 --- po/nl.po | 83 +++- 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/po/nl.po b/po/nl.po index b0485064d6..73e5b5852d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -9,10 +9,10 @@ # Thomas De Rocker, 2008-2017 msgid "" msgstr "" -"Project-Id-Version: VLC - Trans\n" +"Project-Id-Version: vlc 2.2.7\n" "Report-Msgid-Bugs-To: vlc-de...@videolan.org\n" "POT-Creation-Date: 2017-11-15 16:45+0100\n" -"PO-Revision-Date: 2017-10-21 07:46+\n" +"PO-Revision-Date: 2017-11-22 21:15+0100\n" "Last-Translator: Thomas De Rocker\n" "Language-Team: Dutch (http://www.transifex.com/yaron/vlc-trans/language/; "nl/)\n" @@ -1247,7 +1247,7 @@ msgstr "Ja" #: src/input/es_out.c:2018 #, c-format msgid "Closed captions %u" -msgstr "Gesloten onderschriften %u" +msgstr "Gesloten ondertitels %u" #: src/input/es_out.c:2876 #, c-format @@ -4582,14 +4582,12 @@ msgid "Cycle through the available subtitle tracks." msgstr "Tussen beschikbare ondertitelsporen schakelen." #: src/libvlc-module.c:1352 -#, fuzzy msgid "Toggle subtitles" -msgstr "Teletekst-ondertitels" +msgstr "Ondertitels aan/uit" #: src/libvlc-module.c:1353 -#, fuzzy msgid "Toggle subtitle track visibility." -msgstr "Ondertitelspoor veranderen" +msgstr "Zichtbaarheid ondertitelspoor aan/uit" #: src/libvlc-module.c:1354 msgid "Cycle next program Service ID" @@ -6118,7 +6116,7 @@ msgstr "10-bits" #: modules/access/decklink.cpp:319 modules/demux/ty.c:776 msgid "Closed captions 1" -msgstr "Gesloten onderschriften 1" +msgstr "Gesloten ondertitels 1" #: modules/access/dshow/dshow.cpp:92 msgid "Cable" @@ -6615,9 +6613,8 @@ msgid "Layer C time interleaving" msgstr "Layer C time interleaving" #: modules/access/dtv/access.c:154 -#, fuzzy msgid "Stream identifier" -msgstr "Netwerkidentificatie" +msgstr "Stream-identificatie" #: modules/access/dtv/access.c:156 msgid "Pilot" @@ -6910,9 +6907,8 @@ msgid "DVDnav Input" msgstr "DVDnav invoer" #: modules/access/dvdnav.c:104 -#, fuzzy msgid "DVDnav demuxer" -msgstr "Nuv-demuxer" +msgstr "DVDnav-demuxer" #: modules/access/dvdnav.c:299 modules/access/dvdread.c:200 #: modules/access/dvdread.c:462 modules/access/dvdread.c:530 @@ -8546,8 +8542,7 @@ msgstr "VBI-opnameapparaat" #: modules/access/v4l2/v4l2.c:48 msgid "The device node where VBI data can be read (for closed captions) " msgstr "" -"Apparaat-node waar VBI-data gelezen kunnen worden (voor gesloten " -"bijschriften)" +"Apparaat-node waar VBI-data gelezen kan worden (voor gesloten ondertitels)" #: modules/access/v4l2/v4l2.c:50 modules/stream_out/standard.c:90 msgid "Standard" @@ -12046,7 +12041,7 @@ msgstr "" #: modules/codec/quicktime.c:66 msgid "QuickTime library decoder" -msgstr "QuickTime-bibliotheekdecoder" +msgstr "QuickTime-bibliotheek decoder" #: modules/codec/rawvideo.c:66 msgid "Pseudo raw video decoder" @@ -12803,7 +12798,6 @@ msgstr "Tekst ondertiteldecoder" #. Western European languages normally use "CP1252", which is a #. Microsoft-variant of ISO 8859-1. That suits the Latin alphabet. #. Other scripts use other code pages. -#. #. This MUST be a valid iconv character set. If unsure, please refer #. the VideoLAN translators mailing list. #: modules/codec/subsdec.c:296 modules/demux/avi/avi.c:99 @@ -16355,15 +16349,15 @@ msgstr "TY Stream audio/video-demuxer" #: modules/demux/ty.c:777 msgid "Closed captions 2" -msgstr "Gesloten onderschriften 2" +msgstr "Gesloten ondertitels 2" #: modules/demux/ty.c:778 msgid "Closed captions 3" -msgstr "Gesloten onderschriften 3" +msgstr "Gesloten ondertitels 3" #: modules/demux/ty.c:779 msgid "Closed captions 4" -msgstr "Gesloten onderschriften 4" +msgstr "Gesloten ondertitels 4" #: modules/demux/vc1.c:44 msgid "Desired frame rate for the VC-1 stream." @@ -16391,7 +16385,7 @@ msgstr "XA-demuxer" #: modules/demux/xiph_metadata.h:48 msgid "Closed captions" -msgstr "Gesloten onderschriften" +msgstr "Gesloten ondertitels" #: modules/demux/xiph_metadata.h:50 msgid "Textual audio descriptions" @@ -16505,15 +16499,13 @@ msgstr "Dienstontdekking" #: modules/gui/macosx/AddonManager.m:102 #: modules/gui/qt4/dialogs/plugins.cpp:386 -#, fuzzy msgid "Interfaces" -msgstr "Interface" +msgstr "Interfaces" #: modules/gui/macosx/AddonManager.m:104 #: modules/gui/qt4/dialogs/plugins.cpp:389 -#, fuzzy msgid "Art and meta fetchers" -msgstr "Lua-meta-ophaler" +msgstr "Albumhoes- en metadata-ophalers" #:
[vlc-commits] Update PO files
vlc | branch: master | Jean-Baptiste Kempf| Thu Nov 23 10:17:27 2017 +0100| [2a4afc3bb77eab39f154fc02b03cb721780b7171] | committer: Jean-Baptiste Kempf Update PO files > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a4afc3bb77eab39f154fc02b03cb721780b7171 --- po/ach.po | 23486 +++ po/af.po| 27516 ++--- po/am.po| 30952 +-- po/an.po| 30493 +- po/ar.po| 26826 ++-- po/ast.po | 29800 + po/az.po| 22678 ++--- po/be.po| 31138 ++- po/bg.po| 29982 + po/bn.po| 29264 po/bn_IN.po | 30888 ++- po/br.po| 22859 +++--- po/bs.po| 23261 +++--- po/ca.po| 26138 ++- po/cgg.po | 26515 ++-- po/ckb.po | 29678 - po/co.po| 22767 ++ po/cs.po| 25481 +- po/cy.po| 27375 ++--- po/da.po| 26442 ++-- po/de.po| 31588 +++- po/el.po| 26150 ++- po/en_GB.po | 31502 ++-- po/es.po| 25923 ++- po/et.po| 30096 + po/eu.po| 31256 ++- po/fa.po| 22703 ++--- po/ff.po| 20496 +- po/fi.po| 30500 +- po/fr.po| 30496 ++ po/fur.po | 28593 +++ po/ga.po| 35035 +- po/gd.po| 24093 po/gl.po| 31876 +++- po/gu.po| 21711 ++-- po/he.po| 23872 --- po/hi.po| 21823 ++-- po/hr.po| 31288 ++- po/hu.po| 32243 +++-- po/hy.po| 27529 +++-- po/ia.po| 20599 +- po/id.po| 29582 + po/is.po| 22098 ++-- po/it.po| 26312 ++- po/ja.po| 31475 +++- po/ka.po| 28018 +++--- po/kk.po| 26163 ++- po/km.po| 30953 ++- po/kn.po| 30396 ++ po/ko.po| 25514 ++ po/ky.po| 21680 ++-- po/lg.po| 30883 +-- po/lt.po| 27756 +++--- po/lv.po| 21495 +-- po/mk.po| 21765 ++-- po/ml.po| 21381 +-- po/mn.po| 22456 ++--- po/mr.po| 24329 po/ms.po| 25701 ++ po/my.po| 21018 +-- po/nb.po| 23229 +++--- po/ne.po| 25289 +- po/nl.po| 32220 +++-- po/nn.po| 23769 +++ po/oc.po| 24013 po/or.po| 21363 +-- po/pa.po| 26849 ++-- po/pl.po| 31030 ++- po/ps.po| 23985 po/pt_BR.po | 31433 +++- po/pt_PT.po | 30847 ++-
[vlc-commits] demux: avi: remove enum/fix build
vlc | branch: master | Francois Cartegnie| Thu Nov 23 09:52:59 2017 +0100| [7ba9558c2e33654ac14aa5fa71429f98e045e44b] | committer: Francois Cartegnie demux: avi: remove enum/fix build move as defines, we can't change member type This reverts commit 5640f9814c4ed2edb9b33086f3465837e1fc4adc. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7ba9558c2e33654ac14aa5fa71429f98e045e44b --- modules/demux/avi/libavi.h | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h index e1c283bc01..26e1614a12 100644 --- a/modules/demux/avi/libavi.h +++ b/modules/demux/avi/libavi.h @@ -20,18 +20,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ -enum biCompression -{ -BI_RGB = 0x00, -BI_RLE8, -BI_RLE4, -BI_BITFIELDS, -BI_JPEG, -BI_PNG, -BI_CMYK = 0x0B, -BI_CMYKRLE8, -BI_CMYKRLE4 -}; +/* biCompression / Others are FourCC */ +#define BI_RGB 0x +#define BI_RLE8 0x0001 +#define BI_RLE4 0x0002 +#define BI_BITFIELDS0x0003 +#define BI_JPEG 0x0004 +#define BI_PNG 0x0005 +#define BI_CMYK 0x000B +#define BI_CMYKRLE8 0x000C +#define BI_CMYKRLE4 0x000D /* flags for use in in AVIFileHdr */ #define AVIF_HASINDEX 0x0010 /* Index at end of file? */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dxva2_deinterlace: create the texture for pictures coming from a bogus pool
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:39 2017 +0100| [f90a1d25289ad003d085579ad21d94067e1d1c22] | committer: Jean-Baptiste Kempf dxva2_deinterlace: create the texture for pictures coming from a bogus pool Fixes #18936 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f90a1d25289ad003d085579ad21d94067e1d1c22 --- modules/hw/d3d9/dxva2_deinterlace.c | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 994ee997ea..8088db1a91 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -249,11 +249,40 @@ static struct picture_context_t *d3d9_pic_context_copy(struct picture_context_t static picture_t *NewOutputPicture( filter_t *p_filter ) { -picture_t *pic = p_filter->p_sys->buffer_new( p_filter ); +filter_sys_t *p_sys = p_filter->p_sys; +picture_t *pic = p_sys->buffer_new( p_filter ); if ( !pic->context ) { +bool b_local_texture = false; + +if (!pic->p_sys ) +{ +D3DSURFACE_DESC dstDesc; +if ( !p_sys->hw_surface || + FAILED(IDirect3DSurface9_GetDesc( p_sys->hw_surface, )) ) +return NULL; + +pic->p_sys = calloc(1, sizeof(*pic->p_sys)); +if (unlikely(pic->p_sys == NULL)) +return NULL; + +HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_sys->d3d_dev.dev, + p_filter->fmt_out.video.i_width, + p_filter->fmt_out.video.i_height, + dstDesc.Format, + D3DPOOL_DEFAULT, + >p_sys->surface, + NULL); + +if (FAILED(hr)) +{ +free(pic->p_sys); +pic->p_sys = NULL; +return NULL; +} +b_local_texture = true; +} /* the picture might be duplicated for snapshots so it needs a context */ -assert( pic->p_sys != NULL ); /* this opaque picture is wrong */ struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx)); if (likely(pic_ctx!=NULL)) { @@ -263,6 +292,8 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) AcquirePictureSys( _ctx->picsys ); pic->context = _ctx->s; } +if (b_local_texture) +IDirect3DSurface9_Release(pic->p_sys->surface); } return pic; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: make use of D3D11_FilterHoldInstance()
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:36 2017 +0100| [77ee35a70adb2176ede021b634e40ebf5348b5ff] | committer: Jean-Baptiste Kempf hw:d3d11: make use of D3D11_FilterHoldInstance() Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=77ee35a70adb2176ede021b634e40ebf5348b5ff --- modules/hw/d3d11/d3d11_deinterlace.c | 25 - modules/hw/d3d11/d3d11_filters.c | 25 - modules/hw/d3d11/d3d11_surface.c | 16 +--- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 9d466ef78e..f0b087af40 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -298,21 +298,15 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) return VLC_ENOMEM; memset(sys, 0, sizeof (*sys)); -picture_t *dst = filter_NewPicture(filter); -if (dst == NULL) -return VLC_EGENERIC; -if (!dst->p_sys) +D3D11_TEXTURE2D_DESC dstDesc; +D3D11_FilterHoldInstance(filter, >d3d_dev, ); +if (unlikely(sys->d3d_dev.d3dcontext==NULL)) { -msg_Dbg(filter, "D3D11 opaque without a texture"); -picture_Release(dst); -return VLC_EGENERIC; +msg_Dbg(filter, "Filter without a context"); +free(sys); +return VLC_ENOOBJ; } -D3D11_TEXTURE2D_DESC dstDesc; -ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); -sys->d3d_dev.d3dcontext = dst->p_sys->context; -ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); - hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); @@ -493,11 +487,8 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) filter->pf_flush= Flush; filter->p_sys = sys; -picture_Release(dst); return VLC_SUCCESS; error: -picture_Release(dst); - if (sys->outTexture) ID3D11Texture2D_Release(sys->outTexture); if (sys->videoProcessor) @@ -509,7 +500,7 @@ error: if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); if (sys->d3d_dev.d3dcontext) -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); return VLC_EGENERIC; } @@ -525,7 +516,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj) ID3D11VideoProcessorEnumerator_Release(sys->procEnumerator); ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); free(sys); } diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c index de97ee2582..8b5a448ce0 100644 --- a/modules/hw/d3d11/d3d11_filters.c +++ b/modules/hw/d3d11/d3d11_filters.c @@ -342,21 +342,15 @@ static int D3D11OpenAdjust(vlc_object_t *obj) return VLC_ENOMEM; memset(sys, 0, sizeof (*sys)); -picture_t *dst = filter_NewPicture(filter); -if (dst == NULL) -return VLC_EGENERIC; -if (!dst->p_sys) +D3D11_TEXTURE2D_DESC dstDesc; +D3D11_FilterHoldInstance(filter, >d3d_dev, ); +if (unlikely(sys->d3d_dev.d3dcontext==NULL)) { -msg_Dbg(filter, "D3D11 opaque without a texture"); -picture_Release(dst); -return VLC_EGENERIC; +msg_Dbg(filter, "Filter without a context"); +free(sys); +return VLC_ENOOBJ; } -D3D11_TEXTURE2D_DESC dstDesc; -ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); -sys->d3d_dev.d3dcontext = dst->p_sys->context; -ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); - hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); @@ -556,11 +550,8 @@ static int D3D11OpenAdjust(vlc_object_t *obj) filter->pf_video_filter = Filter; filter->p_sys = sys; -picture_Release(dst); return VLC_SUCCESS; error: -picture_Release(dst); - for (int i=0; i procInput[i]) @@ -582,7 +573,7 @@ error: if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); if (sys->d3d_dev.d3dcontext) -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); return VLC_EGENERIC; } @@ -612,7 +603,7 @@ static void D3D11CloseAdjust(vlc_object_t *obj) ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); free(sys); } diff --git
[vlc-commits] hw:d3d9: make use of D3D9_FilterHoldInstance()
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:37 2017 +0100| [930d6148d7b6f66fa65234b5c53de06f6f4bf2e0] | committer: Jean-Baptiste Kempf hw:d3d9: make use of D3D9_FilterHoldInstance() Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=930d6148d7b6f66fa65234b5c53de06f6f4bf2e0 --- modules/hw/d3d9/d3d9_filters.c | 27 ++- modules/hw/d3d9/dxa9.c | 20 +++- modules/hw/d3d9/dxva2_deinterlace.c | 28 ++-- 3 files changed, 19 insertions(+), 56 deletions(-) diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c index d0212718eb..0fd40fb02a 100644 --- a/modules/hw/d3d9/d3d9_filters.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -225,7 +225,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) HINSTANCE hdecoder_dll = NULL; HINSTANCE d3d9_dll = NULL; HRESULT hr; -picture_t *dst = NULL; GUID *processorGUIDs = NULL; GUID *processorGUID = NULL; IDirectXVideoProcessorService *processor = NULL; @@ -248,13 +247,11 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (!hdecoder_dll) goto error; -dst = filter_NewPicture(filter); -if (dst == NULL) -goto error; - -if (!dst->p_sys) +D3DSURFACE_DESC dstDesc; +D3D9_FilterHoldInstance(filter, >d3d_dev, ); +if (!sys->d3d_dev.dev) { -msg_Dbg(filter, "D3D9 opaque without a texture"); +msg_Dbg(filter, "Filter without a context"); goto error; } @@ -266,15 +263,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (CreateVideoService == NULL) goto error; -hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3d_dev.dev ); -if (FAILED(hr)) -goto error; - -D3DSURFACE_DESC dstDesc; -hr = IDirect3DSurface9_GetDesc( dst->p_sys->surface, ); -if (unlikely(FAILED(hr))) -goto error; - hr = CreateVideoService( sys->d3d_dev.dev, _IDirectXVideoProcessorService, (void**)); if (FAILED(hr)) @@ -397,7 +385,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) goto error; CoTaskMemFree(processorGUIDs); -picture_Release(dst); IDirectXVideoProcessorService_Release(processor); sys->hdecoder_dll = hdecoder_dll; @@ -414,13 +401,11 @@ error: if (processor) IDirectXVideoProcessorService_Release(processor); if (sys) -D3D9_ReleaseDevice( >d3d_dev ); +D3D9_FilterReleaseInstance( >d3d_dev ); if (hdecoder_dll) FreeLibrary(hdecoder_dll); if (d3d9_dll) FreeLibrary(d3d9_dll); -if (dst) -picture_Release(dst); free(sys); return VLC_EGENERIC; @@ -433,7 +418,7 @@ static void D3D9CloseAdjust(vlc_object_t *obj) IDirect3DSurface9_Release( sys->hw_surface ); IDirectXVideoProcessor_Release( sys->processor ); -D3D9_ReleaseDevice( >d3d_dev ); +D3D9_FilterReleaseInstance( >d3d_dev ); FreeLibrary( sys->hdecoder_dll ); FreeLibrary( sys->d3d9_dll ); diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 6815db2a93..fed821c8ff 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -369,17 +369,13 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) goto done; } -picture_t *peek = filter_NewPicture(p_filter); -if (peek == NULL) -return VLC_EGENERIC; -if (!peek->p_sys) +D3DSURFACE_DESC texDesc; +D3D9_FilterHoldInstance(p_filter, _sys->d3d_dev, ); +if (!p_sys->d3d_dev.dev) { -msg_Dbg(p_filter, "D3D9 opaque without a texture"); -return VLC_EGENERIC; +msg_Dbg(p_filter, "Filter without a context"); +goto done; } - -D3DSURFACE_DESC texDesc; -IDirect3DSurface9_GetDesc( peek->p_sys->surface, ); if (texDesc.Format == 0) goto done; @@ -406,7 +402,6 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) } picture_Setup(p_dst, _dst->format); -IDirect3DSurface9_GetDevice(peek->p_sys->surface, _sys->d3d_dev.dev); HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_sys->d3d_dev.dev, p_dst->format.i_width, p_dst->format.i_height, @@ -440,14 +435,13 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) done: video_format_Clean(_staging); -picture_Release(peek); if (err != VLC_SUCCESS) { if (p_cpu_filter) DeleteFilter( p_cpu_filter ); if (texture) IDirect3DSurface9_Release(texture); -D3D9_ReleaseDevice(_sys->d3d_dev); +D3D9_FilterReleaseInstance(_sys->d3d_dev); if (hd3d_dll) FreeLibrary(hd3d_dll); free(p_sys); @@ -470,7 +464,7 @@ void D3D9CloseCPUConverter( vlc_object_t *obj ) filter_sys_t *p_sys =
[vlc-commits] d3d11_deinterlace: create the texture for pictures coming from a bogus pool
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:38 2017 +0100| [e511a5e8792313d123af77a1cdde138aa204704f] | committer: Jean-Baptiste Kempf d3d11_deinterlace: create the texture for pictures coming from a bogus pool Fixes #18936 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e511a5e8792313d123af77a1cdde138aa204704f --- modules/hw/d3d11/d3d11_deinterlace.c | 56 ++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index f0b087af40..2068ac63c1 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -200,12 +200,20 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic, if (FAILED(hr)) return VLC_EGENERIC; +D3D11_BOX box = { +.top = 0, +.bottom = p_outpic->format.i_visible_height, +.left = 0, +.right = p_outpic->format.i_visible_width, +.back = 1, +}; + ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], p_outpic->p_sys->slice_index, 0, 0, 0, p_sys->outResource, - 0, NULL); + 0, ); return VLC_SUCCESS; } @@ -267,8 +275,46 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) picture_t *pic = p_filter->p_sys->buffer_new( p_filter ); if ( !pic->context ) { +bool b_local_texture = false; + +if ( !pic->p_sys ) +{ +pic->p_sys = calloc(1, sizeof(*pic->p_sys)); +if (unlikely(pic->p_sys == NULL)) +return NULL; + +D3D11_TEXTURE2D_DESC dstDesc; +ID3D11Texture2D_GetDesc(p_filter->p_sys->outTexture, ); + +const d3d_format_t *cfg = NULL; +for (const d3d_format_t *output_format = GetRenderFormatList(); + output_format->name != NULL; ++output_format) +{ +if (output_format->formatTexture == dstDesc.Format && +is_d3d11_opaque(output_format->fourcc)) +{ +cfg = output_format; +break; +} +} + +/* create the texture that's missing */ +video_format_t fmt = p_filter->fmt_out.video; +fmt.i_width = dstDesc.Width; +fmt.i_height = dstDesc.Height; +if (AllocateTextures(VLC_OBJECT(p_filter), _filter->p_sys->d3d_dev, cfg, + , 1, pic->p_sys->texture) != VLC_SUCCESS) +{ +free(pic->p_sys); +return NULL; +} +b_local_texture = true; + +pic->p_sys->context = p_filter->p_sys->d3d_dev.d3dcontext; +pic->p_sys->formatTexture = dstDesc.Format; + +} /* the picture might be duplicated for snapshots so it needs a context */ -assert( pic->p_sys != NULL ); /* this opaque picture is wrong */ struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx)); if (likely(pic_ctx!=NULL)) { @@ -278,6 +324,12 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) AcquirePictureSys( _ctx->picsys ); pic->context = _ctx->s; } +if (b_local_texture) { +for (int i=0; i p_sys->texture[i]) +ID3D11Texture2D_Release(pic->p_sys->texture[i]); +} +} } return pic; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: use d3d11_device_t instead of ID3D11Device
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:35 2017 +0100| [791ae161e14b1537d0f1c75fdfe3a10931943935] | committer: Jean-Baptiste Kempf hw:d3d11: use d3d11_device_t instead of ID3D11Device Keep the device for the lifetime of the filter Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=791ae161e14b1537d0f1c75fdfe3a10931943935 --- modules/hw/d3d11/d3d11_deinterlace.c | 30 +++--- modules/hw/d3d11/d3d11_filters.c | 33 + modules/hw/d3d11/d3d11_surface.c | 18 -- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 1b977d9847..9d466ef78e 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -51,6 +51,7 @@ typedef UINT D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS; struct filter_sys_t { +d3d11_device_t d3d_dev; ID3D11VideoDevice *d3dviddev; ID3D11VideoContext *d3dvidctx; ID3D11VideoProcessor *videoProcessor; @@ -285,7 +286,6 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; -ID3D11Device *d3ddevice = NULL; ID3D11VideoProcessorEnumerator *processorEnumerator = NULL; if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma)) @@ -293,6 +293,11 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; +filter_sys_t *sys = malloc(sizeof (*sys)); +if (unlikely(sys == NULL)) +return VLC_ENOMEM; +memset(sys, 0, sizeof (*sys)); + picture_t *dst = filter_NewPicture(filter); if (dst == NULL) return VLC_EGENERIC; @@ -305,21 +310,16 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) D3D11_TEXTURE2D_DESC dstDesc; ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); +sys->d3d_dev.d3dcontext = dst->p_sys->context; +ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); -filter_sys_t *sys = malloc(sizeof (*sys)); -if (unlikely(sys == NULL)) -goto error; -memset(sys, 0, sizeof (*sys)); - -ID3D11DeviceContext_GetDevice(dst->p_sys->context, ); - -hr = ID3D11Device_QueryInterface(d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); +hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); goto error; } -hr = ID3D11DeviceContext_QueryInterface(dst->p_sys->context, _ID3D11VideoContext, (void **)>d3dvidctx); +hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, _ID3D11VideoContext, (void **)>d3dvidctx); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoContext Interface from the picture. (hr=0x%lX)", hr); goto error; @@ -327,7 +327,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) HANDLE context_lock = INVALID_HANDLE_VALUE; UINT dataSize = sizeof(context_lock); -hr = ID3D11Device_GetPrivateData(d3ddevice, _CONTEXT_MUTEX, , _lock); +hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, _CONTEXT_MUTEX, , _lock); if (FAILED(hr)) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; @@ -442,7 +442,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) texDesc.Height = dstDesc.Height; texDesc.Width = dstDesc.Width; -hr = ID3D11Device_CreateTexture2D( d3ddevice, , NULL, >outTexture ); +hr = ID3D11Device_CreateTexture2D( sys->d3d_dev.d3ddevice, , NULL, >outTexture ); if (FAILED(hr)) { msg_Err(filter, "CreateTexture2D failed. (hr=0x%0lx)", hr); goto error; @@ -493,12 +493,9 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) filter->pf_flush= Flush; filter->p_sys = sys; -ID3D11Device_Release(d3ddevice); picture_Release(dst); return VLC_SUCCESS; error: -if (d3ddevice) -ID3D11Device_Release(d3ddevice); picture_Release(dst); if (sys->outTexture) @@ -511,6 +508,8 @@ error: ID3D11VideoContext_Release(sys->d3dvidctx); if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); +if (sys->d3d_dev.d3dcontext) +D3D11_ReleaseDevice(>d3d_dev); return VLC_EGENERIC; } @@ -526,6 +525,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj) ID3D11VideoProcessorEnumerator_Release(sys->procEnumerator); ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); +D3D11_ReleaseDevice(>d3d_dev); free(sys); } diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c index 70764a3e87..de97ee2582 100644 ---
[vlc-commits] skin2: fix string can't be parsed by gettext
vlc | branch: master | Pierre Lamot| Thu Nov 23 10:03:50 2017 +0100| [0fc13af3edbea968568dec8e74884c09bb9d6513] | committer: Jean-Baptiste Kempf skin2: fix string can't be parsed by gettext fix: #19117 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0fc13af3edbea968568dec8e74884c09bb9d6513 --- modules/gui/skins2/src/dialogs.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp index 79885ea5d8..276909a875 100644 --- a/modules/gui/skins2/src/dialogs.cpp +++ b/modules/gui/skins2/src/dialogs.cpp @@ -22,6 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ +#include #include "dialogs.hpp" #include "../commands/async_queue.hpp" #include "../commands/cmd_change_skin.hpp" @@ -210,9 +211,10 @@ void Dialogs::showChangeSkin() void Dialogs::showPlaylistLoad() { +std::stringstream fileTypes; +fileTypes << _("Playlist Files|") << EXTENSIONS_PLAYLIST << _("|All Files|*"); showFileGeneric( _("Open playlist"), - _("Playlist Files|" EXTENSIONS_PLAYLIST "|" - "All Files|*"), + fileTypes.str(), showPlaylistLoadCB, kOPEN ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: move all the filters into a single module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:30 2017 +0100| [34a545f1f3d756390f24cf4465cf0c8829c727cf] | committer: Jean-Baptiste Kempf hw:d3d11: move all the filters into a single module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34a545f1f3d756390f24cf4465cf0c8829c727cf --- configure.ac | 2 +- modules/hw/d3d11/Makefile.am | 35 ++ modules/hw/d3d11/d3d11_deinterlace.c | 14 ++--- .../hw/d3d11/{d3d11_adjust.c => d3d11_filters.c} | 19 ++-- modules/hw/d3d11/d3d11_filters.h | 35 ++ modules/hw/d3d11/d3d11_surface.c | 23 -- 6 files changed, 70 insertions(+), 58 deletions(-) diff --git a/configure.ac b/configure.ac index c089de8c1f..b9fe565659 100644 --- a/configure.ac +++ b/configure.ac @@ -3321,7 +3321,7 @@ AS_IF([test "${enable_directx}" != "no"], [ dnl Direct3D11 AC_CHECK_HEADERS(d3d11.h, [ -VLC_ADD_PLUGIN([direct3d11 direct3d11_deinterlace direct3d11_adjust]) +VLC_ADD_PLUGIN([direct3d11 direct3d11_filters]) ]) dnl Direct3D9 diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 999d4c6052..4bca091326 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -1,32 +1,15 @@ d3d11dir = $(pluginsdir)/d3d11 -d3d11_LTLIBRARIES = -libdirect3d11_deinterlace_plugin_la_SOURCES = hw/d3d11/d3d11_deinterlace.c -libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la +libdirect3d11_filters_plugin_la_SOURCES = hw/d3d11/d3d11_filters.h \ +hw/d3d11/d3d11_filters.c \ +hw/d3d11/d3d11_deinterlace.c \ +hw/d3d11/d3d11_surface.c +libdirect3d11_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d11dir)' +libdirect3d11_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE -libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 -endif -libdirect3d11_adjust_plugin_la_SOURCES = hw/d3d11/d3d11_adjust.c -libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la -if HAVE_WINSTORE -libdirect3d11_adjust_plugin_la_LIBADD += -ld3d11 -endif - -if HAVE_AVCODEC_D3D11VA -#video_filter_LTLIBRARIES += $(LTLIBdirect3d11_deinterlace) $(LTLIBdirect3d11_adjust) -d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_plugin.la +libdirect3d11_filters_plugin_la_LIBADD += -ld3d11 endif -# GPU/CPU converter -libd3d11_surface_plugin_la_SOURCES = hw/d3d11/d3d11_surface.c -libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la -if HAVE_WINSTORE -libd3d11_surface_plugin_la_LIBADD += -ld3d11 -endif - -if HAVE_AVCODEC_D3D11VA -d3d11_LTLIBRARIES += libd3d11_surface_plugin.la -endif +d3d11_LTLIBRARIES = $(LTLIBdirect3d11_filters) +EXTRA_LTLIBRARIES += libdirect3d11_filters_plugin.la diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 64c098558e..1b977d9847 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -36,6 +35,7 @@ #include #include +#include "d3d11_filters.h" #include "../../video_chroma/d3d11_fmt.h" #include "../../video_filter/deinterlace/common.h" @@ -281,7 +281,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int D3D11OpenDeinterlace(vlc_object_t *obj) +int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -515,7 +515,7 @@ error: return VLC_EGENERIC; } -static void D3D11CloseDeinterlace(vlc_object_t *obj) +void D3D11CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -530,11 +530,3 @@ static void D3D11CloseDeinterlace(vlc_object_t *obj) free(sys); } -vlc_module_begin() -set_description(N_("Direct3D11 deinterlacing filter")) -set_capability("video filter", 0) -set_category(CAT_VIDEO) -set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(D3D11OpenDeinterlace, D3D11CloseDeinterlace) -add_shortcut ("deinterlace") -vlc_module_end() diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_filters.c similarity index 97% rename from modules/hw/d3d11/d3d11_adjust.c rename to modules/hw/d3d11/d3d11_filters.c index f5ace01acc..70764a3e87 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_filters.c @@ -1,7 +1,7 @@ /* - * d3d11_adjust.c: D3D11 adjust filter (no gamma) + * d3d11_adjust.c: D3D11 filters module callbacks
[vlc-commits] hw:d3d11: move the filters code in hw/d3d11
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:22 2017 +0100| [9602b711f4c951f135dff54cb4191eb39ef1617e] | committer: Jean-Baptiste Kempf hw:d3d11: move the filters code in hw/d3d11 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9602b711f4c951f135dff54cb4191eb39ef1617e --- modules/hw/d3d11/Makefile.am | 6 +++--- modules/{video_output/win32 => hw/d3d11}/d3d11_adjust.c | 0 modules/{video_output/win32 => hw/d3d11}/d3d11_deinterlace.c | 0 modules/{video_chroma => hw/d3d11}/d3d11_surface.c | 4 ++-- po/POTFILES.in | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 8b777d2386..999d4c6052 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -1,13 +1,13 @@ d3d11dir = $(pluginsdir)/d3d11 d3d11_LTLIBRARIES = -libdirect3d11_deinterlace_plugin_la_SOURCES = video_output/win32/d3d11_deinterlace.c +libdirect3d11_deinterlace_plugin_la_SOURCES = hw/d3d11/d3d11_deinterlace.c libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 endif -libdirect3d11_adjust_plugin_la_SOURCES = video_output/win32/d3d11_adjust.c +libdirect3d11_adjust_plugin_la_SOURCES = hw/d3d11/d3d11_adjust.c libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la if HAVE_WINSTORE @@ -20,7 +20,7 @@ d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_pl endif # GPU/CPU converter -libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c +libd3d11_surface_plugin_la_SOURCES = hw/d3d11/d3d11_surface.c libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la if HAVE_WINSTORE libd3d11_surface_plugin_la_LIBADD += -ld3d11 diff --git a/modules/video_output/win32/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c similarity index 100% rename from modules/video_output/win32/d3d11_adjust.c rename to modules/hw/d3d11/d3d11_adjust.c diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c similarity index 100% rename from modules/video_output/win32/d3d11_deinterlace.c rename to modules/hw/d3d11/d3d11_deinterlace.c diff --git a/modules/video_chroma/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c similarity index 99% rename from modules/video_chroma/d3d11_surface.c rename to modules/hw/d3d11/d3d11_surface.c index b41b2fa5c7..ca79b224a3 100644 --- a/modules/video_chroma/d3d11_surface.c +++ b/modules/hw/d3d11/d3d11_surface.c @@ -36,12 +36,12 @@ #include -#include "copy.h" +#include "../../video_chroma/copy.h" #include #define COBJMACROS #include -#include "d3d11_fmt.h" +#include "../../video_chroma/d3d11_fmt.h" #ifdef ID3D11VideoContext_VideoProcessorBlt #define CAN_PROCESSOR 1 diff --git a/po/POTFILES.in b/po/POTFILES.in index 5b4c5cbfc0..fa1728263b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -917,6 +917,7 @@ modules/hw/vdpau/deinterlace.c modules/hw/vdpau/display.c modules/hw/vdpau/sharpen.c modules/hw/vaapi/filters.c +modules/hw/d3d11/d3d11_surface.c modules/keystore/keychain.m modules/lua/demux.c modules/lua/intf.c @@ -1052,7 +1053,6 @@ modules/text_renderer/svg.c modules/text_renderer/tdummy.c modules/video_chroma/chain.c modules/video_chroma/cvpx.c -modules/video_chroma/d3d11_surface.c modules/video_chroma/dxa9.c modules/video_chroma/grey_yuv.c modules/video_chroma/i420_rgb16.c ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11_filters: fix adjust output when all values are default
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:27 2017 +0100| [004264bc47633678722b632abcb511ecfee1d87b] | committer: Jean-Baptiste Kempf d3d11_filters: fix adjust output when all values are default Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=004264bc47633678722b632abcb511ecfee1d87b --- modules/hw/d3d11/d3d11_adjust.c | 41 + 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index c954c79c08..1c4aca64fb 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -243,35 +243,60 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic) p_sys->procOutput[1] }; -size_t idx = 0; +size_t idx = 0, count = 0; /* contrast */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, _sys->Contrast, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* brightness */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS, _sys->Brightness, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* hue */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_HUE, _sys->Hue, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* saturation */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_SATURATION, _sys->Saturation, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} -ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, - p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], - p_outpic->p_sys->slice_index, - 0, 0, 0, - p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource, - 0, - NULL); +if (count == 0) +{ +ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, + p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], + p_outpic->p_sys->slice_index, + 0, 0, 0, + p_src_sys->resource[KNOWN_DXGI_INDEX], + p_src_sys->slice_index, + NULL); +} +else +{ +ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, + p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], + p_outpic->p_sys->slice_index, + 0, 0, 0, + p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource, + 0, + NULL); +} if( p_sys->context_mutex != INVALID_HANDLE_VALUE ) ReleaseMutex( p_sys->context_mutex ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dxa9: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:25 2017 +0100| [12b76b3f9d5155a31e3184b5590dd839ca7cd820] | committer: Jean-Baptiste Kempf dxa9: clean code Use local variables when possible Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12b76b3f9d5155a31e3184b5590dd839ca7cd820 --- modules/hw/d3d9/dxa9.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 9b8ea161e2..93095ca055 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -372,14 +372,13 @@ static int OpenFromCPU( vlc_object_t *obj ) return VLC_EGENERIC; } -video_format_Init(_staging, 0); D3DSURFACE_DESC texDesc; IDirect3DSurface9_GetDesc( peek->p_sys->surface, ); -vlc_fourcc_t d3d_fourcc = texDesc.Format; -if (d3d_fourcc == 0) +if (texDesc.Format == 0) goto done; -if ( p_filter->fmt_in.video.i_chroma != d3d_fourcc ) +video_format_Init(_staging, 0); +if ( p_filter->fmt_in.video.i_chroma != texDesc.Format ) { picture_resource_t res; res.pf_destroy = DestroyPicture; @@ -390,7 +389,7 @@ static int OpenFromCPU( vlc_object_t *obj ) } video_format_Copy(_staging, _filter->fmt_out.video); -fmt_staging.i_chroma = d3d_fourcc; +fmt_staging.i_chroma = texDesc.Format; fmt_staging.i_height = texDesc.Height; fmt_staging.i_width = texDesc.Width; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] skin2: fix opening playlist
vlc | branch: master | Pierre Lamot| Thu Nov 23 09:33:26 2017 +0100| [0925621b548c0e2dd3f43233f781718d97228a8f] | committer: Jean-Baptiste Kempf skin2: fix opening playlist Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0925621b548c0e2dd3f43233f781718d97228a8f --- modules/gui/qt/dialogs_provider.cpp | 9 - modules/gui/skins2/commands/cmd_playlist.cpp | 10 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp index 4f15bee9c0..4f9f2888ca 100644 --- a/modules/gui/qt/dialogs_provider.cpp +++ b/modules/gui/qt/dialogs_provider.cpp @@ -616,7 +616,14 @@ void DialogsProvider::openAPlaylist() EXT_FILTER_PLAYLIST ); foreach( const QString , urls ) { -playlist_Import( THEPL, qtu( url ) ); +char* psz_path = vlc_uri2path(qtu( url )); +if ( !psz_path ) +{ +msg_Warn( p_intf, "unable to load playlist '%s'", qtu( url ) ); +continue; +} +playlist_Import( THEPL, psz_path ); +free( psz_path ); } } diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp index dc38840dda..ab5d94c119 100644 --- a/modules/gui/skins2/commands/cmd_playlist.cpp +++ b/modules/gui/skins2/commands/cmd_playlist.cpp @@ -24,6 +24,7 @@ #include "cmd_playlist.hpp" #include +#include #include "../src/vlcproc.hpp" #include "../utils/var_bool.hpp" @@ -64,7 +65,14 @@ void CmdPlaylistRepeat::execute() void CmdPlaylistLoad::execute() { -playlist_Import( getPL(), m_file.c_str() ); +char* psz_path = vlc_uri2path( m_file.c_str() ); +if ( !psz_path ) +{ +msg_Err(getIntf(),"unable to load playlist %s", m_file.c_str() ); +return; +} +playlist_Import( getPL(), psz_path ); +free( psz_path ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: use d3d11_device_t instead of ID3D11Device
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:35 2017 +0100| [fc35b698bb0df1f6f3c5d423b4e9261a0d511da8] | committer: Jean-Baptiste Kempf hw:d3d11: use d3d11_device_t instead of ID3D11Device Keep the device for the lifetime of the filter Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc35b698bb0df1f6f3c5d423b4e9261a0d511da8 --- modules/hw/d3d11/d3d11_deinterlace.c | 30 +++--- modules/hw/d3d11/d3d11_filters.c | 33 + modules/hw/d3d11/d3d11_surface.c | 18 -- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 1b977d9847..9d466ef78e 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -51,6 +51,7 @@ typedef UINT D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS; struct filter_sys_t { +d3d11_device_t d3d_dev; ID3D11VideoDevice *d3dviddev; ID3D11VideoContext *d3dvidctx; ID3D11VideoProcessor *videoProcessor; @@ -285,7 +286,6 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; -ID3D11Device *d3ddevice = NULL; ID3D11VideoProcessorEnumerator *processorEnumerator = NULL; if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma)) @@ -293,6 +293,11 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; +filter_sys_t *sys = malloc(sizeof (*sys)); +if (unlikely(sys == NULL)) +return VLC_ENOMEM; +memset(sys, 0, sizeof (*sys)); + picture_t *dst = filter_NewPicture(filter); if (dst == NULL) return VLC_EGENERIC; @@ -305,21 +310,16 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) D3D11_TEXTURE2D_DESC dstDesc; ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); +sys->d3d_dev.d3dcontext = dst->p_sys->context; +ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); -filter_sys_t *sys = malloc(sizeof (*sys)); -if (unlikely(sys == NULL)) -goto error; -memset(sys, 0, sizeof (*sys)); - -ID3D11DeviceContext_GetDevice(dst->p_sys->context, ); - -hr = ID3D11Device_QueryInterface(d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); +hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); goto error; } -hr = ID3D11DeviceContext_QueryInterface(dst->p_sys->context, _ID3D11VideoContext, (void **)>d3dvidctx); +hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, _ID3D11VideoContext, (void **)>d3dvidctx); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoContext Interface from the picture. (hr=0x%lX)", hr); goto error; @@ -327,7 +327,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) HANDLE context_lock = INVALID_HANDLE_VALUE; UINT dataSize = sizeof(context_lock); -hr = ID3D11Device_GetPrivateData(d3ddevice, _CONTEXT_MUTEX, , _lock); +hr = ID3D11Device_GetPrivateData(sys->d3d_dev.d3ddevice, _CONTEXT_MUTEX, , _lock); if (FAILED(hr)) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; @@ -442,7 +442,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) texDesc.Height = dstDesc.Height; texDesc.Width = dstDesc.Width; -hr = ID3D11Device_CreateTexture2D( d3ddevice, , NULL, >outTexture ); +hr = ID3D11Device_CreateTexture2D( sys->d3d_dev.d3ddevice, , NULL, >outTexture ); if (FAILED(hr)) { msg_Err(filter, "CreateTexture2D failed. (hr=0x%0lx)", hr); goto error; @@ -493,12 +493,9 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) filter->pf_flush= Flush; filter->p_sys = sys; -ID3D11Device_Release(d3ddevice); picture_Release(dst); return VLC_SUCCESS; error: -if (d3ddevice) -ID3D11Device_Release(d3ddevice); picture_Release(dst); if (sys->outTexture) @@ -511,6 +508,8 @@ error: ID3D11VideoContext_Release(sys->d3dvidctx); if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); +if (sys->d3d_dev.d3dcontext) +D3D11_ReleaseDevice(>d3d_dev); return VLC_EGENERIC; } @@ -526,6 +525,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj) ID3D11VideoProcessorEnumerator_Release(sys->procEnumerator); ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); +D3D11_ReleaseDevice(>d3d_dev); free(sys); } diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c index 70764a3e87..de97ee2582 100644 ---
[vlc-commits] hw:d3d9: add a file to control the D3D9 device common to all filters
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:33 2017 +0100| [cd37cf5dda25c402849b87959b99924e553ee2bf] | committer: Jean-Baptiste Kempf hw:d3d9: add a file to control the D3D9 device common to all filters Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd37cf5dda25c402849b87959b99924e553ee2bf --- modules/hw/d3d9/Makefile.am | 3 +- modules/hw/d3d9/d3d9_filters.h | 5 ++ modules/hw/d3d9/d3d9_instance.c | 107 3 files changed, 114 insertions(+), 1 deletion(-) diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am index fabec1b6e3..1711953e39 100644 --- a/modules/hw/d3d9/Makefile.am +++ b/modules/hw/d3d9/Makefile.am @@ -3,7 +3,8 @@ d3d9dir = $(pluginsdir)/d3d9 libdirect3d9_filters_plugin_la_SOURCES = hw/d3d9/d3d9_filters.h \ hw/d3d9/d3d9_filters.c \ hw/d3d9/dxva2_deinterlace.c \ -hw/d3d9/dxa9.c +hw/d3d9/dxa9.c \ +hw/d3d9/d3d9_instance.c libdirect3d9_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d9dir)' libdirect3d9_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d9_common.la $(LIBCOM) diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h index 0d495dc2e5..ee0878bf3e 100644 --- a/modules/hw/d3d9/d3d9_filters.h +++ b/modules/hw/d3d9/d3d9_filters.h @@ -25,6 +25,8 @@ #include +#include "../../video_chroma/d3d9_fmt.h" + int D3D9OpenDeinterlace(vlc_object_t *); void D3D9CloseDeinterlace(vlc_object_t *); int D3D9OpenConverter(vlc_object_t *); @@ -32,4 +34,7 @@ void D3D9CloseConverter(vlc_object_t *); int D3D9OpenCPUConverter(vlc_object_t *); void D3D9CloseCPUConverter(vlc_object_t *); +void D3D9_FilterHoldInstance(filter_t *, d3d9_device_t *, D3DSURFACE_DESC *); +void D3D9_FilterReleaseInstance(d3d9_device_t *); + #endif /* VLC_D3D9_FILTERS_H */ diff --git a/modules/hw/d3d9/d3d9_instance.c b/modules/hw/d3d9/d3d9_instance.c new file mode 100644 index 00..81dc704b26 --- /dev/null +++ b/modules/hw/d3d9/d3d9_instance.c @@ -0,0 +1,107 @@ +/* + * d3d9_instance.c: D3D9 unique device context instance + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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 COBJMACROS +#include + +#include "d3d9_filters.h" + +static vlc_mutex_t inst_lock = VLC_STATIC_MUTEX; +static d3d9_device_t device = { .dev = NULL }; +static size_t instances = 0; + +void D3D9_FilterHoldInstance(filter_t *filter, d3d9_device_t *out, D3DSURFACE_DESC *dstDesc) +{ +out->dev = NULL; + +picture_t *pic = filter_NewPicture(filter); +if (!pic) +return; + +picture_sys_t *p_sys = ActivePictureSys(pic); + +vlc_mutex_lock(_lock); +if (p_sys) +{ +if (FAILED(IDirect3DSurface9_GetDevice( p_sys->surface, >dev ))) +goto done; +IDirect3DDevice9_Release(out->dev); +if (FAILED(IDirect3DSurface9_GetDesc( p_sys->surface, dstDesc ))) +{ +out->dev = NULL; +goto done; +} + +if (device.dev == NULL) +{ +device.dev = out->dev; +instances++; +} +} +else +{ +*out = device; +if (device.dev != NULL) +instances++; + +memset(dstDesc, 0, sizeof(*dstDesc)); +if (filter->fmt_in.video.i_chroma == VLC_CODEC_D3D9_OPAQUE_10B) +dstDesc->Format = MAKEFOURCC('P','0','1','0'); +else +dstDesc->Format = MAKEFOURCC('N','V','1','2'); +dstDesc->Width = filter->fmt_out.video.i_width; +dstDesc->Height = filter->fmt_out.video.i_height; +} + +out->owner = false; +if (unlikely(out->dev == NULL)) +msg_Warn(filter, "no context available"); +else +IDirect3DDevice9_AddRef(out->dev); + +done: +vlc_mutex_unlock(_lock);
[vlc-commits] skin2: fix string can't be parsed by gettext
vlc | branch: master | Pierre Lamot| Thu Nov 23 10:03:50 2017 +0100| [39d49cef673e647938921d106089cd57bbdf4b01] | committer: Jean-Baptiste Kempf skin2: fix string can't be parsed by gettext fix: #19117 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=39d49cef673e647938921d106089cd57bbdf4b01 --- modules/gui/skins2/src/dialogs.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp index 79885ea5d8..276909a875 100644 --- a/modules/gui/skins2/src/dialogs.cpp +++ b/modules/gui/skins2/src/dialogs.cpp @@ -22,6 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ +#include #include "dialogs.hpp" #include "../commands/async_queue.hpp" #include "../commands/cmd_change_skin.hpp" @@ -210,9 +211,10 @@ void Dialogs::showChangeSkin() void Dialogs::showPlaylistLoad() { +std::stringstream fileTypes; +fileTypes << _("Playlist Files|") << EXTENSIONS_PLAYLIST << _("|All Files|*"); showFileGeneric( _("Open playlist"), - _("Playlist Files|" EXTENSIONS_PLAYLIST "|" - "All Files|*"), + fileTypes.str(), showPlaylistLoadCB, kOPEN ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: make use of D3D9_FilterHoldInstance()
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:37 2017 +0100| [2de1dbfc357470977016c144de17621484380864] | committer: Jean-Baptiste Kempf hw:d3d9: make use of D3D9_FilterHoldInstance() Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2de1dbfc357470977016c144de17621484380864 --- modules/hw/d3d9/d3d9_filters.c | 27 ++- modules/hw/d3d9/dxa9.c | 20 +++- modules/hw/d3d9/dxva2_deinterlace.c | 28 ++-- 3 files changed, 19 insertions(+), 56 deletions(-) diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c index d0212718eb..0fd40fb02a 100644 --- a/modules/hw/d3d9/d3d9_filters.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -225,7 +225,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) HINSTANCE hdecoder_dll = NULL; HINSTANCE d3d9_dll = NULL; HRESULT hr; -picture_t *dst = NULL; GUID *processorGUIDs = NULL; GUID *processorGUID = NULL; IDirectXVideoProcessorService *processor = NULL; @@ -248,13 +247,11 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (!hdecoder_dll) goto error; -dst = filter_NewPicture(filter); -if (dst == NULL) -goto error; - -if (!dst->p_sys) +D3DSURFACE_DESC dstDesc; +D3D9_FilterHoldInstance(filter, >d3d_dev, ); +if (!sys->d3d_dev.dev) { -msg_Dbg(filter, "D3D9 opaque without a texture"); +msg_Dbg(filter, "Filter without a context"); goto error; } @@ -266,15 +263,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (CreateVideoService == NULL) goto error; -hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3d_dev.dev ); -if (FAILED(hr)) -goto error; - -D3DSURFACE_DESC dstDesc; -hr = IDirect3DSurface9_GetDesc( dst->p_sys->surface, ); -if (unlikely(FAILED(hr))) -goto error; - hr = CreateVideoService( sys->d3d_dev.dev, _IDirectXVideoProcessorService, (void**)); if (FAILED(hr)) @@ -397,7 +385,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) goto error; CoTaskMemFree(processorGUIDs); -picture_Release(dst); IDirectXVideoProcessorService_Release(processor); sys->hdecoder_dll = hdecoder_dll; @@ -414,13 +401,11 @@ error: if (processor) IDirectXVideoProcessorService_Release(processor); if (sys) -D3D9_ReleaseDevice( >d3d_dev ); +D3D9_FilterReleaseInstance( >d3d_dev ); if (hdecoder_dll) FreeLibrary(hdecoder_dll); if (d3d9_dll) FreeLibrary(d3d9_dll); -if (dst) -picture_Release(dst); free(sys); return VLC_EGENERIC; @@ -433,7 +418,7 @@ static void D3D9CloseAdjust(vlc_object_t *obj) IDirect3DSurface9_Release( sys->hw_surface ); IDirectXVideoProcessor_Release( sys->processor ); -D3D9_ReleaseDevice( >d3d_dev ); +D3D9_FilterReleaseInstance( >d3d_dev ); FreeLibrary( sys->hdecoder_dll ); FreeLibrary( sys->d3d9_dll ); diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 6815db2a93..fed821c8ff 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -369,17 +369,13 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) goto done; } -picture_t *peek = filter_NewPicture(p_filter); -if (peek == NULL) -return VLC_EGENERIC; -if (!peek->p_sys) +D3DSURFACE_DESC texDesc; +D3D9_FilterHoldInstance(p_filter, _sys->d3d_dev, ); +if (!p_sys->d3d_dev.dev) { -msg_Dbg(p_filter, "D3D9 opaque without a texture"); -return VLC_EGENERIC; +msg_Dbg(p_filter, "Filter without a context"); +goto done; } - -D3DSURFACE_DESC texDesc; -IDirect3DSurface9_GetDesc( peek->p_sys->surface, ); if (texDesc.Format == 0) goto done; @@ -406,7 +402,6 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) } picture_Setup(p_dst, _dst->format); -IDirect3DSurface9_GetDevice(peek->p_sys->surface, _sys->d3d_dev.dev); HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_sys->d3d_dev.dev, p_dst->format.i_width, p_dst->format.i_height, @@ -440,14 +435,13 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) done: video_format_Clean(_staging); -picture_Release(peek); if (err != VLC_SUCCESS) { if (p_cpu_filter) DeleteFilter( p_cpu_filter ); if (texture) IDirect3DSurface9_Release(texture); -D3D9_ReleaseDevice(_sys->d3d_dev); +D3D9_FilterReleaseInstance(_sys->d3d_dev); if (hd3d_dll) FreeLibrary(hd3d_dll); free(p_sys); @@ -470,7 +464,7 @@ void D3D9CloseCPUConverter( vlc_object_t *obj ) filter_sys_t *p_sys =
[vlc-commits] hw:d3d11: add a file to control the D3D11 device common to all filters
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:32 2017 +0100| [8d73a6794f27a50098e3f7b90a3283045fa556cd] | committer: Jean-Baptiste Kempf hw:d3d11: add a file to control the D3D11 device common to all filters Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8d73a6794f27a50098e3f7b90a3283045fa556cd --- modules/hw/d3d11/Makefile.am | 3 +- modules/hw/d3d11/d3d11_filters.h | 5 ++ modules/hw/d3d11/d3d11_instance.c | 106 ++ 3 files changed, 113 insertions(+), 1 deletion(-) diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 4bca091326..33d17efd8f 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -3,7 +3,8 @@ d3d11dir = $(pluginsdir)/d3d11 libdirect3d11_filters_plugin_la_SOURCES = hw/d3d11/d3d11_filters.h \ hw/d3d11/d3d11_filters.c \ hw/d3d11/d3d11_deinterlace.c \ -hw/d3d11/d3d11_surface.c +hw/d3d11/d3d11_surface.c \ +hw/d3d11/d3d11_instance.c libdirect3d11_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d11dir)' libdirect3d11_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE diff --git a/modules/hw/d3d11/d3d11_filters.h b/modules/hw/d3d11/d3d11_filters.h index 10f1076ea7..c4433937f9 100644 --- a/modules/hw/d3d11/d3d11_filters.h +++ b/modules/hw/d3d11/d3d11_filters.h @@ -25,6 +25,8 @@ #include +#include "../../video_chroma/d3d11_fmt.h" + int D3D11OpenDeinterlace(vlc_object_t *); void D3D11CloseDeinterlace(vlc_object_t *); int D3D11OpenConverter(vlc_object_t *); @@ -32,4 +34,7 @@ void D3D11CloseConverter(vlc_object_t *); int D3D11OpenCPUConverter(vlc_object_t *); void D3D11CloseCPUConverter(vlc_object_t *); +void D3D11_FilterHoldInstance(filter_t *, d3d11_device_t *, D3D11_TEXTURE2D_DESC *); +void D3D11_FilterReleaseInstance(d3d11_device_t *); + #endif /* VLC_D3D11_FILTERS_H */ diff --git a/modules/hw/d3d11/d3d11_instance.c b/modules/hw/d3d11/d3d11_instance.c new file mode 100644 index 00..1011de4d84 --- /dev/null +++ b/modules/hw/d3d11/d3d11_instance.c @@ -0,0 +1,106 @@ +/* + * d3d11_instance.c: D3D11 unique device context instance + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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 COBJMACROS +#include + +#include "d3d11_filters.h" + +static vlc_mutex_t inst_lock = VLC_STATIC_MUTEX; +static d3d11_device_t device = { .d3dcontext = NULL }; +static size_t instances = 0; + +void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTURE2D_DESC *dstDesc) +{ +picture_t *pic = filter_NewPicture(filter); +if (!pic) +{ +out->d3dcontext = NULL; +return; +} + +picture_sys_t *p_sys = ActivePictureSys(pic); + +vlc_mutex_lock(_lock); +if (p_sys) +{ +out->d3dcontext = p_sys->context; +ID3D11DeviceContext_GetDevice(out->d3dcontext, >d3ddevice); +ID3D11Device_Release(out->d3ddevice); +if (device.d3dcontext == NULL) +{ +device = *out; +instances++; +} + +ID3D11Texture2D_GetDesc(p_sys->texture[KNOWN_DXGI_INDEX], dstDesc); +} +else +{ +*out = device; +if (device.d3dcontext != NULL) +instances++; + +memset(dstDesc, 0, sizeof(*dstDesc)); +if (filter->fmt_in.video.i_chroma == VLC_CODEC_D3D11_OPAQUE_10B) +dstDesc->Format = DXGI_FORMAT_P010; +else +dstDesc->Format = DXGI_FORMAT_NV12; +dstDesc->Width = filter->fmt_out.video.i_width; +dstDesc->Height = filter->fmt_out.video.i_height; +} + +out->owner = false; +if (unlikely(out->d3dcontext == NULL)) +msg_Warn(filter, "no context available"); +else +{ +
[vlc-commits] dxva2_deinterlace: create the texture for pictures coming from a bogus pool
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:39 2017 +0100| [b0ab659f403db975d6a5bcbc923239b6ae7decb0] | committer: Jean-Baptiste Kempf dxva2_deinterlace: create the texture for pictures coming from a bogus pool Fixes #18936 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b0ab659f403db975d6a5bcbc923239b6ae7decb0 --- modules/hw/d3d9/dxva2_deinterlace.c | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 994ee997ea..8088db1a91 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -249,11 +249,40 @@ static struct picture_context_t *d3d9_pic_context_copy(struct picture_context_t static picture_t *NewOutputPicture( filter_t *p_filter ) { -picture_t *pic = p_filter->p_sys->buffer_new( p_filter ); +filter_sys_t *p_sys = p_filter->p_sys; +picture_t *pic = p_sys->buffer_new( p_filter ); if ( !pic->context ) { +bool b_local_texture = false; + +if (!pic->p_sys ) +{ +D3DSURFACE_DESC dstDesc; +if ( !p_sys->hw_surface || + FAILED(IDirect3DSurface9_GetDesc( p_sys->hw_surface, )) ) +return NULL; + +pic->p_sys = calloc(1, sizeof(*pic->p_sys)); +if (unlikely(pic->p_sys == NULL)) +return NULL; + +HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_sys->d3d_dev.dev, + p_filter->fmt_out.video.i_width, + p_filter->fmt_out.video.i_height, + dstDesc.Format, + D3DPOOL_DEFAULT, + >p_sys->surface, + NULL); + +if (FAILED(hr)) +{ +free(pic->p_sys); +pic->p_sys = NULL; +return NULL; +} +b_local_texture = true; +} /* the picture might be duplicated for snapshots so it needs a context */ -assert( pic->p_sys != NULL ); /* this opaque picture is wrong */ struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx)); if (likely(pic_ctx!=NULL)) { @@ -263,6 +292,8 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) AcquirePictureSys( _ctx->picsys ); pic->context = _ctx->s; } +if (b_local_texture) +IDirect3DSurface9_Release(pic->p_sys->surface); } return pic; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: rename the Open/Close for each module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:29 2017 +0100| [a5d181248b18f4fe93161bfae778a2be677a652c] | committer: Jean-Baptiste Kempf hw:d3d9: rename the Open/Close for each module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5d181248b18f4fe93161bfae778a2be677a652c --- modules/hw/d3d9/d3d9_adjust.c | 6 +++--- modules/hw/d3d9/dxa9.c | 12 ++-- modules/hw/d3d9/dxva2_deinterlace.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/hw/d3d9/d3d9_adjust.c b/modules/hw/d3d9/d3d9_adjust.c index e523d4b10d..b62ea5ef95 100644 --- a/modules/hw/d3d9/d3d9_adjust.c +++ b/modules/hw/d3d9/d3d9_adjust.c @@ -216,7 +216,7 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var, return VLC_SUCCESS; } -static int Open(vlc_object_t *obj) +static int D3D9OpenAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = NULL; @@ -424,7 +424,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D9CloseAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -443,7 +443,7 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D9OpenAdjust, D3D9CloseAdjust) add_shortcut( "adjust" ) add_float_with_range( "contrast", 1.0, 0.0, 2.0, diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 93095ca055..ff26e2d3ff 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -287,7 +287,7 @@ VIDEO_FILTER_WRAPPER (DXA9_YV12) VIDEO_FILTER_WRAPPER (DXA9_NV12) VIDEO_FILTER_WRAPPER (YV12_D3D9) -static int OpenConverter( vlc_object_t *obj ) +static int D3D9OpenConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; HINSTANCE hd3d_dll = NULL; @@ -336,7 +336,7 @@ done: return err; } -static int OpenFromCPU( vlc_object_t *obj ) +static int D3D9OpenCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -455,7 +455,7 @@ done: return err; } -static void CloseConverter( vlc_object_t *obj ) +static void D3D9CloseConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; copy_cache_t *p_copy_cache = (copy_cache_t*) p_filter->p_sys; @@ -464,7 +464,7 @@ static void CloseConverter( vlc_object_t *obj ) p_filter->p_sys = NULL; } -static void CloseFromCPU( vlc_object_t *obj ) +static void D3D9CloseCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; @@ -482,8 +482,8 @@ static void CloseFromCPU( vlc_object_t *obj ) vlc_module_begin () set_description( N_("Conversions from DxVA2 to YUV") ) set_capability( "video converter", 10 ) -set_callbacks( OpenConverter, CloseConverter ) +set_callbacks( D3D9OpenConverter, D3D9CloseConverter ) add_submodule() -set_callbacks( OpenFromCPU, CloseFromCPU ) +set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter ) set_capability( "video converter", 10 ) vlc_module_end () diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 4dfc906950..06fb217826 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -266,7 +266,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int Open(vlc_object_t *obj) +static int D3D9OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = NULL; @@ -492,7 +492,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D9CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -511,6 +511,6 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace) add_shortcut ("deinterlace") vlc_module_end() ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dxva2_deinterlace: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:26 2017 +0100| [020975b40c8949cfccbfb0e742fecfc8889255ef] | committer: Jean-Baptiste Kempf dxva2_deinterlace: clean code Simplify the init, we don't know the order yet Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=020975b40c8949cfccbfb0e742fecfc8889255ef --- modules/hw/d3d9/dxva2_deinterlace.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 98444d19d6..4dfc906950 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -341,11 +341,7 @@ static int Open(vlc_object_t *obj) dsc.InputSampleFreq.Denominator = 0; } dsc.OutputFrameFreq = dsc.InputSampleFreq; - -DXVA2_ExtendedFormat *pFormat = -pFormat->SampleFormat = dst->b_top_field_first ? -DXVA2_SampleFieldInterleavedEvenFirst : -DXVA2_SampleFieldInterleavedOddFirst; +dsc.SampleFormat.SampleFormat = DXVA2_SampleFieldInterleavedEvenFirst; UINT count = 0; hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids( processor, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: move all the filters into a single module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:31 2017 +0100| [ea902a998665c568d08c2568c8d55bab82282f8d] | committer: Jean-Baptiste Kempf hw:d3d9: move all the filters into a single module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ea902a998665c568d08c2568c8d55bab82282f8d --- configure.ac | 2 +- modules/hw/d3d9/Makefile.am | 25 ++-- modules/hw/d3d9/{d3d9_adjust.c => d3d9_filters.c} | 18 ++-- modules/hw/d3d9/d3d9_filters.h| 35 +++ modules/hw/d3d9/dxa9.c| 23 --- modules/hw/d3d9/dxva2_deinterlace.c | 16 +++ 6 files changed, 70 insertions(+), 49 deletions(-) diff --git a/configure.ac b/configure.ac index b9fe565659..47d53cc07d 100644 --- a/configure.ac +++ b/configure.ac @@ -3338,7 +3338,7 @@ AS_IF([test "${enable_directx}" != "no"], [ #endif ]],[[;]]) ],[ -VLC_ADD_PLUGIN([direct3d9_deinterlace direct3d9_adjust]) +VLC_ADD_PLUGIN([direct3d9_filters]) ], [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])]) diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am index 0ce35b8efd..fabec1b6e3 100644 --- a/modules/hw/d3d9/Makefile.am +++ b/modules/hw/d3d9/Makefile.am @@ -1,22 +1,13 @@ d3d9dir = $(pluginsdir)/d3d9 -d3d9_LTLIBRARIES = -# GPU/CPU converter -libdxa9_plugin_la_SOURCES = hw/d3d9/dxa9.c -libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la - -if HAVE_AVCODEC_DXVA2 -d3d9_LTLIBRARIES += libdxa9_plugin.la -endif - -libdirect3d9_deinterlace_plugin_la_SOURCES = hw/d3d9/dxva2_deinterlace.c -libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la -libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_SOURCES = hw/d3d9/d3d9_adjust.c -libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) +libdirect3d9_filters_plugin_la_SOURCES = hw/d3d9/d3d9_filters.h \ +hw/d3d9/d3d9_filters.c \ +hw/d3d9/dxva2_deinterlace.c \ +hw/d3d9/dxa9.c +libdirect3d9_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d9dir)' +libdirect3d9_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d9_common.la $(LIBCOM) if HAVE_WIN32_DESKTOP -#video_filter_LTLIBRARIES = $(LTLIBdirect3d9_deinterlace) $(LTLIBdirect3d9_adjust) -d3d9_LTLIBRARIES += libdirect3d9_deinterlace_plugin.la libdirect3d9_adjust_plugin.la +d3d9_LTLIBRARIES = $(LTLIBdirect3d9_filters) +EXTRA_LTLIBRARIES += libdirect3d9_filters_plugin.la endif diff --git a/modules/hw/d3d9/d3d9_adjust.c b/modules/hw/d3d9/d3d9_filters.c similarity index 97% rename from modules/hw/d3d9/d3d9_adjust.c rename to modules/hw/d3d9/d3d9_filters.c index b62ea5ef95..9153b931b6 100644 --- a/modules/hw/d3d9/d3d9_adjust.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -1,7 +1,7 @@ /* - * d3d9_adjust.c: D3D9 adjust filter (no gamma) + * d3d9_filters.c: D3D9 filters module callbacks * - * Copyright (C) 2017 Videolabs SAS + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs * * Authors: Steve Lhomme * @@ -39,6 +39,8 @@ #include #include "../../video_chroma/d3d9_fmt.h" +#include "d3d9_filters.h" + struct filter_level { atomic_int level; @@ -464,4 +466,16 @@ vlc_module_begin() add_bool( "brightness-threshold", false, THRES_TEXT, THRES_LONGTEXT, false ) change_safe() + +add_submodule() +set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace) +add_shortcut ("deinterlace") + +add_submodule() +set_capability( "video converter", 10 ) +set_callbacks( D3D9OpenConverter, D3D9CloseConverter ) + +add_submodule() +set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter ) +set_capability( "video converter", 10 ) vlc_module_end() diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h new file mode 100644 index 00..0d495dc2e5 --- /dev/null +++ b/modules/hw/d3d9/d3d9_filters.h @@ -0,0 +1,35 @@ +/* + * d3d9_filters.h : D3D9 filters module callbacks + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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
[vlc-commits] hw:d3d11: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:24 2017 +0100| [b2c55fee53e227d577db3ad4e7a0ac0209874978] | committer: Jean-Baptiste Kempf hw:d3d11: clean code Use local variables when possible Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b2c55fee53e227d577db3ad4e7a0ac0209874978 --- modules/hw/d3d11/d3d11_adjust.c | 16 modules/hw/d3d11/d3d11_deinterlace.c | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index e00bdf3c7a..c954c79c08 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -350,7 +350,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; -const video_format_t *fmt = >format; +const video_format_t *fmt = >fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE, @@ -360,11 +360,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, -.OutputWidth = dst->format.i_width, -.OutputHeight = dst->format.i_height, +.OutputWidth = dstDesc.Width, +.OutputHeight = dstDesc.Height, .OutputFrameRate = { -.Numerator = dst->format.i_frame_rate, -.Denominator = dst->format.i_frame_rate_base, +.Numerator = fmt->i_frame_rate, +.Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -379,16 +379,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, ); +hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, ); if (!SUCCEEDED(hr)) { -msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { -msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dstDesc.Format)); goto error; } diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index b47f0dc342..1e310fb2dc 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -332,7 +332,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; -const video_format_t *fmt = >format; +const video_format_t *fmt = >fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST, @@ -342,11 +342,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, -.OutputWidth = dst->format.i_width, -.OutputHeight = dst->format.i_height, +.OutputWidth = dstDesc.Width, +.OutputHeight = dstDesc.Height, .OutputFrameRate = { -.Numerator = dst->format.i_frame_rate, -.Denominator = dst->format.i_frame_rate_base, +.Numerator = fmt->i_frame_rate, +.Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -361,16 +361,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, ); +hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, ); if (!SUCCEEDED(hr)) { -msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { -msg_Dbg(filter, "deinterlacing %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "deinterlacing %s is not supported",
[vlc-commits] hw:d3d11: rename the Open/Close for each module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:28 2017 +0100| [e9caa9b46a70839c82b54e58b6cee557dd3d6df8] | committer: Jean-Baptiste Kempf hw:d3d11: rename the Open/Close for each module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9caa9b46a70839c82b54e58b6cee557dd3d6df8 --- modules/hw/d3d11/d3d11_adjust.c | 6 +++--- modules/hw/d3d11/d3d11_deinterlace.c | 6 +++--- modules/hw/d3d11/d3d11_surface.c | 12 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index 1c4aca64fb..f5ace01acc 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -324,7 +324,7 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var, return VLC_SUCCESS; } -static int Open(vlc_object_t *obj) +static int D3D11OpenAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -587,7 +587,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D11CloseAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -620,7 +620,7 @@ vlc_module_begin() set_capability("video filter", 0) set_category( CAT_VIDEO ) set_subcategory( SUBCAT_VIDEO_VFILTER ) -set_callbacks(Open, Close) +set_callbacks(D3D11OpenAdjust, D3D11CloseAdjust) add_shortcut( "adjust" ) add_float_with_range( "contrast", 1.0, 0.0, 2.0, diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 1e310fb2dc..64c098558e 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -281,7 +281,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int Open(vlc_object_t *obj) +static int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -515,7 +515,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D11CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -535,6 +535,6 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D11OpenDeinterlace, D3D11CloseDeinterlace) add_shortcut ("deinterlace") vlc_module_end() diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c index ca79b224a3..24de73ae7c 100644 --- a/modules/hw/d3d11/d3d11_surface.c +++ b/modules/hw/d3d11/d3d11_surface.c @@ -624,7 +624,7 @@ VIDEO_FILTER_WRAPPER (D3D11_NV12) VIDEO_FILTER_WRAPPER (D3D11_YUY2) VIDEO_FILTER_WRAPPER (NV12_D3D11) -static int OpenConverter( vlc_object_t *obj ) +static int D3D11OpenConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -671,7 +671,7 @@ done: return err; } -static int OpenFromCPU( vlc_object_t *obj ) +static int D3D11OpenCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -796,7 +796,7 @@ done: return err; } -static void CloseConverter( vlc_object_t *obj ) +static 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; @@ -819,7 +819,7 @@ static void CloseConverter( vlc_object_t *obj ) p_filter->p_sys = NULL; } -static void CloseFromCPU( vlc_object_t *obj ) +static void D3D11CloseCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; @@ -836,8 +836,8 @@ static void CloseFromCPU( vlc_object_t *obj ) vlc_module_begin () set_description( N_("Conversions from D3D11 to YUV") ) set_capability( "video converter", 10 ) -set_callbacks( OpenConverter, CloseConverter ) +set_callbacks( D3D11OpenConverter, D3D11CloseConverter ) add_submodule() -set_callbacks( OpenFromCPU, CloseFromCPU ) +set_callbacks( D3D11OpenCPUConverter, D3D11CloseCPUConverter ) set_capability( "video converter", 10 ) vlc_module_end () ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: make use of D3D11_FilterHoldInstance()
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:36 2017 +0100| [564c535dfd1c698bbf6da10324b3152f00e2f496] | committer: Jean-Baptiste Kempf hw:d3d11: make use of D3D11_FilterHoldInstance() Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=564c535dfd1c698bbf6da10324b3152f00e2f496 --- modules/hw/d3d11/d3d11_deinterlace.c | 25 - modules/hw/d3d11/d3d11_filters.c | 25 - modules/hw/d3d11/d3d11_surface.c | 16 +--- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 9d466ef78e..f0b087af40 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -298,21 +298,15 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) return VLC_ENOMEM; memset(sys, 0, sizeof (*sys)); -picture_t *dst = filter_NewPicture(filter); -if (dst == NULL) -return VLC_EGENERIC; -if (!dst->p_sys) +D3D11_TEXTURE2D_DESC dstDesc; +D3D11_FilterHoldInstance(filter, >d3d_dev, ); +if (unlikely(sys->d3d_dev.d3dcontext==NULL)) { -msg_Dbg(filter, "D3D11 opaque without a texture"); -picture_Release(dst); -return VLC_EGENERIC; +msg_Dbg(filter, "Filter without a context"); +free(sys); +return VLC_ENOOBJ; } -D3D11_TEXTURE2D_DESC dstDesc; -ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); -sys->d3d_dev.d3dcontext = dst->p_sys->context; -ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); - hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); @@ -493,11 +487,8 @@ int D3D11OpenDeinterlace(vlc_object_t *obj) filter->pf_flush= Flush; filter->p_sys = sys; -picture_Release(dst); return VLC_SUCCESS; error: -picture_Release(dst); - if (sys->outTexture) ID3D11Texture2D_Release(sys->outTexture); if (sys->videoProcessor) @@ -509,7 +500,7 @@ error: if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); if (sys->d3d_dev.d3dcontext) -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); return VLC_EGENERIC; } @@ -525,7 +516,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj) ID3D11VideoProcessorEnumerator_Release(sys->procEnumerator); ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); free(sys); } diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c index de97ee2582..8b5a448ce0 100644 --- a/modules/hw/d3d11/d3d11_filters.c +++ b/modules/hw/d3d11/d3d11_filters.c @@ -342,21 +342,15 @@ static int D3D11OpenAdjust(vlc_object_t *obj) return VLC_ENOMEM; memset(sys, 0, sizeof (*sys)); -picture_t *dst = filter_NewPicture(filter); -if (dst == NULL) -return VLC_EGENERIC; -if (!dst->p_sys) +D3D11_TEXTURE2D_DESC dstDesc; +D3D11_FilterHoldInstance(filter, >d3d_dev, ); +if (unlikely(sys->d3d_dev.d3dcontext==NULL)) { -msg_Dbg(filter, "D3D11 opaque without a texture"); -picture_Release(dst); -return VLC_EGENERIC; +msg_Dbg(filter, "Filter without a context"); +free(sys); +return VLC_ENOOBJ; } -D3D11_TEXTURE2D_DESC dstDesc; -ID3D11Texture2D_GetDesc(dst->p_sys->texture[KNOWN_DXGI_INDEX], ); -sys->d3d_dev.d3dcontext = dst->p_sys->context; -ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, >d3d_dev.d3ddevice); - hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, _ID3D11VideoDevice, (void **)>d3dviddev); if (FAILED(hr)) { msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); @@ -556,11 +550,8 @@ static int D3D11OpenAdjust(vlc_object_t *obj) filter->pf_video_filter = Filter; filter->p_sys = sys; -picture_Release(dst); return VLC_SUCCESS; error: -picture_Release(dst); - for (int i=0; i procInput[i]) @@ -582,7 +573,7 @@ error: if (sys->d3dviddev) ID3D11VideoDevice_Release(sys->d3dviddev); if (sys->d3d_dev.d3dcontext) -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); return VLC_EGENERIC; } @@ -612,7 +603,7 @@ static void D3D11CloseAdjust(vlc_object_t *obj) ID3D11VideoContext_Release(sys->d3dvidctx); ID3D11VideoDevice_Release(sys->d3dviddev); -D3D11_ReleaseDevice(>d3d_dev); +D3D11_FilterReleaseInstance(>d3d_dev); free(sys); } diff --git
[vlc-commits] hw:d3d9: use d3d9_device_t instead of IDirect3DDevice9
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:34 2017 +0100| [00022da0e2544b72ba92597e49054ec0eb7575fe] | committer: Jean-Baptiste Kempf hw:d3d9: use d3d9_device_t instead of IDirect3DDevice9 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=00022da0e2544b72ba92597e49054ec0eb7575fe --- modules/hw/d3d9/d3d9_filters.c | 22 +++--- modules/hw/d3d9/dxa9.c | 27 +-- modules/hw/d3d9/dxva2_deinterlace.c | 21 ++--- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c index 9153b931b6..d0212718eb 100644 --- a/modules/hw/d3d9/d3d9_filters.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -55,7 +55,7 @@ struct filter_sys_t HINSTANCE hdecoder_dll; /* keep a reference in case the vout is released first */ HINSTANCE d3d9_dll; -IDirect3DDevice9 *d3ddev; +d3d9_device_t d3d_dev; IDirectXVideoProcessor *processor; IDirect3DSurface9 *hw_surface; @@ -147,7 +147,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic) , , 1, NULL ); -hr = IDirect3DDevice9_StretchRect( p_sys->d3ddev, +hr = IDirect3DDevice9_StretchRect( p_sys->d3d_dev.dev, p_sys->hw_surface, NULL, p_outpic->p_sys->surface, NULL, D3DTEXF_NONE); @@ -236,6 +236,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; +sys = calloc(1, sizeof (*sys)); +if (unlikely(sys == NULL)) +return VLC_ENOMEM; + d3d9_dll = LoadLibrary(TEXT("D3D9.DLL")); if (!d3d9_dll) goto error; @@ -254,10 +258,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) goto error; } -sys = calloc(1, sizeof (*sys)); -if (unlikely(sys == NULL)) -goto error; - HRESULT (WINAPI *CreateVideoService)(IDirect3DDevice9 *, REFIID riid, void **ppService); @@ -266,7 +266,7 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (CreateVideoService == NULL) goto error; -hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3ddev ); +hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3d_dev.dev ); if (FAILED(hr)) goto error; @@ -275,7 +275,7 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (unlikely(FAILED(hr))) goto error; -hr = CreateVideoService( sys->d3ddev, _IDirectXVideoProcessorService, +hr = CreateVideoService( sys->d3d_dev.dev, _IDirectXVideoProcessorService, (void**)); if (FAILED(hr)) goto error; @@ -413,8 +413,8 @@ error: IDirectXVideoProcessor_Release( sys->processor ); if (processor) IDirectXVideoProcessorService_Release(processor); -if (sys && sys->d3ddev) -IDirect3DDevice9_Release( sys->d3ddev ); +if (sys) +D3D9_ReleaseDevice( >d3d_dev ); if (hdecoder_dll) FreeLibrary(hdecoder_dll); if (d3d9_dll) @@ -433,7 +433,7 @@ static void D3D9CloseAdjust(vlc_object_t *obj) IDirect3DSurface9_Release( sys->hw_surface ); IDirectXVideoProcessor_Release( sys->processor ); -IDirect3DDevice9_Release( sys->d3ddev ); +D3D9_ReleaseDevice( >d3d_dev ); FreeLibrary( sys->hdecoder_dll ); FreeLibrary( sys->d3d9_dll ); diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index d6624a7f5a..6815db2a93 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -47,7 +47,7 @@ struct filter_sys_t { copy_cache_t cache; /* CPU to GPU */ -IDirect3DDevice9 *d3ddev; +d3d9_device_t d3d_dev; filter_t *filter; picture_t *staging; @@ -265,7 +265,7 @@ static void YV12_D3D9(filter_t *p_filter, picture_t *src, picture_t *dst) RECT visibleSource = { .right = dst->format.i_width, .bottom = dst->format.i_height, }; -IDirect3DDevice9_StretchRect( sys->d3ddev, +IDirect3DDevice9_StretchRect( sys->d3d_dev.dev, sys->staging->p_sys->surface, , dst->p_sys->surface, , D3DTEXF_NONE ); @@ -342,7 +342,6 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; LPDIRECT3DSURFACE9 texture = NULL; -IDirect3DDevice9 *d3ddev = NULL; filter_t *p_cpu_filter = NULL; picture_t
[vlc-commits] demux: avi: remove enum/fix build
vlc | branch: master | Francois Cartegnie| Thu Nov 23 09:52:59 2017 +0100| [dbb5e3c3a6c0db25fa61e2e0efd4a7b4502d30c9] | committer: Jean-Baptiste Kempf demux: avi: remove enum/fix build move as defines, we can't change member type This reverts commit 5640f9814c4ed2edb9b33086f3465837e1fc4adc. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbb5e3c3a6c0db25fa61e2e0efd4a7b4502d30c9 --- modules/demux/avi/libavi.h | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h index e1c283bc01..26e1614a12 100644 --- a/modules/demux/avi/libavi.h +++ b/modules/demux/avi/libavi.h @@ -20,18 +20,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ -enum biCompression -{ -BI_RGB = 0x00, -BI_RLE8, -BI_RLE4, -BI_BITFIELDS, -BI_JPEG, -BI_PNG, -BI_CMYK = 0x0B, -BI_CMYKRLE8, -BI_CMYKRLE4 -}; +/* biCompression / Others are FourCC */ +#define BI_RGB 0x +#define BI_RLE8 0x0001 +#define BI_RLE4 0x0002 +#define BI_BITFIELDS0x0003 +#define BI_JPEG 0x0004 +#define BI_PNG 0x0005 +#define BI_CMYK 0x000B +#define BI_CMYKRLE8 0x000C +#define BI_CMYKRLE4 0x000D /* flags for use in in AVIFileHdr */ #define AVIF_HASINDEX 0x0010 /* Index at end of file? */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11_deinterlace: create the texture for pictures coming from a bogus pool
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:38 2017 +0100| [3ac5493a09e0c64d9ba7bdb4861f4678cf5312b9] | committer: Jean-Baptiste Kempf d3d11_deinterlace: create the texture for pictures coming from a bogus pool Fixes #18936 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ac5493a09e0c64d9ba7bdb4861f4678cf5312b9 --- modules/hw/d3d11/d3d11_deinterlace.c | 56 ++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index f0b087af40..2068ac63c1 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -200,12 +200,20 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic, if (FAILED(hr)) return VLC_EGENERIC; +D3D11_BOX box = { +.top = 0, +.bottom = p_outpic->format.i_visible_height, +.left = 0, +.right = p_outpic->format.i_visible_width, +.back = 1, +}; + ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], p_outpic->p_sys->slice_index, 0, 0, 0, p_sys->outResource, - 0, NULL); + 0, ); return VLC_SUCCESS; } @@ -267,8 +275,46 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) picture_t *pic = p_filter->p_sys->buffer_new( p_filter ); if ( !pic->context ) { +bool b_local_texture = false; + +if ( !pic->p_sys ) +{ +pic->p_sys = calloc(1, sizeof(*pic->p_sys)); +if (unlikely(pic->p_sys == NULL)) +return NULL; + +D3D11_TEXTURE2D_DESC dstDesc; +ID3D11Texture2D_GetDesc(p_filter->p_sys->outTexture, ); + +const d3d_format_t *cfg = NULL; +for (const d3d_format_t *output_format = GetRenderFormatList(); + output_format->name != NULL; ++output_format) +{ +if (output_format->formatTexture == dstDesc.Format && +is_d3d11_opaque(output_format->fourcc)) +{ +cfg = output_format; +break; +} +} + +/* create the texture that's missing */ +video_format_t fmt = p_filter->fmt_out.video; +fmt.i_width = dstDesc.Width; +fmt.i_height = dstDesc.Height; +if (AllocateTextures(VLC_OBJECT(p_filter), _filter->p_sys->d3d_dev, cfg, + , 1, pic->p_sys->texture) != VLC_SUCCESS) +{ +free(pic->p_sys); +return NULL; +} +b_local_texture = true; + +pic->p_sys->context = p_filter->p_sys->d3d_dev.d3dcontext; +pic->p_sys->formatTexture = dstDesc.Format; + +} /* the picture might be duplicated for snapshots so it needs a context */ -assert( pic->p_sys != NULL ); /* this opaque picture is wrong */ struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx)); if (likely(pic_ctx!=NULL)) { @@ -278,6 +324,12 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) AcquirePictureSys( _ctx->picsys ); pic->context = _ctx->s; } +if (b_local_texture) { +for (int i=0; i p_sys->texture[i]) +ID3D11Texture2D_Release(pic->p_sys->texture[i]); +} +} } return pic; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: move all the filters into a single module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:30 2017 +0100| [9e64f34450abdcc9b7ad214eaac009f9b3268066] | committer: Jean-Baptiste Kempf hw:d3d11: move all the filters into a single module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9e64f34450abdcc9b7ad214eaac009f9b3268066 --- configure.ac | 2 +- modules/hw/d3d11/Makefile.am | 35 ++ modules/hw/d3d11/d3d11_deinterlace.c | 14 ++--- .../hw/d3d11/{d3d11_adjust.c => d3d11_filters.c} | 19 ++-- modules/hw/d3d11/d3d11_filters.h | 35 ++ modules/hw/d3d11/d3d11_surface.c | 23 -- 6 files changed, 70 insertions(+), 58 deletions(-) diff --git a/configure.ac b/configure.ac index c089de8c1f..b9fe565659 100644 --- a/configure.ac +++ b/configure.ac @@ -3321,7 +3321,7 @@ AS_IF([test "${enable_directx}" != "no"], [ dnl Direct3D11 AC_CHECK_HEADERS(d3d11.h, [ -VLC_ADD_PLUGIN([direct3d11 direct3d11_deinterlace direct3d11_adjust]) +VLC_ADD_PLUGIN([direct3d11 direct3d11_filters]) ]) dnl Direct3D9 diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 999d4c6052..4bca091326 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -1,32 +1,15 @@ d3d11dir = $(pluginsdir)/d3d11 -d3d11_LTLIBRARIES = -libdirect3d11_deinterlace_plugin_la_SOURCES = hw/d3d11/d3d11_deinterlace.c -libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la +libdirect3d11_filters_plugin_la_SOURCES = hw/d3d11/d3d11_filters.h \ +hw/d3d11/d3d11_filters.c \ +hw/d3d11/d3d11_deinterlace.c \ +hw/d3d11/d3d11_surface.c +libdirect3d11_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d11dir)' +libdirect3d11_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE -libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 -endif -libdirect3d11_adjust_plugin_la_SOURCES = hw/d3d11/d3d11_adjust.c -libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la -if HAVE_WINSTORE -libdirect3d11_adjust_plugin_la_LIBADD += -ld3d11 -endif - -if HAVE_AVCODEC_D3D11VA -#video_filter_LTLIBRARIES += $(LTLIBdirect3d11_deinterlace) $(LTLIBdirect3d11_adjust) -d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_plugin.la +libdirect3d11_filters_plugin_la_LIBADD += -ld3d11 endif -# GPU/CPU converter -libd3d11_surface_plugin_la_SOURCES = hw/d3d11/d3d11_surface.c -libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la -if HAVE_WINSTORE -libd3d11_surface_plugin_la_LIBADD += -ld3d11 -endif - -if HAVE_AVCODEC_D3D11VA -d3d11_LTLIBRARIES += libd3d11_surface_plugin.la -endif +d3d11_LTLIBRARIES = $(LTLIBdirect3d11_filters) +EXTRA_LTLIBRARIES += libdirect3d11_filters_plugin.la diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 64c098558e..1b977d9847 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -36,6 +35,7 @@ #include #include +#include "d3d11_filters.h" #include "../../video_chroma/d3d11_fmt.h" #include "../../video_filter/deinterlace/common.h" @@ -281,7 +281,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int D3D11OpenDeinterlace(vlc_object_t *obj) +int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -515,7 +515,7 @@ error: return VLC_EGENERIC; } -static void D3D11CloseDeinterlace(vlc_object_t *obj) +void D3D11CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -530,11 +530,3 @@ static void D3D11CloseDeinterlace(vlc_object_t *obj) free(sys); } -vlc_module_begin() -set_description(N_("Direct3D11 deinterlacing filter")) -set_capability("video filter", 0) -set_category(CAT_VIDEO) -set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(D3D11OpenDeinterlace, D3D11CloseDeinterlace) -add_shortcut ("deinterlace") -vlc_module_end() diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_filters.c similarity index 97% rename from modules/hw/d3d11/d3d11_adjust.c rename to modules/hw/d3d11/d3d11_filters.c index f5ace01acc..70764a3e87 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_filters.c @@ -1,7 +1,7 @@ /* - * d3d11_adjust.c: D3D11 adjust filter (no gamma) + * d3d11_adjust.c: D3D11 filters module callbacks
[vlc-commits] d3d11: use is_d3d11_opaque() is more places
vlc | branch: master | Steve Lhomme| Wed Nov 22 11:03:37 2017 +0100| [40fa6b7a60de56968c209ac370257db592bd06aa] | committer: Jean-Baptiste Kempf d3d11: use is_d3d11_opaque() is more places Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40fa6b7a60de56968c209ac370257db592bd06aa --- modules/codec/avcodec/d3d11va.c| 2 +- modules/video_chroma/d3d11_fmt.c | 3 +-- modules/video_output/win32/d3d11_adjust.c | 3 +-- modules/video_output/win32/d3d11_deinterlace.c | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c index 88513065e0..8596119b58 100644 --- a/modules/codec/avcodec/d3d11va.c +++ b/modules/codec/avcodec/d3d11va.c @@ -712,7 +712,7 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id, output_format->name != NULL; ++output_format) { if (output_format->formatTexture == sys->render && -(output_format->fourcc == VLC_CODEC_D3D11_OPAQUE || output_format->fourcc == VLC_CODEC_D3D11_OPAQUE_10B)) +is_d3d11_opaque(output_format->fourcc)) { textureFmt = output_format; break; diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c index b947bd64c4..0553041d7f 100644 --- a/modules/video_chroma/d3d11_fmt.c +++ b/modules/video_chroma/d3d11_fmt.c @@ -293,8 +293,7 @@ const d3d_format_t *FindD3D11Format(ID3D11Device *d3ddevice, continue; if (bits_per_channel && bits_per_channel > output_format->bitsPerChannel) continue; -if (!allow_opaque && (output_format->fourcc == VLC_CODEC_D3D11_OPAQUE || - output_format->fourcc == VLC_CODEC_D3D11_OPAQUE_10B)) +if (!allow_opaque && is_d3d11_opaque(output_format->fourcc)) continue; DXGI_FORMAT textureFormat; diff --git a/modules/video_output/win32/d3d11_adjust.c b/modules/video_output/win32/d3d11_adjust.c index 894ff78927..e00bdf3c7a 100644 --- a/modules/video_output/win32/d3d11_adjust.c +++ b/modules/video_output/win32/d3d11_adjust.c @@ -306,8 +306,7 @@ static int Open(vlc_object_t *obj) ID3D11Device *d3ddevice = NULL; ID3D11VideoProcessorEnumerator *processorEnumerator = NULL; -if (filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE - && filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE_10B) +if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma)) return VLC_EGENERIC; if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/video_output/win32/d3d11_deinterlace.c index b68158b38e..b47f0dc342 100644 --- a/modules/video_output/win32/d3d11_deinterlace.c +++ b/modules/video_output/win32/d3d11_deinterlace.c @@ -288,8 +288,7 @@ static int Open(vlc_object_t *obj) ID3D11Device *d3ddevice = NULL; ID3D11VideoProcessorEnumerator *processorEnumerator = NULL; -if (filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE - && filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE_10B) +if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma)) return VLC_EGENERIC; if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: move the filter modules declaration in modules/hw/d3d11
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:20 2017 +0100| [ad428695a643fa0fff96b4fd663d8943948df6b7] | committer: Jean-Baptiste Kempf hw:d3d11: move the filter modules declaration in modules/hw/d3d11 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad428695a643fa0fff96b4fd663d8943948df6b7 --- modules/Makefile.am | 1 + modules/hw/d3d11/Makefile.am | 32 modules/video_chroma/Makefile.am | 12 modules/video_output/Makefile.am | 15 --- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/modules/Makefile.am b/modules/Makefile.am index 0276e271a9..c96d766f42 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -31,6 +31,7 @@ include codec/Makefile.am include control/Makefile.am include demux/Makefile.am include gui/Makefile.am +include hw/d3d11/Makefile.am include hw/vaapi/Makefile.am include hw/vdpau/Makefile.am include keystore/Makefile.am diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am new file mode 100644 index 00..8b777d2386 --- /dev/null +++ b/modules/hw/d3d11/Makefile.am @@ -0,0 +1,32 @@ +d3d11dir = $(pluginsdir)/d3d11 +d3d11_LTLIBRARIES = + +libdirect3d11_deinterlace_plugin_la_SOURCES = video_output/win32/d3d11_deinterlace.c +libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' +libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la +if HAVE_WINSTORE +libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 +endif +libdirect3d11_adjust_plugin_la_SOURCES = video_output/win32/d3d11_adjust.c +libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' +libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la +if HAVE_WINSTORE +libdirect3d11_adjust_plugin_la_LIBADD += -ld3d11 +endif + +if HAVE_AVCODEC_D3D11VA +#video_filter_LTLIBRARIES += $(LTLIBdirect3d11_deinterlace) $(LTLIBdirect3d11_adjust) +d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_plugin.la +endif + +# GPU/CPU converter +libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c +libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la +if HAVE_WINSTORE +libd3d11_surface_plugin_la_LIBADD += -ld3d11 +endif + +if HAVE_AVCODEC_D3D11VA +d3d11_LTLIBRARIES += libd3d11_surface_plugin.la +endif + diff --git a/modules/video_chroma/Makefile.am b/modules/video_chroma/Makefile.am index 53e7337765..73090ab2f2 100644 --- a/modules/video_chroma/Makefile.am +++ b/modules/video_chroma/Makefile.am @@ -126,18 +126,6 @@ chroma_LTLIBRARIES += \ libdxa9_plugin.la endif -# D3D11VA -libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c -libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la -if HAVE_WINSTORE -libd3d11_surface_plugin_la_LIBADD += -ld3d11 -endif - -if HAVE_AVCODEC_D3D11VA -chroma_LTLIBRARIES += \ - libd3d11_surface_plugin.la -endif - libcvpx_plugin_la_SOURCES = codec/vt_utils.c codec/vt_utils.h video_chroma/cvpx.c if HAVE_OSX libcvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -mmacosx-version-min=10.8 diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am index 29075e9f88..30af579a96 100644 --- a/modules/video_output/Makefile.am +++ b/modules/video_output/Makefile.am @@ -288,21 +288,6 @@ libdirect3d11_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' vout_LTLIBRARIES += $(LTLIBdirect3d11) EXTRA_LTLIBRARIES += libdirect3d11_plugin.la -libdirect3d11_deinterlace_plugin_la_SOURCES = video_output/win32/d3d11_deinterlace.c -libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la -if HAVE_WINSTORE -libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 -endif -libdirect3d11_adjust_plugin_la_SOURCES = video_output/win32/d3d11_adjust.c -libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la -if HAVE_WINSTORE -libdirect3d11_adjust_plugin_la_LIBADD += -ld3d11 -endif -video_filter_LTLIBRARIES += $(LTLIBdirect3d11_deinterlace) $(LTLIBdirect3d11_adjust) -EXTRA_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_plugin.la - libdirectdraw_plugin_la_SOURCES = video_output/win32/directdraw.c \ video_output/win32/common.c video_output/win32/common.h \ video_output/win32/events.c video_output/win32/events.h \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11_fmt: reduce the size of processor support logs
vlc | branch: master | Steve Lhomme| Wed Nov 22 11:03:35 2017 +0100| [20aa304bbfd8c8cb4f981509e33544f38391c46b] | committer: Jean-Baptiste Kempf d3d11_fmt: reduce the size of processor support logs Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=20aa304bbfd8c8cb4f981509e33544f38391c46b --- modules/video_chroma/d3d11_fmt.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c index ff9f5a5a7e..b947bd64c4 100644 --- a/modules/video_chroma/d3d11_fmt.c +++ b/modules/video_chroma/d3d11_fmt.c @@ -476,10 +476,24 @@ void D3D11_LogProcessorSupport(vlc_object_t *o, HRESULT hr; for (int format = 0; format < 188; format++) { hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, ); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)) -msg_Dbg(o, "processor format %s (%d) is supported for input", DxgiFormatToStr(format),format); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) -msg_Dbg(o, "processor format %s (%d) is supported for output", DxgiFormatToStr(format),format); +if (FAILED(hr)) +continue; +const char *name = DxgiFormatToStr(format); +const char *support = NULL; +if ((flags & (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) + == (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) +support = "input/output"; +else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) +support = "input"; +else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) +support = "output"; +if (support) +{ +if (name) +msg_Dbg(o, "processor format %s is supported for %s", name, support); +else +msg_Dbg(o, "processor format (%d) is supported for %s", format, support); +} } } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: move all the filters into a single module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:31 2017 +0100| [626441fe93c55309bd2594bf94667987cf1e3b73] | committer: Jean-Baptiste Kempf hw:d3d9: move all the filters into a single module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=626441fe93c55309bd2594bf94667987cf1e3b73 --- configure.ac | 2 +- modules/hw/d3d9/Makefile.am | 25 ++-- modules/hw/d3d9/{d3d9_adjust.c => d3d9_filters.c} | 18 ++-- modules/hw/d3d9/d3d9_filters.h| 35 +++ modules/hw/d3d9/dxa9.c| 23 --- modules/hw/d3d9/dxva2_deinterlace.c | 16 +++ 6 files changed, 70 insertions(+), 49 deletions(-) diff --git a/configure.ac b/configure.ac index b9fe565659..47d53cc07d 100644 --- a/configure.ac +++ b/configure.ac @@ -3338,7 +3338,7 @@ AS_IF([test "${enable_directx}" != "no"], [ #endif ]],[[;]]) ],[ -VLC_ADD_PLUGIN([direct3d9_deinterlace direct3d9_adjust]) +VLC_ADD_PLUGIN([direct3d9_filters]) ], [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])]) diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am index 0ce35b8efd..fabec1b6e3 100644 --- a/modules/hw/d3d9/Makefile.am +++ b/modules/hw/d3d9/Makefile.am @@ -1,22 +1,13 @@ d3d9dir = $(pluginsdir)/d3d9 -d3d9_LTLIBRARIES = -# GPU/CPU converter -libdxa9_plugin_la_SOURCES = hw/d3d9/dxa9.c -libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la - -if HAVE_AVCODEC_DXVA2 -d3d9_LTLIBRARIES += libdxa9_plugin.la -endif - -libdirect3d9_deinterlace_plugin_la_SOURCES = hw/d3d9/dxva2_deinterlace.c -libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la -libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_SOURCES = hw/d3d9/d3d9_adjust.c -libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) +libdirect3d9_filters_plugin_la_SOURCES = hw/d3d9/d3d9_filters.h \ +hw/d3d9/d3d9_filters.c \ +hw/d3d9/dxva2_deinterlace.c \ +hw/d3d9/dxa9.c +libdirect3d9_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d9dir)' +libdirect3d9_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d9_common.la $(LIBCOM) if HAVE_WIN32_DESKTOP -#video_filter_LTLIBRARIES = $(LTLIBdirect3d9_deinterlace) $(LTLIBdirect3d9_adjust) -d3d9_LTLIBRARIES += libdirect3d9_deinterlace_plugin.la libdirect3d9_adjust_plugin.la +d3d9_LTLIBRARIES = $(LTLIBdirect3d9_filters) +EXTRA_LTLIBRARIES += libdirect3d9_filters_plugin.la endif diff --git a/modules/hw/d3d9/d3d9_adjust.c b/modules/hw/d3d9/d3d9_filters.c similarity index 97% rename from modules/hw/d3d9/d3d9_adjust.c rename to modules/hw/d3d9/d3d9_filters.c index b62ea5ef95..9153b931b6 100644 --- a/modules/hw/d3d9/d3d9_adjust.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -1,7 +1,7 @@ /* - * d3d9_adjust.c: D3D9 adjust filter (no gamma) + * d3d9_filters.c: D3D9 filters module callbacks * - * Copyright (C) 2017 Videolabs SAS + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs * * Authors: Steve Lhomme * @@ -39,6 +39,8 @@ #include #include "../../video_chroma/d3d9_fmt.h" +#include "d3d9_filters.h" + struct filter_level { atomic_int level; @@ -464,4 +466,16 @@ vlc_module_begin() add_bool( "brightness-threshold", false, THRES_TEXT, THRES_LONGTEXT, false ) change_safe() + +add_submodule() +set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace) +add_shortcut ("deinterlace") + +add_submodule() +set_capability( "video converter", 10 ) +set_callbacks( D3D9OpenConverter, D3D9CloseConverter ) + +add_submodule() +set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter ) +set_capability( "video converter", 10 ) vlc_module_end() diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h new file mode 100644 index 00..0d495dc2e5 --- /dev/null +++ b/modules/hw/d3d9/d3d9_filters.h @@ -0,0 +1,35 @@ +/* + * d3d9_filters.h : D3D9 filters module callbacks + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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
[vlc-commits] hw:d3d11: add a file to control the D3D11 device common to all filters
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:32 2017 +0100| [75220d0dc549a325a31ac805fd0e1d4954351720] | committer: Jean-Baptiste Kempf hw:d3d11: add a file to control the D3D11 device common to all filters Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=75220d0dc549a325a31ac805fd0e1d4954351720 --- modules/hw/d3d11/Makefile.am | 3 +- modules/hw/d3d11/d3d11_filters.h | 5 ++ modules/hw/d3d11/d3d11_instance.c | 106 ++ 3 files changed, 113 insertions(+), 1 deletion(-) diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 4bca091326..33d17efd8f 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -3,7 +3,8 @@ d3d11dir = $(pluginsdir)/d3d11 libdirect3d11_filters_plugin_la_SOURCES = hw/d3d11/d3d11_filters.h \ hw/d3d11/d3d11_filters.c \ hw/d3d11/d3d11_deinterlace.c \ -hw/d3d11/d3d11_surface.c +hw/d3d11/d3d11_surface.c \ +hw/d3d11/d3d11_instance.c libdirect3d11_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d11dir)' libdirect3d11_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE diff --git a/modules/hw/d3d11/d3d11_filters.h b/modules/hw/d3d11/d3d11_filters.h index 10f1076ea7..c4433937f9 100644 --- a/modules/hw/d3d11/d3d11_filters.h +++ b/modules/hw/d3d11/d3d11_filters.h @@ -25,6 +25,8 @@ #include +#include "../../video_chroma/d3d11_fmt.h" + int D3D11OpenDeinterlace(vlc_object_t *); void D3D11CloseDeinterlace(vlc_object_t *); int D3D11OpenConverter(vlc_object_t *); @@ -32,4 +34,7 @@ void D3D11CloseConverter(vlc_object_t *); int D3D11OpenCPUConverter(vlc_object_t *); void D3D11CloseCPUConverter(vlc_object_t *); +void D3D11_FilterHoldInstance(filter_t *, d3d11_device_t *, D3D11_TEXTURE2D_DESC *); +void D3D11_FilterReleaseInstance(d3d11_device_t *); + #endif /* VLC_D3D11_FILTERS_H */ diff --git a/modules/hw/d3d11/d3d11_instance.c b/modules/hw/d3d11/d3d11_instance.c new file mode 100644 index 00..1011de4d84 --- /dev/null +++ b/modules/hw/d3d11/d3d11_instance.c @@ -0,0 +1,106 @@ +/* + * d3d11_instance.c: D3D11 unique device context instance + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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 COBJMACROS +#include + +#include "d3d11_filters.h" + +static vlc_mutex_t inst_lock = VLC_STATIC_MUTEX; +static d3d11_device_t device = { .d3dcontext = NULL }; +static size_t instances = 0; + +void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTURE2D_DESC *dstDesc) +{ +picture_t *pic = filter_NewPicture(filter); +if (!pic) +{ +out->d3dcontext = NULL; +return; +} + +picture_sys_t *p_sys = ActivePictureSys(pic); + +vlc_mutex_lock(_lock); +if (p_sys) +{ +out->d3dcontext = p_sys->context; +ID3D11DeviceContext_GetDevice(out->d3dcontext, >d3ddevice); +ID3D11Device_Release(out->d3ddevice); +if (device.d3dcontext == NULL) +{ +device = *out; +instances++; +} + +ID3D11Texture2D_GetDesc(p_sys->texture[KNOWN_DXGI_INDEX], dstDesc); +} +else +{ +*out = device; +if (device.d3dcontext != NULL) +instances++; + +memset(dstDesc, 0, sizeof(*dstDesc)); +if (filter->fmt_in.video.i_chroma == VLC_CODEC_D3D11_OPAQUE_10B) +dstDesc->Format = DXGI_FORMAT_P010; +else +dstDesc->Format = DXGI_FORMAT_NV12; +dstDesc->Width = filter->fmt_out.video.i_width; +dstDesc->Height = filter->fmt_out.video.i_height; +} + +out->owner = false; +if (unlikely(out->d3dcontext == NULL)) +msg_Warn(filter, "no context available"); +else +{ +
[vlc-commits] hw:d3d11: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:24 2017 +0100| [bc8618412bb64b0bcfd3db3b788969824afc789c] | committer: Jean-Baptiste Kempf hw:d3d11: clean code Use local variables when possible Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc8618412bb64b0bcfd3db3b788969824afc789c --- modules/hw/d3d11/d3d11_adjust.c | 16 modules/hw/d3d11/d3d11_deinterlace.c | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index e00bdf3c7a..c954c79c08 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -350,7 +350,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; -const video_format_t *fmt = >format; +const video_format_t *fmt = >fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE, @@ -360,11 +360,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, -.OutputWidth = dst->format.i_width, -.OutputHeight = dst->format.i_height, +.OutputWidth = dstDesc.Width, +.OutputHeight = dstDesc.Height, .OutputFrameRate = { -.Numerator = dst->format.i_frame_rate, -.Denominator = dst->format.i_frame_rate_base, +.Numerator = fmt->i_frame_rate, +.Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -379,16 +379,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, ); +hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, ); if (!SUCCEEDED(hr)) { -msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { -msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dstDesc.Format)); goto error; } diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index b47f0dc342..1e310fb2dc 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -332,7 +332,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; -const video_format_t *fmt = >format; +const video_format_t *fmt = >fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST, @@ -342,11 +342,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, -.OutputWidth = dst->format.i_width, -.OutputHeight = dst->format.i_height, +.OutputWidth = dstDesc.Width, +.OutputHeight = dstDesc.Height, .OutputFrameRate = { -.Numerator = dst->format.i_frame_rate, -.Denominator = dst->format.i_frame_rate_base, +.Numerator = fmt->i_frame_rate, +.Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -361,16 +361,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, ); +hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, ); if (!SUCCEEDED(hr)) { -msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { -msg_Dbg(filter, "deinterlacing %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); +msg_Dbg(filter, "deinterlacing %s is not supported",
[vlc-commits] dxva2_deinterlace: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:26 2017 +0100| [ef7669d3d8073af2a8ea912509debd4230234d0a] | committer: Jean-Baptiste Kempf dxva2_deinterlace: clean code Simplify the init, we don't know the order yet Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef7669d3d8073af2a8ea912509debd4230234d0a --- modules/hw/d3d9/dxva2_deinterlace.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 98444d19d6..4dfc906950 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -341,11 +341,7 @@ static int Open(vlc_object_t *obj) dsc.InputSampleFreq.Denominator = 0; } dsc.OutputFrameFreq = dsc.InputSampleFreq; - -DXVA2_ExtendedFormat *pFormat = -pFormat->SampleFormat = dst->b_top_field_first ? -DXVA2_SampleFieldInterleavedEvenFirst : -DXVA2_SampleFieldInterleavedOddFirst; +dsc.SampleFormat.SampleFormat = DXVA2_SampleFieldInterleavedEvenFirst; UINT count = 0; hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids( processor, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: add a file to control the D3D9 device common to all filters
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:33 2017 +0100| [dd3cc8b5cea2e1299ca7acb2f88570c703274476] | committer: Jean-Baptiste Kempf hw:d3d9: add a file to control the D3D9 device common to all filters Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd3cc8b5cea2e1299ca7acb2f88570c703274476 --- modules/hw/d3d9/Makefile.am | 3 +- modules/hw/d3d9/d3d9_filters.h | 5 ++ modules/hw/d3d9/d3d9_instance.c | 107 3 files changed, 114 insertions(+), 1 deletion(-) diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am index fabec1b6e3..1711953e39 100644 --- a/modules/hw/d3d9/Makefile.am +++ b/modules/hw/d3d9/Makefile.am @@ -3,7 +3,8 @@ d3d9dir = $(pluginsdir)/d3d9 libdirect3d9_filters_plugin_la_SOURCES = hw/d3d9/d3d9_filters.h \ hw/d3d9/d3d9_filters.c \ hw/d3d9/dxva2_deinterlace.c \ -hw/d3d9/dxa9.c +hw/d3d9/dxa9.c \ +hw/d3d9/d3d9_instance.c libdirect3d9_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d9dir)' libdirect3d9_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d9_common.la $(LIBCOM) diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h index 0d495dc2e5..ee0878bf3e 100644 --- a/modules/hw/d3d9/d3d9_filters.h +++ b/modules/hw/d3d9/d3d9_filters.h @@ -25,6 +25,8 @@ #include +#include "../../video_chroma/d3d9_fmt.h" + int D3D9OpenDeinterlace(vlc_object_t *); void D3D9CloseDeinterlace(vlc_object_t *); int D3D9OpenConverter(vlc_object_t *); @@ -32,4 +34,7 @@ void D3D9CloseConverter(vlc_object_t *); int D3D9OpenCPUConverter(vlc_object_t *); void D3D9CloseCPUConverter(vlc_object_t *); +void D3D9_FilterHoldInstance(filter_t *, d3d9_device_t *, D3DSURFACE_DESC *); +void D3D9_FilterReleaseInstance(d3d9_device_t *); + #endif /* VLC_D3D9_FILTERS_H */ diff --git a/modules/hw/d3d9/d3d9_instance.c b/modules/hw/d3d9/d3d9_instance.c new file mode 100644 index 00..81dc704b26 --- /dev/null +++ b/modules/hw/d3d9/d3d9_instance.c @@ -0,0 +1,107 @@ +/* + * d3d9_instance.c: D3D9 unique device context instance + * + * Copyright © 2017 VLC authors, VideoLAN and VideoLabs + * + * Authors: Steve Lhomme + * + * 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 COBJMACROS +#include + +#include "d3d9_filters.h" + +static vlc_mutex_t inst_lock = VLC_STATIC_MUTEX; +static d3d9_device_t device = { .dev = NULL }; +static size_t instances = 0; + +void D3D9_FilterHoldInstance(filter_t *filter, d3d9_device_t *out, D3DSURFACE_DESC *dstDesc) +{ +out->dev = NULL; + +picture_t *pic = filter_NewPicture(filter); +if (!pic) +return; + +picture_sys_t *p_sys = ActivePictureSys(pic); + +vlc_mutex_lock(_lock); +if (p_sys) +{ +if (FAILED(IDirect3DSurface9_GetDevice( p_sys->surface, >dev ))) +goto done; +IDirect3DDevice9_Release(out->dev); +if (FAILED(IDirect3DSurface9_GetDesc( p_sys->surface, dstDesc ))) +{ +out->dev = NULL; +goto done; +} + +if (device.dev == NULL) +{ +device.dev = out->dev; +instances++; +} +} +else +{ +*out = device; +if (device.dev != NULL) +instances++; + +memset(dstDesc, 0, sizeof(*dstDesc)); +if (filter->fmt_in.video.i_chroma == VLC_CODEC_D3D9_OPAQUE_10B) +dstDesc->Format = MAKEFOURCC('P','0','1','0'); +else +dstDesc->Format = MAKEFOURCC('N','V','1','2'); +dstDesc->Width = filter->fmt_out.video.i_width; +dstDesc->Height = filter->fmt_out.video.i_height; +} + +out->owner = false; +if (unlikely(out->dev == NULL)) +msg_Warn(filter, "no context available"); +else +IDirect3DDevice9_AddRef(out->dev); + +done: +vlc_mutex_unlock(_lock);
[vlc-commits] d3d11: move the processor input/output support logging in libd3d11_common
vlc | branch: master | Steve Lhomme| Wed Nov 22 11:03:34 2017 +0100| [43b2b125db42a650121a121b252e5641456e2ad4] | committer: Jean-Baptiste Kempf d3d11: move the processor input/output support logging in libd3d11_common Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=43b2b125db42a650121a121b252e5641456e2ad4 --- modules/video_chroma/d3d11_fmt.c | 18 ++ modules/video_chroma/d3d11_fmt.h | 5 + modules/video_chroma/d3d11_surface.c | 8 +--- modules/video_output/win32/d3d11_adjust.c | 8 +--- modules/video_output/win32/d3d11_deinterlace.c | 8 +--- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c index 8caeade34a..ff9f5a5a7e 100644 --- a/modules/video_chroma/d3d11_fmt.c +++ b/modules/video_chroma/d3d11_fmt.c @@ -466,3 +466,21 @@ void D3D11_Destroy(d3d11_handle_t *hd3d) #endif #endif } + +#ifndef NDEBUG +#undef D3D11_LogProcessorSupport +void D3D11_LogProcessorSupport(vlc_object_t *o, + ID3D11VideoProcessorEnumerator *processorEnumerator) +{ +UINT flags; +HRESULT hr; +for (int format = 0; format < 188; format++) { +hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, ); +if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)) +msg_Dbg(o, "processor format %s (%d) is supported for input", DxgiFormatToStr(format),format); +if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) +msg_Dbg(o, "processor format %s (%d) is supported for output", DxgiFormatToStr(format),format); +} +} + +#endif diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h index 9ed889edf9..277c3f8462 100644 --- a/modules/video_chroma/d3d11_fmt.h +++ b/modules/video_chroma/d3d11_fmt.h @@ -120,4 +120,9 @@ int AllocateTextures(vlc_object_t *obj, d3d11_device_t *d3d_dev, const d3d_format_t *cfg, const video_format_t *fmt, unsigned pool_size, ID3D11Texture2D *textures[]); +#ifndef NDEBUG +void D3D11_LogProcessorSupport(vlc_object_t*, ID3D11VideoProcessorEnumerator*); +#define D3D11_LogProcessorSupport(a,b) D3D11_LogProcessorSupport( VLC_OBJECT(a), b ) +#endif + #endif /* include-guard */ diff --git a/modules/video_chroma/d3d11_surface.c b/modules/video_chroma/d3d11_surface.c index aeb5f432bb..1bdd22c0f7 100644 --- a/modules/video_chroma/d3d11_surface.c +++ b/modules/video_chroma/d3d11_surface.c @@ -116,13 +116,7 @@ static int SetupProcessor(filter_t *p_filter, ID3D11Device *d3ddevice, UINT flags; #ifndef NDEBUG -for (int format = 0; format < 188; format++) { -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, ); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)) -msg_Dbg(p_filter, "processor format %s (%d) is supported for input", DxgiFormatToStr(format),format); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) -msg_Dbg(p_filter, "processor format %s (%d) is supported for output", DxgiFormatToStr(format),format); -} +D3D11_LogProcessorSupport(p_filter, processorEnumerator); #endif /* shortcut for the rendering output */ hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, srcFormat, ); diff --git a/modules/video_output/win32/d3d11_adjust.c b/modules/video_output/win32/d3d11_adjust.c index ea2e7ea1be..894ff78927 100644 --- a/modules/video_output/win32/d3d11_adjust.c +++ b/modules/video_output/win32/d3d11_adjust.c @@ -378,13 +378,7 @@ static int Open(vlc_object_t *obj) UINT flags; #ifndef NDEBUG -for (int format = 0; format < 188; format++) { -hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, ); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)) -msg_Dbg(filter, "processor format %s (%d) is supported for input", DxgiFormatToStr(format),format); -if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) -msg_Dbg(filter, "processor format %s (%d) is supported for output", DxgiFormatToStr(format),format); -} +D3D11_LogProcessorSupport(filter, processorEnumerator); #endif hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, ); if (!SUCCEEDED(hr)) diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/video_output/win32/d3d11_deinterlace.c index 438c4b836e..b68158b38e 100644 --- a/modules/video_output/win32/d3d11_deinterlace.c +++ b/modules/video_output/win32/d3d11_deinterlace.c @@ -360,13 +360,7 @@
[vlc-commits] hw:d3d9: rename the Open/Close for each module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:29 2017 +0100| [ef0336b2f175ef572b7996dfbfce487fead6037f] | committer: Jean-Baptiste Kempf hw:d3d9: rename the Open/Close for each module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef0336b2f175ef572b7996dfbfce487fead6037f --- modules/hw/d3d9/d3d9_adjust.c | 6 +++--- modules/hw/d3d9/dxa9.c | 12 ++-- modules/hw/d3d9/dxva2_deinterlace.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/hw/d3d9/d3d9_adjust.c b/modules/hw/d3d9/d3d9_adjust.c index e523d4b10d..b62ea5ef95 100644 --- a/modules/hw/d3d9/d3d9_adjust.c +++ b/modules/hw/d3d9/d3d9_adjust.c @@ -216,7 +216,7 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var, return VLC_SUCCESS; } -static int Open(vlc_object_t *obj) +static int D3D9OpenAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = NULL; @@ -424,7 +424,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D9CloseAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -443,7 +443,7 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D9OpenAdjust, D3D9CloseAdjust) add_shortcut( "adjust" ) add_float_with_range( "contrast", 1.0, 0.0, 2.0, diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 93095ca055..ff26e2d3ff 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -287,7 +287,7 @@ VIDEO_FILTER_WRAPPER (DXA9_YV12) VIDEO_FILTER_WRAPPER (DXA9_NV12) VIDEO_FILTER_WRAPPER (YV12_D3D9) -static int OpenConverter( vlc_object_t *obj ) +static int D3D9OpenConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; HINSTANCE hd3d_dll = NULL; @@ -336,7 +336,7 @@ done: return err; } -static int OpenFromCPU( vlc_object_t *obj ) +static int D3D9OpenCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -455,7 +455,7 @@ done: return err; } -static void CloseConverter( vlc_object_t *obj ) +static void D3D9CloseConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; copy_cache_t *p_copy_cache = (copy_cache_t*) p_filter->p_sys; @@ -464,7 +464,7 @@ static void CloseConverter( vlc_object_t *obj ) p_filter->p_sys = NULL; } -static void CloseFromCPU( vlc_object_t *obj ) +static void D3D9CloseCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; @@ -482,8 +482,8 @@ static void CloseFromCPU( vlc_object_t *obj ) vlc_module_begin () set_description( N_("Conversions from DxVA2 to YUV") ) set_capability( "video converter", 10 ) -set_callbacks( OpenConverter, CloseConverter ) +set_callbacks( D3D9OpenConverter, D3D9CloseConverter ) add_submodule() -set_callbacks( OpenFromCPU, CloseFromCPU ) +set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter ) set_capability( "video converter", 10 ) vlc_module_end () diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c index 4dfc906950..06fb217826 100644 --- a/modules/hw/d3d9/dxva2_deinterlace.c +++ b/modules/hw/d3d9/dxva2_deinterlace.c @@ -266,7 +266,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int Open(vlc_object_t *obj) +static int D3D9OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = NULL; @@ -492,7 +492,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D9CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -511,6 +511,6 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace) add_shortcut ("deinterlace") vlc_module_end() ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: move the filter modules declaration in modules/hw/d3d9
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:21 2017 +0100| [ec0b3bc1a83d80de6aa04092cd89b96768850174] | committer: Jean-Baptiste Kempf hw:d3d9: move the filter modules declaration in modules/hw/d3d9 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec0b3bc1a83d80de6aa04092cd89b96768850174 --- modules/Makefile.am | 1 + modules/hw/d3d9/Makefile.am | 22 ++ modules/video_chroma/Makefile.am | 9 - modules/video_output/Makefile.am | 9 + 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/modules/Makefile.am b/modules/Makefile.am index c96d766f42..ff7687bede 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -31,6 +31,7 @@ include codec/Makefile.am include control/Makefile.am include demux/Makefile.am include gui/Makefile.am +include hw/d3d9/Makefile.am include hw/d3d11/Makefile.am include hw/vaapi/Makefile.am include hw/vdpau/Makefile.am diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am new file mode 100644 index 00..651c975cd4 --- /dev/null +++ b/modules/hw/d3d9/Makefile.am @@ -0,0 +1,22 @@ +d3d9dir = $(pluginsdir)/d3d9 +d3d9_LTLIBRARIES = + +# GPU/CPU converter +libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c +libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la + +if HAVE_AVCODEC_DXVA2 +d3d9_LTLIBRARIES += libdxa9_plugin.la +endif + +libdirect3d9_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c +libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la +libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' +libdirect3d9_adjust_plugin_la_SOURCES = video_output/win32/d3d9_adjust.c +libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' +libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) + +if HAVE_WIN32_DESKTOP +#video_filter_LTLIBRARIES = $(LTLIBdirect3d9_deinterlace) $(LTLIBdirect3d9_adjust) +d3d9_LTLIBRARIES += libdirect3d9_deinterlace_plugin.la libdirect3d9_adjust_plugin.la +endif diff --git a/modules/video_chroma/Makefile.am b/modules/video_chroma/Makefile.am index 73090ab2f2..723d50f564 100644 --- a/modules/video_chroma/Makefile.am +++ b/modules/video_chroma/Makefile.am @@ -117,15 +117,6 @@ chroma_LTLIBRARIES += \ libi422_yuy2_sse2_plugin.la endif -# DXVA2 -libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c -libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la - -if HAVE_AVCODEC_DXVA2 -chroma_LTLIBRARIES += \ - libdxa9_plugin.la -endif - libcvpx_plugin_la_SOURCES = codec/vt_utils.c codec/vt_utils.h video_chroma/cvpx.c if HAVE_OSX libcvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -mmacosx-version-min=10.8 diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am index 30af579a96..79e8f879e2 100644 --- a/modules/video_output/Makefile.am +++ b/modules/video_output/Makefile.am @@ -257,16 +257,9 @@ libdirect3d9_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \ -DMODULE_NAME_IS_direct3d9 libdirect3d9_plugin_la_LIBADD = libchroma_copy.la libd3d9_common.la -lgdi32 $(LIBCOM) -luuid libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c -libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la -libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_SOURCES = video_output/win32/d3d9_adjust.c -libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) if HAVE_WIN32_DESKTOP vout_LTLIBRARIES += $(LTLIBdirect3d9) -video_filter_LTLIBRARIES += $(LTLIBdirect3d9_deinterlace) $(LTLIBdirect3d9_adjust) -EXTRA_LTLIBRARIES += libdirect3d9_plugin.la libdirect3d9_deinterlace_plugin.la libdirect3d9_adjust_plugin.la +EXTRA_LTLIBRARIES += libdirect3d9_plugin.la endif libdirect3d11_plugin_la_SOURCES = video_output/win32/direct3d11.c \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d11: rename the Open/Close for each module
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:28 2017 +0100| [9c716cc9ea66c865e02c153167f948b2c86c6115] | committer: Jean-Baptiste Kempf hw:d3d11: rename the Open/Close for each module Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c716cc9ea66c865e02c153167f948b2c86c6115 --- modules/hw/d3d11/d3d11_adjust.c | 6 +++--- modules/hw/d3d11/d3d11_deinterlace.c | 6 +++--- modules/hw/d3d11/d3d11_surface.c | 12 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index 1c4aca64fb..f5ace01acc 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -324,7 +324,7 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var, return VLC_SUCCESS; } -static int Open(vlc_object_t *obj) +static int D3D11OpenAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -587,7 +587,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D11CloseAdjust(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -620,7 +620,7 @@ vlc_module_begin() set_capability("video filter", 0) set_category( CAT_VIDEO ) set_subcategory( SUBCAT_VIDEO_VFILTER ) -set_callbacks(Open, Close) +set_callbacks(D3D11OpenAdjust, D3D11CloseAdjust) add_shortcut( "adjust" ) add_float_with_range( "contrast", 1.0, 0.0, 2.0, diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 1e310fb2dc..64c098558e 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -281,7 +281,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) return pic; } -static int Open(vlc_object_t *obj) +static int D3D11OpenDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; HRESULT hr; @@ -515,7 +515,7 @@ error: return VLC_EGENERIC; } -static void Close(vlc_object_t *obj) +static void D3D11CloseDeinterlace(vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; filter_sys_t *sys = filter->p_sys; @@ -535,6 +535,6 @@ vlc_module_begin() set_capability("video filter", 0) set_category(CAT_VIDEO) set_subcategory(SUBCAT_VIDEO_VFILTER) -set_callbacks(Open, Close) +set_callbacks(D3D11OpenDeinterlace, D3D11CloseDeinterlace) add_shortcut ("deinterlace") vlc_module_end() diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c index ca79b224a3..24de73ae7c 100644 --- a/modules/hw/d3d11/d3d11_surface.c +++ b/modules/hw/d3d11/d3d11_surface.c @@ -624,7 +624,7 @@ VIDEO_FILTER_WRAPPER (D3D11_NV12) VIDEO_FILTER_WRAPPER (D3D11_YUY2) VIDEO_FILTER_WRAPPER (NV12_D3D11) -static int OpenConverter( vlc_object_t *obj ) +static int D3D11OpenConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -671,7 +671,7 @@ done: return err; } -static int OpenFromCPU( vlc_object_t *obj ) +static int D3D11OpenCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; @@ -796,7 +796,7 @@ done: return err; } -static void CloseConverter( vlc_object_t *obj ) +static 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; @@ -819,7 +819,7 @@ static void CloseConverter( vlc_object_t *obj ) p_filter->p_sys = NULL; } -static void CloseFromCPU( vlc_object_t *obj ) +static void D3D11CloseCPUConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; @@ -836,8 +836,8 @@ static void CloseFromCPU( vlc_object_t *obj ) vlc_module_begin () set_description( N_("Conversions from D3D11 to YUV") ) set_capability( "video converter", 10 ) -set_callbacks( OpenConverter, CloseConverter ) +set_callbacks( D3D11OpenConverter, D3D11CloseConverter ) add_submodule() -set_callbacks( OpenFromCPU, CloseFromCPU ) +set_callbacks( D3D11OpenCPUConverter, D3D11CloseCPUConverter ) set_capability( "video converter", 10 ) vlc_module_end () ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dxa9: clean code
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:25 2017 +0100| [3561f6bd61f289487843dcb41d244b91931d7c34] | committer: Jean-Baptiste Kempf dxa9: clean code Use local variables when possible Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3561f6bd61f289487843dcb41d244b91931d7c34 --- modules/hw/d3d9/dxa9.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index 9b8ea161e2..93095ca055 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -372,14 +372,13 @@ static int OpenFromCPU( vlc_object_t *obj ) return VLC_EGENERIC; } -video_format_Init(_staging, 0); D3DSURFACE_DESC texDesc; IDirect3DSurface9_GetDesc( peek->p_sys->surface, ); -vlc_fourcc_t d3d_fourcc = texDesc.Format; -if (d3d_fourcc == 0) +if (texDesc.Format == 0) goto done; -if ( p_filter->fmt_in.video.i_chroma != d3d_fourcc ) +video_format_Init(_staging, 0); +if ( p_filter->fmt_in.video.i_chroma != texDesc.Format ) { picture_resource_t res; res.pf_destroy = DestroyPicture; @@ -390,7 +389,7 @@ static int OpenFromCPU( vlc_object_t *obj ) } video_format_Copy(_staging, _filter->fmt_out.video); -fmt_staging.i_chroma = d3d_fourcc; +fmt_staging.i_chroma = texDesc.Format; fmt_staging.i_height = texDesc.Height; fmt_staging.i_width = texDesc.Width; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11_surface: use D3D11_Create/D3D11_Destroy
vlc | branch: master | Steve Lhomme| Wed Nov 22 11:03:36 2017 +0100| [346cbef21bf0f3111728da4100ded5c0a9388903] | committer: Jean-Baptiste Kempf d3d11_surface: use D3D11_Create/D3D11_Destroy Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=346cbef21bf0f3111728da4100ded5c0a9388903 --- modules/video_chroma/d3d11_surface.c | 44 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/modules/video_chroma/d3d11_surface.c b/modules/video_chroma/d3d11_surface.c index 1bdd22c0f7..b41b2fa5c7 100644 --- a/modules/video_chroma/d3d11_surface.c +++ b/modules/video_chroma/d3d11_surface.c @@ -74,7 +74,7 @@ struct filter_sys_t { filter_t *filter; picture_t *staging_pic; -HINSTANCE hd3d_dll; +d3d11_handle_t hd3d; }; #if CAN_PROCESSOR @@ -627,7 +627,6 @@ VIDEO_FILTER_WRAPPER (NV12_D3D11) static int OpenConverter( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; -HINSTANCE hd3d_dll = NULL; int err = VLC_EGENERIC; if ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE ) @@ -649,29 +648,28 @@ static int OpenConverter( vlc_object_t *obj ) return VLC_EGENERIC; } -hd3d_dll = LoadLibrary(TEXT("D3D11.DLL")); -if (unlikely(!hd3d_dll)) { -msg_Warn(p_filter, "cannot load d3d11.dll, aborting"); -goto done; -} - filter_sys_t *p_sys = calloc(1, sizeof(filter_sys_t)); if (!p_sys) goto done; +if (D3D11_Create(p_filter, _sys->hd3d) != VLC_SUCCESS) +{ +msg_Warn(p_filter, "cannot load d3d11.dll, aborting"); +goto done; +} + CopyInitCache(_sys->cache, p_filter->fmt_in.video.i_width ); vlc_mutex_init(_sys->staging_lock); -p_sys->hd3d_dll = hd3d_dll; p_filter->p_sys = p_sys; err = VLC_SUCCESS; done: if (err != VLC_SUCCESS) { -if (hd3d_dll) -FreeLibrary(hd3d_dll); +free(p_sys); } -return err;} +return err; +} static int OpenFromCPU( vlc_object_t *obj ) { @@ -679,7 +677,6 @@ static int OpenFromCPU( vlc_object_t *obj ) int err = VLC_EGENERIC; ID3D11Texture2D *texture = NULL; filter_t *p_cpu_filter = NULL; -HINSTANCE hd3d_dll = NULL; video_format_t fmt_staging; if ( p_filter->fmt_out.video.i_chroma != VLC_CODEC_D3D11_OPAQUE ) @@ -768,20 +765,20 @@ static int OpenFromCPU( vlc_object_t *obj ) goto done; } -hd3d_dll = LoadLibrary(TEXT("D3D11.DLL")); -if (unlikely(!hd3d_dll)) { -msg_Warn(p_filter, "cannot load d3d11.dll, aborting"); -goto done; -} - filter_sys_t *p_sys = calloc(1, sizeof(filter_sys_t)); if (!p_sys) { err = VLC_ENOMEM; goto done; } + +if (D3D11_Create(p_filter, _sys->hd3d) != VLC_SUCCESS) +{ +msg_Warn(p_filter, "cannot load d3d11.dll, aborting"); +goto done; +} + p_sys->filter = p_cpu_filter; p_sys->staging_pic = p_dst; -p_sys->hd3d_dll = hd3d_dll; p_filter->p_sys = p_sys; err = VLC_SUCCESS; @@ -794,8 +791,7 @@ done: DeleteFilter( p_cpu_filter ); if (texture) ID3D11Texture2D_Release(texture); -if (hd3d_dll) -FreeLibrary(hd3d_dll); +free(p_sys); } return err; } @@ -818,7 +814,7 @@ static void CloseConverter( vlc_object_t *obj ) vlc_mutex_destroy(_sys->staging_lock); if (p_sys->staging) ID3D11Texture2D_Release(p_sys->staging); -FreeLibrary(p_sys->hd3d_dll); +D3D11_Destroy(_sys->hd3d); free( p_sys ); p_filter->p_sys = NULL; } @@ -829,7 +825,7 @@ static void CloseFromCPU( vlc_object_t *obj ) filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys; DeleteFilter(p_sys->filter); picture_Release(p_sys->staging_pic); -FreeLibrary(p_sys->hd3d_dll); +D3D11_Destroy(_sys->hd3d); free( p_sys ); p_filter->p_sys = NULL; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11_filters: fix adjust output when all values are default
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:27 2017 +0100| [2357637e2e52e3f702fa8173ffd8ac4a89bab676] | committer: Jean-Baptiste Kempf d3d11_filters: fix adjust output when all values are default Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2357637e2e52e3f702fa8173ffd8ac4a89bab676 --- modules/hw/d3d11/d3d11_adjust.c | 41 + 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index c954c79c08..1c4aca64fb 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -243,35 +243,60 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic) p_sys->procOutput[1] }; -size_t idx = 0; +size_t idx = 0, count = 0; /* contrast */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, _sys->Contrast, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* brightness */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS, _sys->Brightness, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* hue */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_HUE, _sys->Hue, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} /* saturation */ if ( ApplyFilter( p_sys, D3D11_VIDEO_PROCESSOR_FILTER_SATURATION, _sys->Saturation, inputs[idx], outputs[idx] ) ) +{ idx++; +count++; +} -ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, - p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], - p_outpic->p_sys->slice_index, - 0, 0, 0, - p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource, - 0, - NULL); +if (count == 0) +{ +ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, + p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], + p_outpic->p_sys->slice_index, + 0, 0, 0, + p_src_sys->resource[KNOWN_DXGI_INDEX], + p_src_sys->slice_index, + NULL); +} +else +{ +ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context, + p_outpic->p_sys->resource[KNOWN_DXGI_INDEX], + p_outpic->p_sys->slice_index, + 0, 0, 0, + p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource, + 0, + NULL); +} if( p_sys->context_mutex != INVALID_HANDLE_VALUE ) ReleaseMutex( p_sys->context_mutex ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: use d3d9_device_t instead of IDirect3DDevice9
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:34 2017 +0100| [364bdb2c296cda91628aa1944b3ee9685ca9ea0c] | committer: Jean-Baptiste Kempf hw:d3d9: use d3d9_device_t instead of IDirect3DDevice9 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=364bdb2c296cda91628aa1944b3ee9685ca9ea0c --- modules/hw/d3d9/d3d9_filters.c | 22 +++--- modules/hw/d3d9/dxa9.c | 27 +-- modules/hw/d3d9/dxva2_deinterlace.c | 21 ++--- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c index 9153b931b6..d0212718eb 100644 --- a/modules/hw/d3d9/d3d9_filters.c +++ b/modules/hw/d3d9/d3d9_filters.c @@ -55,7 +55,7 @@ struct filter_sys_t HINSTANCE hdecoder_dll; /* keep a reference in case the vout is released first */ HINSTANCE d3d9_dll; -IDirect3DDevice9 *d3ddev; +d3d9_device_t d3d_dev; IDirectXVideoProcessor *processor; IDirect3DSurface9 *hw_surface; @@ -147,7 +147,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic) , , 1, NULL ); -hr = IDirect3DDevice9_StretchRect( p_sys->d3ddev, +hr = IDirect3DDevice9_StretchRect( p_sys->d3d_dev.dev, p_sys->hw_surface, NULL, p_outpic->p_sys->surface, NULL, D3DTEXF_NONE); @@ -236,6 +236,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (!video_format_IsSimilar(>fmt_in.video, >fmt_out.video)) return VLC_EGENERIC; +sys = calloc(1, sizeof (*sys)); +if (unlikely(sys == NULL)) +return VLC_ENOMEM; + d3d9_dll = LoadLibrary(TEXT("D3D9.DLL")); if (!d3d9_dll) goto error; @@ -254,10 +258,6 @@ static int D3D9OpenAdjust(vlc_object_t *obj) goto error; } -sys = calloc(1, sizeof (*sys)); -if (unlikely(sys == NULL)) -goto error; - HRESULT (WINAPI *CreateVideoService)(IDirect3DDevice9 *, REFIID riid, void **ppService); @@ -266,7 +266,7 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (CreateVideoService == NULL) goto error; -hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3ddev ); +hr = IDirect3DSurface9_GetDevice( dst->p_sys->surface, >d3d_dev.dev ); if (FAILED(hr)) goto error; @@ -275,7 +275,7 @@ static int D3D9OpenAdjust(vlc_object_t *obj) if (unlikely(FAILED(hr))) goto error; -hr = CreateVideoService( sys->d3ddev, _IDirectXVideoProcessorService, +hr = CreateVideoService( sys->d3d_dev.dev, _IDirectXVideoProcessorService, (void**)); if (FAILED(hr)) goto error; @@ -413,8 +413,8 @@ error: IDirectXVideoProcessor_Release( sys->processor ); if (processor) IDirectXVideoProcessorService_Release(processor); -if (sys && sys->d3ddev) -IDirect3DDevice9_Release( sys->d3ddev ); +if (sys) +D3D9_ReleaseDevice( >d3d_dev ); if (hdecoder_dll) FreeLibrary(hdecoder_dll); if (d3d9_dll) @@ -433,7 +433,7 @@ static void D3D9CloseAdjust(vlc_object_t *obj) IDirect3DSurface9_Release( sys->hw_surface ); IDirectXVideoProcessor_Release( sys->processor ); -IDirect3DDevice9_Release( sys->d3ddev ); +D3D9_ReleaseDevice( >d3d_dev ); FreeLibrary( sys->hdecoder_dll ); FreeLibrary( sys->d3d9_dll ); diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c index d6624a7f5a..6815db2a93 100644 --- a/modules/hw/d3d9/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -47,7 +47,7 @@ struct filter_sys_t { copy_cache_t cache; /* CPU to GPU */ -IDirect3DDevice9 *d3ddev; +d3d9_device_t d3d_dev; filter_t *filter; picture_t *staging; @@ -265,7 +265,7 @@ static void YV12_D3D9(filter_t *p_filter, picture_t *src, picture_t *dst) RECT visibleSource = { .right = dst->format.i_width, .bottom = dst->format.i_height, }; -IDirect3DDevice9_StretchRect( sys->d3ddev, +IDirect3DDevice9_StretchRect( sys->d3d_dev.dev, sys->staging->p_sys->surface, , dst->p_sys->surface, , D3DTEXF_NONE ); @@ -342,7 +342,6 @@ int D3D9OpenCPUConverter( vlc_object_t *obj ) filter_t *p_filter = (filter_t *)obj; int err = VLC_EGENERIC; LPDIRECT3DSURFACE9 texture = NULL; -IDirect3DDevice9 *d3ddev = NULL; filter_t *p_cpu_filter = NULL; picture_t
[vlc-commits] hw:d3d11: move the filters code in hw/d3d11
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:22 2017 +0100| [b191556495c14b276c53fd280bb0b48feb943e5b] | committer: Jean-Baptiste Kempf hw:d3d11: move the filters code in hw/d3d11 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b191556495c14b276c53fd280bb0b48feb943e5b --- modules/hw/d3d11/Makefile.am | 6 +++--- modules/{video_output/win32 => hw/d3d11}/d3d11_adjust.c | 0 modules/{video_output/win32 => hw/d3d11}/d3d11_deinterlace.c | 0 modules/{video_chroma => hw/d3d11}/d3d11_surface.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/hw/d3d11/Makefile.am b/modules/hw/d3d11/Makefile.am index 8b777d2386..999d4c6052 100644 --- a/modules/hw/d3d11/Makefile.am +++ b/modules/hw/d3d11/Makefile.am @@ -1,13 +1,13 @@ d3d11dir = $(pluginsdir)/d3d11 d3d11_LTLIBRARIES = -libdirect3d11_deinterlace_plugin_la_SOURCES = video_output/win32/d3d11_deinterlace.c +libdirect3d11_deinterlace_plugin_la_SOURCES = hw/d3d11/d3d11_deinterlace.c libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la if HAVE_WINSTORE libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11 endif -libdirect3d11_adjust_plugin_la_SOURCES = video_output/win32/d3d11_adjust.c +libdirect3d11_adjust_plugin_la_SOURCES = hw/d3d11/d3d11_adjust.c libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la if HAVE_WINSTORE @@ -20,7 +20,7 @@ d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_pl endif # GPU/CPU converter -libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c +libd3d11_surface_plugin_la_SOURCES = hw/d3d11/d3d11_surface.c libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la if HAVE_WINSTORE libd3d11_surface_plugin_la_LIBADD += -ld3d11 diff --git a/modules/video_output/win32/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c similarity index 100% rename from modules/video_output/win32/d3d11_adjust.c rename to modules/hw/d3d11/d3d11_adjust.c diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c similarity index 100% rename from modules/video_output/win32/d3d11_deinterlace.c rename to modules/hw/d3d11/d3d11_deinterlace.c diff --git a/modules/video_chroma/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c similarity index 99% rename from modules/video_chroma/d3d11_surface.c rename to modules/hw/d3d11/d3d11_surface.c index b41b2fa5c7..ca79b224a3 100644 --- a/modules/video_chroma/d3d11_surface.c +++ b/modules/hw/d3d11/d3d11_surface.c @@ -36,12 +36,12 @@ #include -#include "copy.h" +#include "../../video_chroma/copy.h" #include #define COBJMACROS #include -#include "d3d11_fmt.h" +#include "../../video_chroma/d3d11_fmt.h" #ifdef ID3D11VideoContext_VideoProcessorBlt #define CAN_PROCESSOR 1 ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] hw:d3d9: move the filters code in hw/d3d9
vlc | branch: master | Steve Lhomme| Wed Nov 22 18:18:23 2017 +0100| [024890fe64fe9f7bbb806ed7ae937ceca65eaa1b] | committer: Jean-Baptiste Kempf hw:d3d9: move the filters code in hw/d3d9 Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=024890fe64fe9f7bbb806ed7ae937ceca65eaa1b --- modules/hw/d3d9/Makefile.am | 6 +++--- modules/{video_output/win32 => hw/d3d9}/d3d9_adjust.c | 0 modules/{video_chroma => hw/d3d9}/dxa9.c| 4 ++-- modules/{video_output/win32 => hw/d3d9}/dxva2_deinterlace.c | 0 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/hw/d3d9/Makefile.am b/modules/hw/d3d9/Makefile.am index 651c975cd4..0ce35b8efd 100644 --- a/modules/hw/d3d9/Makefile.am +++ b/modules/hw/d3d9/Makefile.am @@ -2,17 +2,17 @@ d3d9dir = $(pluginsdir)/d3d9 d3d9_LTLIBRARIES = # GPU/CPU converter -libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c +libdxa9_plugin_la_SOURCES = hw/d3d9/dxa9.c libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la if HAVE_AVCODEC_DXVA2 d3d9_LTLIBRARIES += libdxa9_plugin.la endif -libdirect3d9_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c +libdirect3d9_deinterlace_plugin_la_SOURCES = hw/d3d9/dxva2_deinterlace.c libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -libdirect3d9_adjust_plugin_la_SOURCES = video_output/win32/d3d9_adjust.c +libdirect3d9_adjust_plugin_la_SOURCES = hw/d3d9/d3d9_adjust.c libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) diff --git a/modules/video_output/win32/d3d9_adjust.c b/modules/hw/d3d9/d3d9_adjust.c similarity index 100% rename from modules/video_output/win32/d3d9_adjust.c rename to modules/hw/d3d9/d3d9_adjust.c diff --git a/modules/video_chroma/dxa9.c b/modules/hw/d3d9/dxa9.c similarity index 99% rename from modules/video_chroma/dxa9.c rename to modules/hw/d3d9/dxa9.c index 281465ac34..9b8ea161e2 100644 --- a/modules/video_chroma/dxa9.c +++ b/modules/hw/d3d9/dxa9.c @@ -35,11 +35,11 @@ #include #include -#include "copy.h" +#include "../../video_chroma/copy.h" #include #include -#include "d3d9_fmt.h" +#include "../../video_chroma/d3d9_fmt.h" struct filter_sys_t { /* GPU to CPU */ diff --git a/modules/video_output/win32/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c similarity index 100% rename from modules/video_output/win32/dxva2_deinterlace.c rename to modules/hw/d3d9/dxva2_deinterlace.c ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] skin2: fix opening playlist
vlc | branch: master | Pierre Lamot| Thu Nov 23 09:33:26 2017 +0100| [5ac115e094c9a1456065ed8ce5431fb2dc415754] | committer: Jean-Baptiste Kempf skin2: fix opening playlist Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ac115e094c9a1456065ed8ce5431fb2dc415754 --- modules/gui/qt/dialogs_provider.cpp | 9 - modules/gui/skins2/commands/cmd_playlist.cpp | 10 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp index 4f15bee9c0..4f9f2888ca 100644 --- a/modules/gui/qt/dialogs_provider.cpp +++ b/modules/gui/qt/dialogs_provider.cpp @@ -616,7 +616,14 @@ void DialogsProvider::openAPlaylist() EXT_FILTER_PLAYLIST ); foreach( const QString , urls ) { -playlist_Import( THEPL, qtu( url ) ); +char* psz_path = vlc_uri2path(qtu( url )); +if ( !psz_path ) +{ +msg_Warn( p_intf, "unable to load playlist '%s'", qtu( url ) ); +continue; +} +playlist_Import( THEPL, psz_path ); +free( psz_path ); } } diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp index dc38840dda..ab5d94c119 100644 --- a/modules/gui/skins2/commands/cmd_playlist.cpp +++ b/modules/gui/skins2/commands/cmd_playlist.cpp @@ -24,6 +24,7 @@ #include "cmd_playlist.hpp" #include +#include #include "../src/vlcproc.hpp" #include "../utils/var_bool.hpp" @@ -64,7 +65,14 @@ void CmdPlaylistRepeat::execute() void CmdPlaylistLoad::execute() { -playlist_Import( getPL(), m_file.c_str() ); +char* psz_path = vlc_uri2path( m_file.c_str() ); +if ( !psz_path ) +{ +msg_Err(getIntf(),"unable to load playlist %s", m_file.c_str() ); +return; +} +playlist_Import( getPL(), psz_path ); +free( psz_path ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] vlc_common: include limits.h for UINT_MAX, ULONG_MAX and ULLONG_MAX
vlc | branch: master | KO Myung-Hun| Thu Nov 23 17:17:00 2017 +0900| [82da92c2e8a26c4400716d1a299f9ec77a03] | committer: Hugo Beauzée-Luyssen vlc_common: include limits.h for UINT_MAX, ULONG_MAX and ULLONG_MAX Signed-off-by: Hugo Beauzée-Luyssen > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82da92c2e8a26c4400716d1a299f9ec77a03 --- include/vlc_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/vlc_common.h b/include/vlc_common.h index 925c15fc2e..6364afd44f 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -47,6 +47,7 @@ #include #include #include +#include #ifndef __cplusplus # include ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] x264: Remove unused static variable
vlc | branch: master | Hugo Beauzée-Luyssen| Thu Nov 23 13:03:12 2017 +0100| [82d352ee32e403ae845a867e6145eb08e2b35dae] | committer: Hugo Beauzée-Luyssen x264: Remove unused static variable This is unused since 2010 (87e5e733e51d5d7baff67da7b019cb613b81d228) > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82d352ee32e403ae845a867e6145eb08e2b35dae --- modules/codec/x264.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/codec/x264.c b/modules/codec/x264.c index a1f0f984a1..0f34d9c978 100644 --- a/modules/codec/x264.c +++ b/modules/codec/x264.c @@ -426,9 +426,6 @@ static const char *const enc_me_list[] = static const char *const enc_me_list_text[] = { N_("dia"), N_("hex"), N_("umh"), N_("esa"), N_("tesa") }; -static const char *const profile_list[] = - { "baseline", "main", "high" }; - static const char *const bpyramid_list[] = { "none", "strict", "normal" }; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] es_out: don't tag preroll on blocks containing NEXT_DISPLAY_TIME
vlc | branch: master | Francois Cartegnie| Thu Nov 23 17:28:05 2017 +0100| [3b97a38005b94958efeb6a0d0023a6f35e77f16e] | committer: Francois Cartegnie es_out: don't tag preroll on blocks containing NEXT_DISPLAY_TIME avoids dropping those, especially SPU on seek refs #18862 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b97a38005b94958efeb6a0d0023a6f35e77f16e --- src/input/es_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/es_out.c b/src/input/es_out.c index 227f15faa0..df92fe89e2 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -2070,7 +2070,7 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) if( p_block->i_pts <= VLC_TS_INVALID ) i_date = p_block->i_dts; -if( i_date < p_sys->i_preroll_end ) +if( i_date + p_block->i_length < p_sys->i_preroll_end ) p_block->i_flags |= BLOCK_FLAG_PREROLL; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] sap: simplify
vlc | branch: master | Rémi Denis-Courmont| Thu Nov 23 19:05:17 2017 +0200| [d72395dd8aaf50a722cf7bbe58e4d61e9943edf2] | committer: Rémi Denis-Courmont sap: simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d72395dd8aaf50a722cf7bbe58e4d61e9943edf2 --- modules/services_discovery/sap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c index 7c5569171d..3350240809 100644 --- a/modules/services_discovery/sap.c +++ b/modules/services_discovery/sap.c @@ -1184,8 +1184,7 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp) while (*psz_sdp) { /* Extract one line */ -char *eol = strchr (psz_sdp, '\n'); -size_t linelen = eol ? (size_t)(eol - psz_sdp) : strlen (psz_sdp); +size_t linelen = strcspn(psz_sdp, "\n"); char line[linelen + 1]; memcpy (line, psz_sdp, linelen); line[linelen] = '\0'; @@ -1193,7 +1192,7 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp) psz_sdp += linelen + 1; /* Remove carriage return if present */ -eol = strchr (line, '\r'); +char *eol = strchr (line, '\r'); if (eol != NULL) { linelen = eol - line; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] sap: fix off-by-one
vlc | branch: master | Rémi Denis-Courmont| Thu Nov 23 19:07:08 2017 +0200| [3264c9ed2e05ae841e8faaff7b217136cf31a99f] | committer: Rémi Denis-Courmont sap: fix off-by-one > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3264c9ed2e05ae841e8faaff7b217136cf31a99f --- modules/services_discovery/sap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c index 3350240809..0f28dbf1b5 100644 --- a/modules/services_discovery/sap.c +++ b/modules/services_discovery/sap.c @@ -1185,6 +1185,9 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp) { /* Extract one line */ size_t linelen = strcspn(psz_sdp, "\n"); +if (psz_sdp[linelen] == '\0') +goto error; + char line[linelen + 1]; memcpy (line, psz_sdp, linelen); line[linelen] = '\0'; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] freetype: fix No subtitles on Win 7 with 64bit
vlc | branch: master | Pierre Lamot| Thu Nov 23 13:26:07 2017 +0100| [81382ead7b52106a7492a8a101050c6aa546dbc3] | committer: Hugo Beauzée-Luyssen freetype: fix No subtitles on Win 7 with 64bit fix: #19093 Signed-off-by: Hugo Beauzée-Luyssen > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81382ead7b52106a7492a8a101050c6aa546dbc3 --- modules/text_renderer/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/text_renderer/Makefile.am b/modules/text_renderer/Makefile.am index c69fc7167a..a251904762 100644 --- a/modules/text_renderer/Makefile.am +++ b/modules/text_renderer/Makefile.am @@ -17,7 +17,7 @@ libfreetype_plugin_la_SOURCES += text_renderer/freetype/fonts/dwrite.cpp libfreetype_plugin_la_LINK = $(CXXLINK) if HAVE_WIN32_DESKTOP libfreetype_plugin_la_SOURCES += text_renderer/freetype/fonts/win32.c -libfreetype_plugin_la_LIBADD += -liconv -lz -lgdi32 -lusp10 -luuid +libfreetype_plugin_la_LIBADD += -liconv -lz -lusp10 -lgdi32 -luuid else libfreetype_plugin_la_LIBADD += -ldwrite endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] codec: atsc a65: fix truncated conversions
vlc | branch: master | Francois Cartegnie| Thu Nov 23 13:45:04 2017 +0100| [511eb7f9ce5b735ae6651e7614f0c9813df37623] | committer: Francois Cartegnie codec: atsc a65: fix truncated conversions > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=511eb7f9ce5b735ae6651e7614f0c9813df37623 --- modules/codec/atsc_a65.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/codec/atsc_a65.c b/modules/codec/atsc_a65.c index 6c63cba949..7fdd2959e6 100644 --- a/modules/codec/atsc_a65.c +++ b/modules/codec/atsc_a65.c @@ -159,7 +159,7 @@ static bool convert_encoding_set( atsc_a65_handle_t *p_handle, _outbuf, _outbuf_remain ) ); psz_dest = psz_realloc; i_mergmin1 += (i_outbuf_size - i_outbuf_remain); -psz_dest[i_mergmin1 - 1] = 0; +*p_outbuf = '\0'; } free( psz16 ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] macosx: Simplify translation macros
vlc | branch: master | David Fuhrmann| Thu Nov 23 19:57:55 2017 +0100| [214cc7818f6b01120bf865cbe7c7641b3bf73be4] | committer: David Fuhrmann macosx: Simplify translation macros The previous method had lots of dead code, so simplify by using a one-line macro. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=214cc7818f6b01120bf865cbe7c7641b3bf73be4 --- modules/gui/macosx/VLCStringUtility.h | 9 ++--- modules/gui/macosx/VLCStringUtility.m | 17 - 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/modules/gui/macosx/VLCStringUtility.h b/modules/gui/macosx/VLCStringUtility.h index 76dec00663..e75666cc2c 100644 --- a/modules/gui/macosx/VLCStringUtility.h +++ b/modules/gui/macosx/VLCStringUtility.h @@ -25,13 +25,17 @@ */ #import + +#import #import -#define _NS(s) [[VLCStringUtility sharedInstance] localizedString: s] + +#define _NS(s) ((s) ? toNSStr(vlc_gettext(s)) : @"") + /* Get an alternate version of the string. * This string is stored as '1:string' but when displayed it only displays * the translated string. the translation should be '1:translatedstring' though */ -#define _ANS(s) [[[VLCStringUtility sharedInstance] localizedString: _(s)] substringFromIndex:2] +#define _ANS(s) [((s) ? toNSStr(vlc_gettext(s)) : @"") substringFromIndex:2] #define B64DecNSStr(s) [[VLCStringUtility sharedInstance] b64Decode: s] #define B64EncAndFree(s) [[VLCStringUtility sharedInstance] b64EncodeAndFree: s] @@ -58,7 +62,6 @@ NSImage *imageFromRes(NSString *o_id); + (VLCStringUtility *)sharedInstance; -- (NSString *)localizedString:(const char *)psz NS_FORMAT_ARGUMENT(1); - (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width; - (NSString *)getCurrentTimeAsString:(input_thread_t *)p_input negative:(BOOL)b_negative; - (NSString *)stringForTime:(long long int)time; diff --git a/modules/gui/macosx/VLCStringUtility.m b/modules/gui/macosx/VLCStringUtility.m index 742e045ba6..4487187659 100644 --- a/modules/gui/macosx/VLCStringUtility.m +++ b/modules/gui/macosx/VLCStringUtility.m @@ -64,23 +64,6 @@ NSString *const kVLCMediaUnknown = @"Unknown"; #pragma mark - #pragma mark String utility -- (NSString *)localizedString:(const char *)psz -{ -NSString * stringObject = nil; - -if (psz != NULL) { -stringObject = toNSStr(_(psz)); - -if (stringObject == NULL) { -msg_Err(getIntf(), "could not translate: %s", psz); -return @""; -} -} else -return @""; - -return stringObject; -} - /* i_width is in pixels */ - (NSString *)wrapString:(NSString *)o_in_string toWidth:(int)i_width { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] sout: transcode: fix leak
vlc | branch: master | Francois Cartegnie| Thu Nov 23 22:25:10 2017 +0100| [c2786ac015bccef4155bef211c7ce30d29af06ce] | committer: Francois Cartegnie sout: transcode: fix leak > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2786ac015bccef4155bef211c7ce30d29af06ce --- modules/stream_out/transcode/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c index fc59201e16..4829ea9c11 100644 --- a/modules/stream_out/transcode/audio.c +++ b/modules/stream_out/transcode/audio.c @@ -168,8 +168,9 @@ static int transcode_audio_new( sout_stream_t *p_stream, /* No need to clean the fmt_out, it was freshly initialized by * es_format_Init in Add() */ es_format_Copy( >p_decoder->fmt_out, >p_decoder->fmt_in ); +free( id->p_decoder->fmt_out.p_extra ); id->p_decoder->fmt_out.i_extra = 0; -id->p_decoder->fmt_out.p_extra = 0; +id->p_decoder->fmt_out.p_extra = NULL; id->p_decoder->pf_decode = NULL; id->p_decoder->pf_queue_audio = decoder_queue_audio; id->p_decoder->p_queue_ctx = id; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits