mirror of
				https://github.com/jojo61/vdr-plugin-softhdcuvid.git
				synced 2025-03-01 10:39:28 +00:00 
			
		
		
		
	Compare commits
	
		
			27 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 72cb77f771 | ||
|  | c679d812d1 | ||
|  | 47b461ab46 | ||
|  | 8629946041 | ||
|  | a222f6a1d5 | ||
|  | b51589aaa9 | ||
|  | c3af54aae0 | ||
|  | 7e387fa3f1 | ||
|  | f3e5a14fdf | ||
|  | aa0c2f80e4 | ||
|  | 215f251572 | ||
|  | a425ec94e0 | ||
|  | 91961bdffe | ||
|  | f741dff042 | ||
|  | 7a31761c89 | ||
|  | d5ca73c22f | ||
|  | 6704b2ca5a | ||
|  | e0bbaceec0 | ||
|  | 45043b9ffc | ||
|  | a56b3737c7 | ||
|  | e59eeba0d2 | ||
|  | 838dfab45b | ||
|  | ddd44e6f62 | ||
|  | 1390139cbd | ||
|  | f72653c3c1 | ||
|  | 4e96489e35 | ||
|  | 65017da5ac | 
							
								
								
									
										20
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								Makefile
									
									
									
									
									
								
							| @@ -24,18 +24,17 @@ DRM ?= 0 | |||||||
|  |  | ||||||
| # use libplacebo - | # use libplacebo - | ||||||
| # available for all decoders but for DRM you need LIBPLACEBO_GL | # available for all decoders but for DRM you need LIBPLACEBO_GL | ||||||
| LIBPLACEBO ?= 1 | LIBPLACEBO ?= 0 | ||||||
| LIBPLACEBO_GL ?= 0 | LIBPLACEBO_GL ?= 0 | ||||||
|  |  | ||||||
| # use YADIF deint - only available with cuvid | # use YADIF deint - only available with cuvid | ||||||
| #YADIF = 1 | YADIF = 1 | ||||||
|  |  | ||||||
| # use gamma correction | # use gamma correction | ||||||
| #GAMMA ?= 0 | #GAMMA ?= 0 | ||||||
|  |  | ||||||
| CONFIG := -DDEBUG 		# remove '#' to enable debug output | CONFIG := -DDEBUG 		# remove '#' to enable debug output | ||||||
|  |  | ||||||
|  |  | ||||||
| #--------------------- no more config needed past this point-------------------------------- | #--------------------- no more config needed past this point-------------------------------- | ||||||
|  |  | ||||||
| # sanitize selections -------- | # sanitize selections -------- | ||||||
| @@ -159,29 +158,29 @@ endif | |||||||
|  |  | ||||||
| ifeq ($(LIBPLACEBO_GL),1) | ifeq ($(LIBPLACEBO_GL),1) | ||||||
| CONFIG += -DPLACEBO_GL -DPLACEBO | CONFIG += -DPLACEBO_GL -DPLACEBO | ||||||
| LIBS += -lepoxy | _CFLAGS += $(shell pkg-config --cflags libplacebo) | ||||||
| LIBS += -lplacebo | LIBS += $(shell pkg-config --libs epoxy libplacebo) | ||||||
| else | else | ||||||
| LIBS += -lEGL | LIBS += $(shell pkg-config --libs egl) | ||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq ($(LIBPLACEBO),1) | ifeq ($(LIBPLACEBO),1) | ||||||
| CONFIG += -DPLACEBO | CONFIG += -DPLACEBO | ||||||
| LIBS += -lEGL | _CFLAGS += $(shell pkg-config --cflags libplacebo) | ||||||
| LIBS += -lplacebo | LIBS += $(shell pkg-config --libs egl libplacebo) | ||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq ($(DRM),1) | ifeq ($(DRM),1) | ||||||
| PLUGIN = softhddrm | PLUGIN = softhddrm | ||||||
| CONFIG += -DUSE_DRM -DVAAPI | CONFIG += -DUSE_DRM -DVAAPI | ||||||
| _CFLAGS += $(shell pkg-config --cflags libdrm) | _CFLAGS += $(shell pkg-config --cflags libdrm) | ||||||
| LIBS += -lgbm -ldrm -lEGL | LIBS += $(shell pkg-config --libs egl gbm libdrm) | ||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq ($(CUVID),1) | ifeq ($(CUVID),1) | ||||||
| #CONFIG += -DUSE_PIP			# PIP support | #CONFIG += -DUSE_PIP			# PIP support | ||||||
| CONFIG += -DCUVID			# enable CUVID decoder | CONFIG += -DCUVID			# enable CUVID decoder | ||||||
| LIBS += -lEGL -lGL | LIBS += $(shell pkg-config --libs egl gl) | ||||||
| ifeq ($(YADIF),1) | ifeq ($(YADIF),1) | ||||||
| CONFIG += -DYADIF			# Yadif only with CUVID | CONFIG += -DYADIF			# Yadif only with CUVID | ||||||
| endif | endif | ||||||
| @@ -274,6 +273,7 @@ LIBS += -lcuda -lnvcuvid | |||||||
| endif | endif | ||||||
|  |  | ||||||
| LIBS += -lGLEW -lGLU  -ldl -lglut | LIBS += -lGLEW -lGLU  -ldl -lglut | ||||||
|  | #LIBS += -ldl $(shell pkg-config --libs glew glu glut) | ||||||
|  |  | ||||||
| ### Includes and Defines (add further entries here): | ### Includes and Defines (add further entries here): | ||||||
|  |  | ||||||
|   | |||||||
| @@ -82,9 +82,6 @@ You have to adapt the Makefile. There are 3 possible Version that you can build: | |||||||
|     runs without X Server. There are several commandline options to select the resolution and refresh rate. |     runs without X Server. There are several commandline options to select the resolution and refresh rate. | ||||||
|     I recommend to use libplacebo and set LIBPLACEBO_GL=1 in the Makefile. |     I recommend to use libplacebo and set LIBPLACEBO_GL=1 in the Makefile. | ||||||
|  |  | ||||||
|     You should use the following libplacebo Version: |  | ||||||
| 	https://github.com/haasn/libplacebo/archive/f2c4da9d6121bb330c9fff640aad40e98c081190.zip |  | ||||||
| 	Newer Versions may not work. |  | ||||||
|  |  | ||||||
|  |  | ||||||
| Install: | Install: | ||||||
| @@ -123,6 +120,9 @@ Beginners Guide for libplacebo: | |||||||
|  |  | ||||||
|     All other settings can be in their default state. |     All other settings can be in their default state. | ||||||
|  |  | ||||||
|  | 	Note for NUC11/12 Users: | ||||||
|  | 	Provide paramete -w alsa-no-test to get Audio working. | ||||||
|  |  | ||||||
|     Beginning with libplacebo API 58 user shaders from mpv are supported. Use -S parameter to set the shader. |     Beginning with libplacebo API 58 user shaders from mpv are supported. Use -S parameter to set the shader. | ||||||
|     The plugins searches the shaders in $ConfigDir/plugins/shaders for the shaders. One example shader is |     The plugins searches the shaders in $ConfigDir/plugins/shaders for the shaders. One example shader is | ||||||
|     provided in the shader subdirectory. Copy it to e.g.: /etc/vdr/plugins/shaders and then start |     provided in the shader subdirectory. Copy it to e.g.: /etc/vdr/plugins/shaders and then start | ||||||
|   | |||||||
							
								
								
									
										251
									
								
								audio.c
									
									
									
									
									
								
							
							
						
						
									
										251
									
								
								audio.c
									
									
									
									
									
								
							| @@ -93,6 +93,7 @@ static const AudioModule NoopModule; ///< forward definition of noop module | |||||||
| //  Variables | //  Variables | ||||||
| //---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||||
|  |  | ||||||
|  | char AudioAlsaNotest;          ///< disable Audio capbility test | ||||||
| char AudioAlsaDriverBroken;   ///< disable broken driver message | char AudioAlsaDriverBroken;   ///< disable broken driver message | ||||||
| char AudioAlsaNoCloseOpen;    ///< disable alsa close/open fix | char AudioAlsaNoCloseOpen;    ///< disable alsa close/open fix | ||||||
| char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix | char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix | ||||||
| @@ -2187,143 +2188,145 @@ found: | |||||||
|     AudioRingInit(); |     AudioRingInit(); | ||||||
|     AudioUsedModule->Init(); |     AudioUsedModule->Init(); | ||||||
|  |  | ||||||
| #if 1 |     if (AudioAlsaNotest) { | ||||||
|     for (u = 0; u < AudioRatesMax; ++u) { |         for (u = 0; u < AudioRatesMax; ++u) { | ||||||
|          |          | ||||||
|         AudioChannelMatrix[u][1]=AudioChannelMatrix[u][2]=AudioChannelMatrix[u][3]=AudioChannelMatrix[u][4]=\ |             AudioChannelMatrix[u][1]=AudioChannelMatrix[u][2]=2; | ||||||
|         AudioChannelMatrix[u][5]=AudioChannelMatrix[u][6]=AudioChannelMatrix[u][7]=AudioChannelMatrix[u][8]=2; |             AudioChannelMatrix[u][3]=AudioChannelMatrix[u][4]=4; | ||||||
|         //printf("audio: %6dHz supports %d %d %d %d %d %d %d %d channels\n", AudioRatesTable[u], |             AudioChannelMatrix[u][5]=AudioChannelMatrix[u][6]=6; | ||||||
|         //    AudioChannelMatrix[u][1], AudioChannelMatrix[u][2], AudioChannelMatrix[u][3], AudioChannelMatrix[u][4], |             AudioChannelMatrix[u][7]=AudioChannelMatrix[u][8]=8; | ||||||
|         //    AudioChannelMatrix[u][5], AudioChannelMatrix[u][6], AudioChannelMatrix[u][7], AudioChannelMatrix[u][8]); |             printf("audio: %6dHz supports %d %d %d %d %d %d %d %d channels\n", AudioRatesTable[u], | ||||||
|  |                 AudioChannelMatrix[u][1], AudioChannelMatrix[u][2], AudioChannelMatrix[u][3], AudioChannelMatrix[u][4], | ||||||
|  |                 AudioChannelMatrix[u][5], AudioChannelMatrix[u][6], AudioChannelMatrix[u][7], AudioChannelMatrix[u][8]); | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         AudioChannelsInHw[1]=AudioChannelsInHw[3]=AudioChannelsInHw[4]=AudioChannelsInHw[5]=AudioChannelsInHw[6]=AudioChannelsInHw[7]=AudioChannelsInHw[8]=0; | ||||||
|  |         AudioChannelsInHw[2]=2; | ||||||
|     } |     } | ||||||
|  |     else { | ||||||
|     AudioChannelsInHw[1]=AudioChannelsInHw[3]=AudioChannelsInHw[4]=AudioChannelsInHw[5]=AudioChannelsInHw[6]=AudioChannelsInHw[7]=AudioChannelsInHw[8]=0; |         // | ||||||
|     AudioChannelsInHw[2]=2; |         //	Check which channels/rates/formats are supported | ||||||
|  |         //	FIXME: we force 44.1Khz and 48Khz must be supported equal | ||||||
| #else |         //	FIXME: should use bitmap of channels supported in RatesInHw | ||||||
|     // |         //	FIXME: use loop over sample-rates | ||||||
|     //	Check which channels/rates/formats are supported |         freq = 44100; | ||||||
|     //	FIXME: we force 44.1Khz and 48Khz must be supported equal |         AudioRatesInHw[Audio44100] = 0; | ||||||
|     //	FIXME: should use bitmap of channels supported in RatesInHw |  | ||||||
|     //	FIXME: use loop over sample-rates |  | ||||||
|     freq = 44100; |  | ||||||
|     AudioRatesInHw[Audio44100] = 0; |  | ||||||
|     for (chan = 1; chan < 9; ++chan) { |  | ||||||
|         int tchan; |  | ||||||
|         int tfreq; |  | ||||||
|  |  | ||||||
|         tchan = chan; |  | ||||||
|         tfreq = freq; |  | ||||||
|         if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { |  | ||||||
|             AudioChannelsInHw[chan] = 0; |  | ||||||
|         } else { |  | ||||||
|             AudioChannelsInHw[chan] = chan; |  | ||||||
|             AudioRatesInHw[Audio44100] |= (1 << chan); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|     freq = 48000; |  | ||||||
|     AudioRatesInHw[Audio48000] = 0; |  | ||||||
|     for (chan = 1; chan < 9; ++chan) { |  | ||||||
|         int tchan; |  | ||||||
|         int tfreq; |  | ||||||
|  |  | ||||||
|         if (!AudioChannelsInHw[chan]) { |  | ||||||
|             continue; |  | ||||||
|         } |  | ||||||
|         tchan = chan; |  | ||||||
|         tfreq = freq; |  | ||||||
|         if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { |  | ||||||
|             // AudioChannelsInHw[chan] = 0; |  | ||||||
|         } else { |  | ||||||
|             AudioChannelsInHw[chan] = chan; |  | ||||||
|             AudioRatesInHw[Audio48000] |= (1 << chan); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|     freq = 192000; |  | ||||||
|     AudioRatesInHw[Audio192000] = 0; |  | ||||||
|     for (chan = 1; chan < 9; ++chan) { |  | ||||||
|         int tchan; |  | ||||||
|         int tfreq; |  | ||||||
|  |  | ||||||
|         if (!AudioChannelsInHw[chan]) { |  | ||||||
|             continue; |  | ||||||
|         } |  | ||||||
|         tchan = chan; |  | ||||||
|         tfreq = freq; |  | ||||||
|         if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { |  | ||||||
|             // AudioChannelsInHw[chan] = 0; |  | ||||||
|         } else { |  | ||||||
|             AudioChannelsInHw[chan] = chan; |  | ||||||
|             AudioRatesInHw[Audio192000] |= (1 << chan); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|     //	build channel support and conversion table |  | ||||||
|     for (u = 0; u < AudioRatesMax; ++u) { |  | ||||||
|         for (chan = 1; chan < 9; ++chan) { |         for (chan = 1; chan < 9; ++chan) { | ||||||
|             AudioChannelMatrix[u][chan] = 0; |             int tchan; | ||||||
|             if (!AudioRatesInHw[u]) { // rate unsupported |             int tfreq; | ||||||
|  |  | ||||||
|  |             tchan = chan; | ||||||
|  |             tfreq = freq; | ||||||
|  |             if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { | ||||||
|  |                 AudioChannelsInHw[chan] = 0; | ||||||
|  |             } else { | ||||||
|  |                 AudioChannelsInHw[chan] = chan; | ||||||
|  |                 AudioRatesInHw[Audio44100] |= (1 << chan); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         freq = 48000; | ||||||
|  |         AudioRatesInHw[Audio48000] = 0; | ||||||
|  |         for (chan = 1; chan < 9; ++chan) { | ||||||
|  |             int tchan; | ||||||
|  |             int tfreq; | ||||||
|  |  | ||||||
|  |             if (!AudioChannelsInHw[chan]) { | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|             if (AudioChannelsInHw[chan]) { |             tchan = chan; | ||||||
|                 AudioChannelMatrix[u][chan] = chan; |             tfreq = freq; | ||||||
|  |             if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { | ||||||
|  |                 // AudioChannelsInHw[chan] = 0; | ||||||
|             } else { |             } else { | ||||||
|                 switch (chan) { |                 AudioChannelsInHw[chan] = chan; | ||||||
|                     case 1: |                 AudioRatesInHw[Audio48000] |= (1 << chan); | ||||||
|                         if (AudioChannelsInHw[2]) { |             } | ||||||
|                             AudioChannelMatrix[u][chan] = 2; |         } | ||||||
|                         } |         freq = 192000; | ||||||
|                         break; |         AudioRatesInHw[Audio192000] = 0; | ||||||
|                     case 2: |         for (chan = 1; chan < 9; ++chan) { | ||||||
|                     case 3: |             int tchan; | ||||||
|                         if (AudioChannelsInHw[4]) { |             int tfreq; | ||||||
|                             AudioChannelMatrix[u][chan] = 4; |  | ||||||
|  |             if (!AudioChannelsInHw[chan]) { | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |             tchan = chan; | ||||||
|  |             tfreq = freq; | ||||||
|  |             if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) { | ||||||
|  |                 // AudioChannelsInHw[chan] = 0; | ||||||
|  |             } else { | ||||||
|  |                 AudioChannelsInHw[chan] = chan; | ||||||
|  |                 AudioRatesInHw[Audio192000] |= (1 << chan); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         //	build channel support and conversion table | ||||||
|  |         for (u = 0; u < AudioRatesMax; ++u) { | ||||||
|  |             for (chan = 1; chan < 9; ++chan) { | ||||||
|  |                 AudioChannelMatrix[u][chan] = 0; | ||||||
|  |                 if (!AudioRatesInHw[u]) { // rate unsupported | ||||||
|  |                     continue; | ||||||
|  |                 } | ||||||
|  |                 if (AudioChannelsInHw[chan]) { | ||||||
|  |                     AudioChannelMatrix[u][chan] = chan; | ||||||
|  |                 } else { | ||||||
|  |                     switch (chan) { | ||||||
|  |                         case 1: | ||||||
|  |                             if (AudioChannelsInHw[2]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 2; | ||||||
|  |                             } | ||||||
|                             break; |                             break; | ||||||
|                         } |                         case 2: | ||||||
|                     case 4: |                         case 3: | ||||||
|                         if (AudioChannelsInHw[5]) { |                             if (AudioChannelsInHw[4]) { | ||||||
|                             AudioChannelMatrix[u][chan] = 5; |                                 AudioChannelMatrix[u][chan] = 4; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                         case 4: | ||||||
|  |                             if (AudioChannelsInHw[5]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 5; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                         case 5: | ||||||
|  |                             if (AudioChannelsInHw[6]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 6; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                         case 6: | ||||||
|  |                             if (AudioChannelsInHw[7]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 7; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                         case 7: | ||||||
|  |                             if (AudioChannelsInHw[8]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 8; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                         case 8: | ||||||
|  |                             if (AudioChannelsInHw[6]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 6; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                             if (AudioChannelsInHw[2]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 2; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|  |                             if (AudioChannelsInHw[1]) { | ||||||
|  |                                 AudioChannelMatrix[u][chan] = 1; | ||||||
|  |                                 break; | ||||||
|  |                             } | ||||||
|                             break; |                             break; | ||||||
|                         } |                     } | ||||||
|                     case 5: |  | ||||||
|                         if (AudioChannelsInHw[6]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 6; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                     case 6: |  | ||||||
|                         if (AudioChannelsInHw[7]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 7; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                     case 7: |  | ||||||
|                         if (AudioChannelsInHw[8]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 8; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                     case 8: |  | ||||||
|                         if (AudioChannelsInHw[6]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 6; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                         if (AudioChannelsInHw[2]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 2; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                         if (AudioChannelsInHw[1]) { |  | ||||||
|                             AudioChannelMatrix[u][chan] = 1; |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                         break; |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |         for (u = 0; u < AudioRatesMax; ++u) { | ||||||
|  |             Debug(3,"audio: %6dHz supports %d %d %d %d %d %d %d %d channels\n", AudioRatesTable[u], | ||||||
|  |                 AudioChannelMatrix[u][1], AudioChannelMatrix[u][2], AudioChannelMatrix[u][3], AudioChannelMatrix[u][4], | ||||||
|  |                 AudioChannelMatrix[u][5], AudioChannelMatrix[u][6], AudioChannelMatrix[u][7], AudioChannelMatrix[u][8]); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     for (u = 0; u < AudioRatesMax; ++u) { |  | ||||||
|         Info(_("audio: %6dHz supports %d %d %d %d %d %d %d %d channels\n"), AudioRatesTable[u], |  | ||||||
|              AudioChannelMatrix[u][1], AudioChannelMatrix[u][2], AudioChannelMatrix[u][3], AudioChannelMatrix[u][4], |  | ||||||
|              AudioChannelMatrix[u][5], AudioChannelMatrix[u][6], AudioChannelMatrix[u][7], AudioChannelMatrix[u][8]); |  | ||||||
|     } |  | ||||||
| #endif |  | ||||||
| #ifdef USE_AUDIO_THREAD | #ifdef USE_AUDIO_THREAD | ||||||
|     if (AudioUsedModule->Thread) { // supports threads |     if (AudioUsedModule->Thread) { // supports threads | ||||||
|         AudioInitThread(); |         AudioInitThread(); | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								audio.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								audio.h
									
									
									
									
									
								
							| @@ -60,6 +60,7 @@ extern void AudioExit(void);               ///< cleanup and exit audio module | |||||||
| //  Variables | //  Variables | ||||||
| //---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||||
|  |  | ||||||
|  | extern char AudioAlsaNotest;         ///< disable Alsa capability test | ||||||
| extern char AudioAlsaDriverBroken;   ///< disable broken driver message | extern char AudioAlsaDriverBroken;   ///< disable broken driver message | ||||||
| extern char AudioAlsaNoCloseOpen;    ///< disable alsa close/open fix | extern char AudioAlsaNoCloseOpen;    ///< disable alsa close/open fix | ||||||
| extern char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix | extern char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix | ||||||
|   | |||||||
							
								
								
									
										61
									
								
								codec.c
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								codec.c
									
									
									
									
									
								
							| @@ -260,8 +260,8 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) { | |||||||
|  |  | ||||||
|     decoder->VideoCtx->pkt_timebase.num = 1; |     decoder->VideoCtx->pkt_timebase.num = 1; | ||||||
|     decoder->VideoCtx->pkt_timebase.den = 90000; |     decoder->VideoCtx->pkt_timebase.den = 90000; | ||||||
|     decoder->VideoCtx->framerate.num = 50; |     //decoder->VideoCtx->framerate.num = 50; | ||||||
|     decoder->VideoCtx->framerate.den = 1; |     //decoder->VideoCtx->framerate.den = 1; | ||||||
|  |  | ||||||
|     pthread_mutex_lock(&CodecLockMutex); |     pthread_mutex_lock(&CodecLockMutex); | ||||||
|     // open codec |     // open codec | ||||||
| @@ -311,12 +311,12 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) { | |||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option deint to video codec!\n")); |             Fatal(_("codec: can't set option deint to video codec!\n")); | ||||||
|         } |         } | ||||||
| #if 1 |  | ||||||
|         if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 9, 0) < 0) { |         if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 10, 0) < 0) { | ||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option surfces to video codec!\n")); |             Fatal(_("codec: can't set option surfces to video codec!\n")); | ||||||
|         } |         } | ||||||
| #endif |  | ||||||
|         if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { |         if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { | ||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option drop 2.field to video codec!\n")); |             Fatal(_("codec: can't set option drop 2.field to video codec!\n")); | ||||||
| @@ -326,12 +326,10 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) { | |||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option deint to video codec!\n")); |             Fatal(_("codec: can't set option deint to video codec!\n")); | ||||||
|         } |         } | ||||||
| #if 1 |  | ||||||
|         if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 13, 0) < 0) { |         if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 13, 0) < 0) { | ||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option surfces to video codec!\n")); |             Fatal(_("codec: can't set option surfces to video codec!\n")); | ||||||
|         } |         } | ||||||
| #endif |  | ||||||
|         if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { |         if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { | ||||||
|             pthread_mutex_unlock(&CodecLockMutex); |             pthread_mutex_unlock(&CodecLockMutex); | ||||||
|             Fatal(_("codec: can't set option drop 2.field  to video codec!\n")); |             Fatal(_("codec: can't set option drop 2.field  to video codec!\n")); | ||||||
| @@ -492,8 +490,7 @@ void CodecVideoDecode(VideoDecoder *decoder, const AVPacket *avpkt) { | |||||||
|                             decoder->filter = 2; |                             decoder->filter = 2; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     if (frame->interlaced_frame && decoder->filter == 2 && |                     if (decoder->filter == 2) {  | ||||||
|                         (frame->height != 720)) { // broken ZDF sends Interlaced flag |  | ||||||
|                         push_filters(video_ctx, decoder->HwDecoder, frame); |                         push_filters(video_ctx, decoder->HwDecoder, frame); | ||||||
|                         continue; |                         continue; | ||||||
|                     } |                     } | ||||||
| @@ -525,7 +522,6 @@ next_part: | |||||||
|     pkt = avpkt; // use copy |     pkt = avpkt; // use copy | ||||||
|     got_frame = 0; |     got_frame = 0; | ||||||
|  |  | ||||||
|     // printf("decode packet  %d\n",(GetusTicks()-first_time)/1000000); |  | ||||||
|     ret1 = avcodec_send_packet(video_ctx, pkt); |     ret1 = avcodec_send_packet(video_ctx, pkt); | ||||||
|  |  | ||||||
|     // first_time = GetusTicks(); |     // first_time = GetusTicks(); | ||||||
| @@ -545,12 +541,12 @@ next_part: | |||||||
|             frame = av_frame_alloc(); |             frame = av_frame_alloc(); | ||||||
|             ret = avcodec_receive_frame(video_ctx, frame); // get new frame |             ret = avcodec_receive_frame(video_ctx, frame); // get new frame | ||||||
|             if (ret >= 0) {                                // one is avail. |             if (ret >= 0) {                                // one is avail. | ||||||
|  |             first_time = frame->pts; | ||||||
|                 got_frame = 1; |                 got_frame = 1; | ||||||
|             } else { |             } else { | ||||||
|                 got_frame = 0; |                 got_frame = 0; | ||||||
|             } |             } | ||||||
|             //		  printf("got %s packet from |             //printf("got %s packet from decoder\n",got_frame?"1":"no"); | ||||||
|             // decoder\n",got_frame?"1":"no"); |  | ||||||
|             if (got_frame) { // frame completed |             if (got_frame) { // frame completed | ||||||
| //		printf("video frame pts %#012" PRIx64 " | //		printf("video frame pts %#012" PRIx64 " | ||||||
| //%dms\n",frame->pts,(int)(apts - frame->pts) / 90); | //%dms\n",frame->pts,(int)(apts - frame->pts) / 90); | ||||||
| @@ -558,15 +554,14 @@ next_part: | |||||||
|                 if (decoder->filter) { |                 if (decoder->filter) { | ||||||
|                     if (decoder->filter == 1) { |                     if (decoder->filter == 1) { | ||||||
|                         if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) { |                         if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) { | ||||||
|                             Fatal(_("video: Init of YADIF Filter failed\n")); |                             Debug(3,"video: Init of YADIF Filter failed\n"); | ||||||
|                             decoder->filter = 0; |                             decoder->filter = 0; | ||||||
|                         } else { |                         } else { | ||||||
|                             Debug(3, "Init YADIF ok\n"); |                             Debug(3, "Init YADIF ok\n"); | ||||||
|                             decoder->filter = 2; |                             decoder->filter = 2; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     if (frame->interlaced_frame && decoder->filter == 2 && |                     if (decoder->filter == 2) {  | ||||||
|                         (frame->height != 720)) { // broken ZDF sends Interlaced flag |  | ||||||
|                         ret = push_filters(video_ctx, decoder->HwDecoder, frame); |                         ret = push_filters(video_ctx, decoder->HwDecoder, frame); | ||||||
|                         // av_frame_unref(frame); |                         // av_frame_unref(frame); | ||||||
|                         continue; |                         continue; | ||||||
| @@ -721,9 +716,6 @@ void CodecAudioOpen(AudioDecoder *audio_decoder, int codec_id) { | |||||||
|         Fatal(_("codec: can't allocate audio codec context\n")); |         Fatal(_("codec: can't allocate audio codec context\n")); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (CodecDownmix) { |  | ||||||
|         audio_decoder->AudioCtx->request_channel_layout = AV_CH_LAYOUT_STEREO; |  | ||||||
|     } |  | ||||||
|     pthread_mutex_lock(&CodecLockMutex); |     pthread_mutex_lock(&CodecLockMutex); | ||||||
|     // open codec |     // open codec | ||||||
|     if (1) { |     if (1) { | ||||||
| @@ -876,7 +868,7 @@ static int CodecAudioUpdateHelper(AudioDecoder *audio_decoder, int *passthrough) | |||||||
|     int err; |     int err; | ||||||
|  |  | ||||||
|     audio_ctx = audio_decoder->AudioCtx; |     audio_ctx = audio_decoder->AudioCtx; | ||||||
|     Debug(3, "codec/audio: format change %s %dHz *%d channels%s%s%s%s%s\n", |     Debug(3, "codec/audio: Chanlayout %lx format change %s %dHz *%d channels%s%s%s%s%s\n",audio_ctx->channel_layout, | ||||||
|           av_get_sample_fmt_name(audio_ctx->sample_fmt), audio_ctx->sample_rate, audio_ctx->channels, |           av_get_sample_fmt_name(audio_ctx->sample_fmt), audio_ctx->sample_rate, audio_ctx->channels, | ||||||
|           CodecPassthrough & CodecPCM ? " PCM" : "", CodecPassthrough & CodecMPA ? " MPA" : "", |           CodecPassthrough & CodecPCM ? " PCM" : "", CodecPassthrough & CodecMPA ? " MPA" : "", | ||||||
|           CodecPassthrough & CodecAC3 ? " AC-3" : "", CodecPassthrough & CodecEAC3 ? " E-AC-3" : "", |           CodecPassthrough & CodecAC3 ? " AC-3" : "", CodecPassthrough & CodecEAC3 ? " E-AC-3" : "", | ||||||
| @@ -886,7 +878,7 @@ static int CodecAudioUpdateHelper(AudioDecoder *audio_decoder, int *passthrough) | |||||||
|     audio_decoder->SampleRate = audio_ctx->sample_rate; |     audio_decoder->SampleRate = audio_ctx->sample_rate; | ||||||
|     audio_decoder->HwSampleRate = audio_ctx->sample_rate; |     audio_decoder->HwSampleRate = audio_ctx->sample_rate; | ||||||
|     audio_decoder->Channels = audio_ctx->channels; |     audio_decoder->Channels = audio_ctx->channels; | ||||||
|     audio_decoder->HwChannels = audio_ctx->channels; |     audio_decoder->HwChannels = CodecDownmix ? 2 : audio_ctx->channels; | ||||||
|     audio_decoder->Passthrough = CodecPassthrough; |     audio_decoder->Passthrough = CodecPassthrough; | ||||||
|  |  | ||||||
|     // SPDIF/HDMI pass-through |     // SPDIF/HDMI pass-through | ||||||
| @@ -1166,14 +1158,29 @@ static void CodecAudioUpdateFormat(AudioDecoder *audio_decoder) { | |||||||
|     } |     } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|     audio_decoder->Resample = swr_alloc_set_opts(audio_decoder->Resample, audio_ctx->channel_layout, AV_SAMPLE_FMT_S16, | #if LIBSWRESAMPLE_VERSION_INT < AV_VERSION_INT(4,5,100) | ||||||
|                                                  audio_decoder->HwSampleRate, audio_ctx->channel_layout, |         audio_decoder->Resample = swr_alloc_set_opts(audio_decoder->Resample,  | ||||||
|                                                  audio_ctx->sample_fmt, audio_ctx->sample_rate, 0, NULL); |                                     CodecDownMix ? AV_CH_LAYOUT_STEREO : audio_ctx->channel_layout, | ||||||
|  |                                     AV_SAMPLE_FMT_S16, audio_decoder->HwSampleRate, | ||||||
|  | 	                                audio_ctx->channel_layout, audio_ctx->sample_fmt,audio_ctx->sample_rate, | ||||||
|  |                                     0, NULL); | ||||||
|  | #else | ||||||
|  |     //printf("last ressort downmix Layout in %lx Lyout out: %llx \n",audio_ctx->channel_layout,AV_CH_LAYOUT_STEREO); | ||||||
|  |         audio_decoder->Resample = swr_alloc(); | ||||||
|  |         av_opt_set_channel_layout(audio_decoder->Resample, "in_channel_layout",audio_ctx->channel_layout, 0); | ||||||
|  |         av_opt_set_channel_layout(audio_decoder->Resample, "out_channel_layout", CodecDownmix ? AV_CH_LAYOUT_STEREO : audio_ctx->channel_layout ,  0); | ||||||
|  |         av_opt_set_int(audio_decoder->Resample, "in_sample_rate",     audio_ctx->sample_rate,                0); | ||||||
|  |         av_opt_set_int(audio_decoder->Resample, "out_sample_rate",    audio_ctx->sample_rate,                0); | ||||||
|  |         av_opt_set_sample_fmt(audio_decoder->Resample, "in_sample_fmt",  audio_ctx->sample_fmt, 0); | ||||||
|  |         av_opt_set_sample_fmt(audio_decoder->Resample, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0); | ||||||
|  | #endif | ||||||
|     if (audio_decoder->Resample) { |     if (audio_decoder->Resample) { | ||||||
|         swr_init(audio_decoder->Resample); | 	    swr_init(audio_decoder->Resample); | ||||||
|     } else { |     } else { | ||||||
|         Error(_("codec/audio: can't setup resample\n")); | 	    Error(_("codec/audio: can't setup resample\n")); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -1225,13 +1232,15 @@ void CodecAudioDecode(AudioDecoder *audio_decoder, const AVPacket *avpkt) { | |||||||
|             if (CodecAudioPassthroughHelper(audio_decoder, avpkt)) { |             if (CodecAudioPassthroughHelper(audio_decoder, avpkt)) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|  |              | ||||||
|             if (audio_decoder->Resample) { |             if (audio_decoder->Resample) { | ||||||
|                 uint8_t outbuf[8192 * 2 * 8]; |                 uint8_t outbuf[8192  * 2 * 8]; | ||||||
|                 uint8_t *out[1]; |                 uint8_t *out[1]; | ||||||
|  |  | ||||||
|                 out[0] = outbuf; |                 out[0] = outbuf; | ||||||
|                 ret = swr_convert(audio_decoder->Resample, out, sizeof(outbuf) / (2 * audio_decoder->HwChannels), |                 ret = swr_convert(audio_decoder->Resample, out, sizeof(outbuf) / (2 * audio_decoder->HwChannels), | ||||||
|                                   (const uint8_t **)frame->extended_data, frame->nb_samples); |                                   (const uint8_t **)frame->extended_data, frame->nb_samples); | ||||||
|  |                                    | ||||||
|                 if (ret > 0) { |                 if (ret > 0) { | ||||||
|                     if (!(audio_decoder->Passthrough & CodecPCM)) { |                     if (!(audio_decoder->Passthrough & CodecPCM)) { | ||||||
|                         CodecReorderAudioFrame((int16_t *)outbuf, ret * 2 * audio_decoder->HwChannels, |                         CodecReorderAudioFrame((int16_t *)outbuf, ret * 2 * audio_decoder->HwChannels, | ||||||
|   | |||||||
| @@ -726,14 +726,15 @@ bool cOglCmdDeleteFb::Execute(void) { | |||||||
|  |  | ||||||
| //------------------ cOglCmdRenderFbToBufferFb -------------------- | //------------------ cOglCmdRenderFbToBufferFb -------------------- | ||||||
| cOglCmdRenderFbToBufferFb::cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, | cOglCmdRenderFbToBufferFb::cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, | ||||||
|                                                      GLint drawPortX, GLint drawPortY) |                                                      GLint drawPortX, GLint drawPortY, bool alphablending) | ||||||
|     : cOglCmd(fb) { |     : cOglCmd(fb) { | ||||||
|     this->buffer = buffer; |     this->buffer = buffer; | ||||||
|     this->x = (GLfloat)x; |     this->x = (GLfloat)x; | ||||||
|     this->y = (GLfloat)y; |     this->y = (GLfloat)y; | ||||||
|     this->drawPortX = (GLfloat)drawPortX; |     this->drawPortX = (GLfloat)drawPortX; | ||||||
|     this->drawPortY = (GLfloat)drawPortY; |     this->drawPortY = (GLfloat)drawPortY; | ||||||
|     this->transparency = transparency; |      this->transparency = (alphablending ? transparency : ALPHA_OPAQUE); | ||||||
|  |     this->alphablending = alphablending; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cOglCmdRenderFbToBufferFb::Execute(void) { | bool cOglCmdRenderFbToBufferFb::Execute(void) { | ||||||
| @@ -773,11 +774,14 @@ bool cOglCmdRenderFbToBufferFb::Execute(void) { | |||||||
|  |  | ||||||
|     if (!fb->BindTexture()) |     if (!fb->BindTexture()) | ||||||
|         return false; |         return false; | ||||||
|  |     if (!alphablending) | ||||||
|  |         VertexBuffers[vbTexture]->DisableBlending(); | ||||||
|     VertexBuffers[vbTexture]->Bind(); |     VertexBuffers[vbTexture]->Bind(); | ||||||
|     VertexBuffers[vbTexture]->SetVertexData(quadVertices); |     VertexBuffers[vbTexture]->SetVertexData(quadVertices); | ||||||
|     VertexBuffers[vbTexture]->DrawArrays(); |     VertexBuffers[vbTexture]->DrawArrays(); | ||||||
|     VertexBuffers[vbTexture]->Unbind(); |     VertexBuffers[vbTexture]->Unbind(); | ||||||
|  |     if (!alphablending) | ||||||
|  |         VertexBuffers[vbTexture]->EnableBlending(); | ||||||
|     buffer->Unbind(); |     buffer->Unbind(); | ||||||
|  |  | ||||||
|     return true; |     return true; | ||||||
| @@ -1283,10 +1287,10 @@ bool cOglCmdDrawImage::Execute(void) { | |||||||
|     pthread_mutex_unlock(&OSDMutex); |     pthread_mutex_unlock(&OSDMutex); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|     GLfloat x1 = x;          // left |     GLfloat x1 = x;                   // left | ||||||
|     GLfloat y1 = y;          // top |     GLfloat y1 = y;                   // top | ||||||
|     GLfloat x2 = x + width;  // right |     GLfloat x2 = x + width * scaleX;  // right | ||||||
|     GLfloat y2 = y + height; // bottom |     GLfloat y2 = y + height * scaleY; // bottom | ||||||
|  |  | ||||||
|     GLfloat quadVertices[] = { |     GLfloat quadVertices[] = { | ||||||
|         x1, y2, 0.0, 1.0, // left bottom |         x1, y2, 0.0, 1.0, // left bottom | ||||||
| @@ -1320,19 +1324,21 @@ bool cOglCmdDrawImage::Execute(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| //------------------ cOglCmdDrawTexture -------------------- | //------------------ cOglCmdDrawTexture -------------------- | ||||||
| cOglCmdDrawTexture::cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y) : cOglCmd(fb) { | cOglCmdDrawTexture::cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX, double scaleY) : cOglCmd(fb) { | ||||||
|     this->imageRef = imageRef; |     this->imageRef = imageRef; | ||||||
|     this->x = x; |     this->x = x; | ||||||
|     this->y = y; |     this->y = y; | ||||||
|  |     this->scaleX = scaleX; | ||||||
|  |     this->scaleY = scaleY; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cOglCmdDrawTexture::Execute(void) { | bool cOglCmdDrawTexture::Execute(void) { | ||||||
|     if (imageRef->width <= 0 || imageRef->height <= 0) |     if (imageRef->width <= 0 || imageRef->height <= 0) | ||||||
|         return false; |         return false; | ||||||
|     GLfloat x1 = x;                    // top |     GLfloat x1 = x;                             // top | ||||||
|     GLfloat y1 = y;                    // left |     GLfloat y1 = y;                             // left | ||||||
|     GLfloat x2 = x + imageRef->width;  // right |     GLfloat x2 = x + imageRef->width * scaleX;  // right | ||||||
|     GLfloat y2 = y + imageRef->height; // bottom |     GLfloat y2 = y + imageRef->height * scaleY; // bottom | ||||||
|  |  | ||||||
|     GLfloat quadVertices[] = { |     GLfloat quadVertices[] = { | ||||||
|         // Pos	  // TexCoords |         // Pos	  // TexCoords | ||||||
| @@ -1826,6 +1832,10 @@ void cOglPixmap::Fill(tColor Color) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) { | void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) { | ||||||
|  |     DrawScaledImage(Point, Image); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void cOglPixmap::DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias) { | ||||||
|     if (!oglThread->Active()) |     if (!oglThread->Active()) | ||||||
|         return; |         return; | ||||||
|     tColor *argb = MALLOC(tColor, Image.Width() * Image.Height()); |     tColor *argb = MALLOC(tColor, Image.Width() * Image.Height()); | ||||||
| @@ -1834,19 +1844,25 @@ void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) { | |||||||
|         return; |         return; | ||||||
|     memcpy(argb, Image.Data(), sizeof(tColor) * Image.Width() * Image.Height()); |     memcpy(argb, Image.Data(), sizeof(tColor) * Image.Width() * Image.Height()); | ||||||
|  |  | ||||||
|     oglThread->DoCmd(new cOglCmdDrawImage(fb, argb, Image.Width(), Image.Height(), Point.X(), Point.Y())); |     oglThread->DoCmd(new cOglCmdDrawImage(fb, argb, Image.Width(), Image.Height(), Point.X(), Point.Y(), true, FactorX, FactorY)); | ||||||
|     SetDirty(); |     SetDirty(); | ||||||
|     MarkDrawPortDirty(cRect(Point, cSize(Image.Width(), Image.Height())).Intersected(DrawPort().Size())); |     MarkDrawPortDirty(cRect(Point, cSize(Image.Width() * FactorX, Image.Height() * FactorY)).Intersected(DrawPort().Size())); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) { | void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) { | ||||||
|  |     DrawScaledImage(Point, ImageHandle); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void cOglPixmap::DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias) { | ||||||
|     if (!oglThread->Active()) |     if (!oglThread->Active()) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     if (ImageHandle < 0 && oglThread->GetImageRef(ImageHandle)) { |     if (ImageHandle < 0 && oglThread->GetImageRef(ImageHandle)) { | ||||||
|         sOglImage *img = oglThread->GetImageRef(ImageHandle); |         sOglImage *img = oglThread->GetImageRef(ImageHandle); | ||||||
|  |  | ||||||
|         oglThread->DoCmd(new cOglCmdDrawTexture(fb, img, Point.X(), Point.Y())); |         oglThread->DoCmd(new cOglCmdDrawTexture(fb, img, Point.X(), Point.Y(), FactorX, FactorY)); | ||||||
|  |         SetDirty(); | ||||||
|  |         MarkDrawPortDirty(cRect(Point, cSize(img->width * FactorX, img->height * FactorY)).Intersected(DrawPort().Size())); | ||||||
|     } |     } | ||||||
|     /* |     /* | ||||||
|        Fallback to VDR implementation, needs to separate cSoftOsdProvider from |        Fallback to VDR implementation, needs to separate cSoftOsdProvider from | ||||||
| @@ -1854,8 +1870,6 @@ void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) { | |||||||
|        DrawImage(Point, *cSoftOsdProvider::GetImageData(ImageHandle)); |        DrawImage(Point, *cSoftOsdProvider::GetImageData(ImageHandle)); | ||||||
|        } |        } | ||||||
|      */ |      */ | ||||||
|     SetDirty(); |  | ||||||
|     MarkDrawPortDirty(DrawPort()); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| void cOglPixmap::DrawPixel(const cPoint &Point, tColor Color) { | void cOglPixmap::DrawPixel(const cPoint &Point, tColor Color) { | ||||||
| @@ -2096,6 +2110,14 @@ cPixmap *cOglOsd::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &Dr | |||||||
|     return NULL; |     return NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | extern "C" {void VideoSetOsdSize(int, int ) ;} | ||||||
|  |  | ||||||
|  | void SetOsdPosition(int Left, int Top, int Width, int Height) { | ||||||
|  |     printf("Set OSD Position %d %d\n",Width,Height); | ||||||
|  |   VideoSetOsdSize( Width, Height) ;  | ||||||
|  | } | ||||||
|  |  | ||||||
| void cOglOsd::DestroyPixmap(cPixmap *Pixmap) { | void cOglOsd::DestroyPixmap(cPixmap *Pixmap) { | ||||||
|     if (!oglThread->Active()) |     if (!oglThread->Active()) | ||||||
|         return; |         return; | ||||||
| @@ -2141,10 +2163,16 @@ void cOglOsd::Flush(void) { | |||||||
|         for (int i = 0; i < oglPixmaps.Size(); i++) { |         for (int i = 0; i < oglPixmaps.Size(); i++) { | ||||||
|             if (oglPixmaps[i]) { |             if (oglPixmaps[i]) { | ||||||
|                 if (oglPixmaps[i]->Layer() == layer) { |                 if (oglPixmaps[i]->Layer() == layer) { | ||||||
|                     oglThread->DoCmd(new cOglCmdRenderFbToBufferFb( |                     bool alphablending = layer == 0 ? false : true; // Decide wether to render (with alpha) or copy a pixmap | ||||||
|                         oglPixmaps[i]->Fb(), bFb, oglPixmaps[i]->ViewPort().X(), |                     oglThread->DoCmd(new cOglCmdRenderFbToBufferFb( oglPixmaps[i]->Fb(),  | ||||||
|                         (!isSubtitleOsd) ? oglPixmaps[i]->ViewPort().Y() : 0, oglPixmaps[i]->Alpha(), |                                                                     bFb, | ||||||
|                         oglPixmaps[i]->DrawPort().X(), oglPixmaps[i]->DrawPort().Y())); |                                                                     oglPixmaps[i]->ViewPort().X(),  | ||||||
|  |                                                                     (!isSubtitleOsd) ? oglPixmaps[i]->ViewPort().Y() : 0, | ||||||
|  |                                                                     oglPixmaps[i]->Alpha(),  | ||||||
|  |                                                                     oglPixmaps[i]->DrawPort().X(),  | ||||||
|  |                                                                     oglPixmaps[i]->DrawPort().Y(), | ||||||
|  |                                                                     alphablending | ||||||
|  |                                                                     )); | ||||||
|                     oglPixmaps[i]->SetDirty(false); |                     oglPixmaps[i]->SetDirty(false); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -290,10 +290,11 @@ class cOglCmdRenderFbToBufferFb : public cOglCmd { | |||||||
|     GLfloat x, y; |     GLfloat x, y; | ||||||
|     GLfloat drawPortX, drawPortY; |     GLfloat drawPortX, drawPortY; | ||||||
|     GLint transparency; |     GLint transparency; | ||||||
|  |     GLint alphablending; | ||||||
|  |  | ||||||
|   public: |   public: | ||||||
|     cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, GLint drawPortX, |     cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, GLint drawPortX, | ||||||
|                               GLint drawPortY); |                               GLint drawPortY, bool alphablending); | ||||||
|     virtual ~cOglCmdRenderFbToBufferFb(void){}; |     virtual ~cOglCmdRenderFbToBufferFb(void){}; | ||||||
|     virtual const char *Description(void) { return "Render Framebuffer to Buffer"; } |     virtual const char *Description(void) { return "Render Framebuffer to Buffer"; } | ||||||
|     virtual bool Execute(void); |     virtual bool Execute(void); | ||||||
| @@ -402,9 +403,10 @@ class cOglCmdDrawTexture : public cOglCmd { | |||||||
|   private: |   private: | ||||||
|     sOglImage *imageRef; |     sOglImage *imageRef; | ||||||
|     GLint x, y; |     GLint x, y; | ||||||
|  |     GLfloat scaleX, scaleY; | ||||||
|  |  | ||||||
|   public: |   public: | ||||||
|     cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y); |     cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX = 1.0f, double scaleY = 1.0f); | ||||||
|     virtual ~cOglCmdDrawTexture(void){}; |     virtual ~cOglCmdDrawTexture(void){}; | ||||||
|     virtual const char *Description(void) { return "Draw Texture"; } |     virtual const char *Description(void) { return "Draw Texture"; } | ||||||
|     virtual bool Execute(void); |     virtual bool Execute(void); | ||||||
| @@ -500,6 +502,8 @@ class cOglPixmap : public cPixmap { | |||||||
|     virtual void Fill(tColor Color); |     virtual void Fill(tColor Color); | ||||||
|     virtual void DrawImage(const cPoint &Point, const cImage &Image); |     virtual void DrawImage(const cPoint &Point, const cImage &Image); | ||||||
|     virtual void DrawImage(const cPoint &Point, int ImageHandle); |     virtual void DrawImage(const cPoint &Point, int ImageHandle); | ||||||
|  |     virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false); | ||||||
|  |     virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false); | ||||||
|     virtual void DrawPixel(const cPoint &Point, tColor Color); |     virtual void DrawPixel(const cPoint &Point, tColor Color); | ||||||
|     virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, |     virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, | ||||||
|                             bool Overlay = false); |                             bool Overlay = false); | ||||||
| @@ -528,6 +532,7 @@ class cOglOsd : public cOsd { | |||||||
|   public: |   public: | ||||||
|     cOglOsd(int Left, int Top, uint Level, std::shared_ptr<cOglThread> oglThread); |     cOglOsd(int Left, int Top, uint Level, std::shared_ptr<cOglThread> oglThread); | ||||||
|     virtual ~cOglOsd(); |     virtual ~cOglOsd(); | ||||||
|  |     static void SetOsdPosition(int Left, int Top, int Width, int Height); | ||||||
|     virtual eOsdError SetAreas(const tArea *Areas, int NumAreas); |     virtual eOsdError SetAreas(const tArea *Areas, int NumAreas); | ||||||
|     virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null); |     virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null); | ||||||
|     virtual void DestroyPixmap(cPixmap *Pixmap); |     virtual void DestroyPixmap(cPixmap *Pixmap); | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ extern void ToggleLUT(); | |||||||
| /// vdr-plugin version number. | /// vdr-plugin version number. | ||||||
| /// Makefile extracts the version number for generating the file name | /// Makefile extracts the version number for generating the file name | ||||||
| /// for the distribution archive. | /// for the distribution archive. | ||||||
| static const char *const VERSION = "3.12" | static const char *const VERSION = "3.19" | ||||||
| #ifdef GIT_REV | #ifdef GIT_REV | ||||||
|                                    "-GIT" GIT_REV |                                    "-GIT" GIT_REV | ||||||
| #endif | #endif | ||||||
| @@ -658,6 +658,20 @@ class cDummyPixmap : public cPixmap { | |||||||
|         (void)Point; |         (void)Point; | ||||||
|         (void)ImageHandle; |         (void)ImageHandle; | ||||||
|     } |     } | ||||||
|  |     virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias) { | ||||||
|  |         (void)Point; | ||||||
|  |         (void)Image; | ||||||
|  |         (void)FactorX; | ||||||
|  |         (void)FactorY; | ||||||
|  |         (void)AntiAlias; | ||||||
|  |     } | ||||||
|  |     virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias) { | ||||||
|  |         (void)Point; | ||||||
|  |         (void)ImageHandle; | ||||||
|  |         (void)FactorX; | ||||||
|  |         (void)FactorY; | ||||||
|  |         (void)AntiAlias; | ||||||
|  |     } | ||||||
|     virtual void DrawPixel(const cPoint &Point, tColor Color) { |     virtual void DrawPixel(const cPoint &Point, tColor Color) { | ||||||
|         (void)Point; |         (void)Point; | ||||||
|         (void)Color; |         (void)Color; | ||||||
| @@ -723,6 +737,12 @@ class cDummyOsd : public cOsd { | |||||||
|   public: |   public: | ||||||
|     cDummyOsd(int Left, int Top, uint Level) : cOsd(Left, Top, Level) {} |     cDummyOsd(int Left, int Top, uint Level) : cOsd(Left, Top, Level) {} | ||||||
|     virtual ~cDummyOsd() {} |     virtual ~cDummyOsd() {} | ||||||
|  |     static void SetOsdPosition(int Left, int Top, int Width, int Height) { | ||||||
|  |         (void) Left; | ||||||
|  |         (void) Top; | ||||||
|  |         (void) Width; | ||||||
|  |         (void) Height; | ||||||
|  |     } | ||||||
|     virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null) { |     virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null) { | ||||||
|         p = new cDummyPixmap(Layer, ViewPort, DrawPort); |         p = new cDummyPixmap(Layer, ViewPort, DrawPort); | ||||||
|         return p; |         return p; | ||||||
| @@ -1147,9 +1167,9 @@ void cMenuSetupSoft::Create(void) { | |||||||
|  |  | ||||||
|     if (scalers == 0) { |     if (scalers == 0) { | ||||||
|         scalingtest[0] = (char *)"Off"; |         scalingtest[0] = (char *)"Off"; | ||||||
|         for (scalers = 0; pl_named_filters[scalers].name != NULL; scalers++) { |         for (scalers = 0; pl_filter_presets[scalers].name != NULL; scalers++) { | ||||||
|             scaling[scalers] = (char *)pl_named_filters[scalers].name; |             scaling[scalers] = (char *)pl_filter_presets[scalers].name; | ||||||
|             scalingtest[scalers + 1] = (char *)pl_named_filters[scalers].name; |             scalingtest[scalers + 1] = (char *)pl_filter_presets[scalers].name; | ||||||
|             // printf("Scaler %s\n",pl_named_filters[scalers].name); |             // printf("Scaler %s\n",pl_named_filters[scalers].name); | ||||||
|         } |         } | ||||||
|         // scalers -= 2; |         // scalers -= 2; | ||||||
|   | |||||||
| @@ -2817,8 +2817,8 @@ const char *CommandLineHelp(void) { | |||||||
|            "\tstill-h264-hw-decoder\tenable h264 hw decoder for still-pictures\n" |            "\tstill-h264-hw-decoder\tenable h264 hw decoder for still-pictures\n" | ||||||
|            "\talsa-driver-broken\tdisable broken alsa driver message\n" |            "\talsa-driver-broken\tdisable broken alsa driver message\n" | ||||||
|            "\talsa-no-close-open\tdisable close open to fix alsa no sound bug\n" |            "\talsa-no-close-open\tdisable close open to fix alsa no sound bug\n" | ||||||
|            "\talsa-close-open-delay\tenable close open delay to fix no sound " |            "\talsa-no-test\tdisable Alsa Capability test on start for NUC11/12\n" | ||||||
|            "bug\n" |            "\talsa-close-open-delay\tenable close open delay to fix no sound bug\n" | ||||||
|            "\tignore-repeat-pict\tdisable repeat pict message\n" |            "\tignore-repeat-pict\tdisable repeat pict message\n" | ||||||
|            "\tuse-possible-defect-frames prefer faster channel switch\n" |            "\tuse-possible-defect-frames prefer faster channel switch\n" | ||||||
|            "	 -D\t\tstart in detached mode\n"; |            "	 -D\t\tstart in detached mode\n"; | ||||||
| @@ -2908,6 +2908,8 @@ int ProcessArgs(int argc, char *const argv[]) { | |||||||
|                     AudioAlsaDriverBroken = 1; |                     AudioAlsaDriverBroken = 1; | ||||||
|                 } else if (!strcasecmp("alsa-no-close-open", optarg)) { |                 } else if (!strcasecmp("alsa-no-close-open", optarg)) { | ||||||
|                     AudioAlsaNoCloseOpen = 1; |                     AudioAlsaNoCloseOpen = 1; | ||||||
|  |                 } else if (!strcasecmp("alsa-no-test", optarg)) { | ||||||
|  |                     AudioAlsaNotest = 1; | ||||||
|                 } else if (!strcasecmp("alsa-close-open-delay", optarg)) { |                 } else if (!strcasecmp("alsa-close-open-delay", optarg)) { | ||||||
|                     AudioAlsaCloseOpenDelay = 1; |                     AudioAlsaCloseOpenDelay = 1; | ||||||
|                 } else if (!strcasecmp("ignore-repeat-pict", optarg)) { |                 } else if (!strcasecmp("ignore-repeat-pict", optarg)) { | ||||||
|   | |||||||
							
								
								
									
										70
									
								
								video.c
									
									
									
									
									
								
							
							
						
						
									
										70
									
								
								video.c
									
									
									
									
									
								
							| @@ -1990,6 +1990,9 @@ make_egl() { | |||||||
|         Fatal(_("Could not make context current!\n")); |         Fatal(_("Could not make context current!\n")); | ||||||
|     } |     } | ||||||
|     EglEnabled = 1; |     EglEnabled = 1; | ||||||
|  | #ifdef USE_DRM | ||||||
|  |     drm_swap_buffers(); | ||||||
|  | #endif | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -2611,7 +2614,16 @@ void generateVAAPIImage(CuvidDecoder *decoder, VASurfaceID index, const AVFrame | |||||||
|  |  | ||||||
|         glBindTexture(GL_TEXTURE_2D, decoder->gl_textures[index * Planes + n]); |         glBindTexture(GL_TEXTURE_2D, decoder->gl_textures[index * Planes + n]); | ||||||
|         EGLImageTargetTexture2DOES(GL_TEXTURE_2D, decoder->images[index * Planes + n]); |         EGLImageTargetTexture2DOES(GL_TEXTURE_2D, decoder->images[index * Planes + n]); | ||||||
|         decoder->fds[index * Planes + n] = desc.objects[n].fd; |         if (n==0) { | ||||||
|  |           decoder->fds[index * Planes + n] = fd; | ||||||
|  |            | ||||||
|  |         } | ||||||
|  |         else if (fd == decoder->fds[index * Planes]) { | ||||||
|  |           decoder->fds[index * Planes + n] = 0; | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             decoder->fds[index * Planes + n] = fd; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     glBindTexture(GL_TEXTURE_2D, 0); |     glBindTexture(GL_TEXTURE_2D, 0); | ||||||
| @@ -2682,8 +2694,6 @@ int push_filters(AVCodecContext *dec_ctx, CuvidDecoder *decoder, AVFrame *frame) | |||||||
|     while ((ret = av_buffersink_get_frame(decoder->buffersink_ctx, filt_frame)) >= 0) { |     while ((ret = av_buffersink_get_frame(decoder->buffersink_ctx, filt_frame)) >= 0) { | ||||||
|         filt_frame->pts /= 2; |         filt_frame->pts /= 2; | ||||||
|         decoder->Interlaced = 0; |         decoder->Interlaced = 0; | ||||||
|         // printf("vaapideint video:new	 %#012" PRIx64 " old %#012" PRIx64 |  | ||||||
|         // "\n",filt_frame->pts,frame->pts); |  | ||||||
|         CuvidSyncRenderFrame(decoder, dec_ctx, filt_frame); |         CuvidSyncRenderFrame(decoder, dec_ctx, filt_frame); | ||||||
|         filt_frame = av_frame_alloc(); // get new frame |         filt_frame = av_frame_alloc(); // get new frame | ||||||
|     } |     } | ||||||
| @@ -2959,19 +2969,6 @@ static enum AVPixelFormat Cuvid_get_format(CuvidDecoder *decoder, AVCodecContext | |||||||
| #ifdef PLACEBO | #ifdef PLACEBO | ||||||
|             VideoThreadUnlock(); |             VideoThreadUnlock(); | ||||||
|             // dont show first frame |             // dont show first frame | ||||||
| #endif |  | ||||||
| #ifdef YADIF |  | ||||||
|             if (VideoDeinterlace[decoder->Resolution] == VideoDeinterlaceYadif) { |  | ||||||
|                 deint = 0; |  | ||||||
|                 ist->filter = 1; // init yadif_cuda |  | ||||||
|             } else { |  | ||||||
|                 deint = 2; |  | ||||||
|                 ist->filter = 0; |  | ||||||
|             } |  | ||||||
|             CuvidMessage(2, "deint = %s\n", deint == 0 ? "Yadif" : "Cuda"); |  | ||||||
|             if (av_opt_set_int(video_ctx->priv_data, "deint", deint, 0) < 0) { // adaptive |  | ||||||
|                 Fatal(_("codec: can't set option deint to video codec!\n")); |  | ||||||
|             } |  | ||||||
| #endif | #endif | ||||||
|         } else { |         } else { | ||||||
|             decoder->SyncCounter = 0; |             decoder->SyncCounter = 0; | ||||||
| @@ -2985,6 +2982,20 @@ static enum AVPixelFormat Cuvid_get_format(CuvidDecoder *decoder, AVCodecContext | |||||||
|             CuvidUpdateOutput(decoder); // update aspect/scaling |             CuvidUpdateOutput(decoder); // update aspect/scaling | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | #if defined YADIF && defined CUVID | ||||||
|  |         if (VideoDeinterlace[decoder->Resolution] == VideoDeinterlaceYadif) { | ||||||
|  |             deint = 0; | ||||||
|  |             ist->filter = 1; // init yadif_cuda | ||||||
|  |         } else { | ||||||
|  |             deint = 2; | ||||||
|  |             ist->filter = 0; | ||||||
|  |         } | ||||||
|  |         CuvidMessage(2, "deint = %s\n", deint == 0 ? "Yadif" : "Cuda"); | ||||||
|  |         if (av_opt_set_int(video_ctx->priv_data, "deint", deint, 0) < 0) { // adaptive | ||||||
|  |             Fatal(_("codec: can't set option deint to video codec!\n")); | ||||||
|  |         } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|         CuvidMessage(2, "GetFormat Init ok %dx%d\n", video_ctx->width, video_ctx->height); |         CuvidMessage(2, "GetFormat Init ok %dx%d\n", video_ctx->width, video_ctx->height); | ||||||
|         decoder->InputAspect = video_ctx->sample_aspect_ratio; |         decoder->InputAspect = video_ctx->sample_aspect_ratio; | ||||||
| #ifdef CUVID | #ifdef CUVID | ||||||
| @@ -3793,6 +3804,7 @@ static void CuvidMixVideo(CuvidDecoder *decoder, __attribute__((unused)) int lev | |||||||
|     AVFrameSideData *sd, *sd1 = NULL, *sd2 = NULL; |     AVFrameSideData *sd, *sd1 = NULL, *sd2 = NULL; | ||||||
|  |  | ||||||
| #ifdef PLACEBO | #ifdef PLACEBO | ||||||
|  |  | ||||||
|     if (level) { |     if (level) { | ||||||
|         dst_rect.x0 = decoder->VideoX; // video window output (clip) |         dst_rect.x0 = decoder->VideoX; // video window output (clip) | ||||||
|         dst_rect.y0 = decoder->VideoY; |         dst_rect.y0 = decoder->VideoY; | ||||||
| @@ -4079,8 +4091,11 @@ static void CuvidMixVideo(CuvidDecoder *decoder, __attribute__((unused)) int lev | |||||||
|  |  | ||||||
|     // render_params.upscaler = &pl_filter_ewa_lanczos; |     // render_params.upscaler = &pl_filter_ewa_lanczos; | ||||||
|  |  | ||||||
|     render_params.upscaler = pl_named_filters[VideoScaling[decoder->Resolution]].filter; |     render_params.upscaler = pl_filter_presets[VideoScaling[decoder->Resolution]].filter; | ||||||
|     render_params.downscaler = pl_named_filters[VideoScaling[decoder->Resolution]].filter; |     render_params.downscaler = pl_filter_presets[VideoScaling[decoder->Resolution]].filter; | ||||||
|  |  | ||||||
|  |     if (level) | ||||||
|  |         render_params.skip_target_clearing = 1; | ||||||
|  |  | ||||||
|     render_params.color_adjustment = &colors; |     render_params.color_adjustment = &colors; | ||||||
|  |  | ||||||
| @@ -4147,7 +4162,8 @@ static void CuvidMixVideo(CuvidDecoder *decoder, __attribute__((unused)) int lev | |||||||
|     if (!pl_render_image(p->renderer, &decoder->pl_frames[current], target, &render_params)) { |     if (!pl_render_image(p->renderer, &decoder->pl_frames[current], target, &render_params)) { | ||||||
|         Debug(4, "Failed rendering frame!\n"); |         Debug(4, "Failed rendering frame!\n"); | ||||||
|     } |     } | ||||||
|     //   pl_gpu_finish(p->gpu); |      | ||||||
|  |      | ||||||
|     // printf("Rendertime %ld -- \n,",GetusTicks() - tt); |     // printf("Rendertime %ld -- \n,",GetusTicks() - tt); | ||||||
|  |  | ||||||
|     if (VideoScalerTest) { // left side test scaler |     if (VideoScalerTest) { // left side test scaler | ||||||
| @@ -4170,11 +4186,12 @@ static void CuvidMixVideo(CuvidDecoder *decoder, __attribute__((unused)) int lev | |||||||
|         target->crop.y1 = dst_video_rect.y1; |         target->crop.y1 = dst_video_rect.y1; | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|         render_params.upscaler = pl_named_filters[VideoScalerTest - 1].filter; |         render_params.upscaler = pl_filter_presets[VideoScalerTest - 1].filter; | ||||||
|         render_params.downscaler = pl_named_filters[VideoScalerTest - 1].filter; |         render_params.downscaler = pl_filter_presets[VideoScalerTest - 1].filter; | ||||||
|  |  | ||||||
|         //	render_params.lut = NULL; |         //	render_params.lut = NULL; | ||||||
|         render_params.num_hooks = 0; |         render_params.num_hooks = 0; | ||||||
|  |         render_params.skip_target_clearing = 1; | ||||||
|  |  | ||||||
|         if (!p->renderertest) |         if (!p->renderertest) | ||||||
|             p->renderertest = pl_renderer_create(p->ctx, p->gpu); |             p->renderertest = pl_renderer_create(p->ctx, p->gpu); | ||||||
| @@ -4413,7 +4430,7 @@ static void CuvidDisplayFrame(void) { | |||||||
|             if ((VideoShowBlackPicture && !decoder->TrickSpeed) || |             if ((VideoShowBlackPicture && !decoder->TrickSpeed) || | ||||||
|                 (VideoShowBlackPicture && decoder->Closing < -300)) { |                 (VideoShowBlackPicture && decoder->Closing < -300)) { | ||||||
|                 CuvidBlackSurface(decoder); |                 CuvidBlackSurface(decoder); | ||||||
|                 CuvidMessage(4, "video/cuvid: black surface displayed\n"); |                 CuvidMessage(4, "video/cuvid: black surface displayed Filled %d\n",filled); | ||||||
|             } |             } | ||||||
|             continue; |             continue; | ||||||
|         } |         } | ||||||
| @@ -4460,6 +4477,9 @@ static void CuvidDisplayFrame(void) { | |||||||
|             decoder->grab = 0; |             decoder->grab = 0; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | #ifdef PLACEBO | ||||||
|  |     pl_gpu_finish(p->gpu); | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #ifndef PLACEBO | #ifndef PLACEBO | ||||||
|     //	add osd to surface |     //	add osd to surface | ||||||
| @@ -4876,7 +4896,7 @@ static void CuvidSyncRenderFrame(CuvidDecoder *decoder, const AVCodecContext *vi | |||||||
|     // if video output buffer is full, wait and display surface. |     // if video output buffer is full, wait and display surface. | ||||||
|     // loop for interlace |     // loop for interlace | ||||||
|     if (atomic_read(&decoder->SurfacesFilled) >= VIDEO_SURFACES_MAX) { |     if (atomic_read(&decoder->SurfacesFilled) >= VIDEO_SURFACES_MAX) { | ||||||
|         Fatal("video/cuvid: this code part shouldn't be used\n"); |         //Fatal("video/cuvid: this code part shouldn't be used\n"); | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -6883,10 +6903,10 @@ void VideoSetAbove() { | |||||||
| void VideoSetDeinterlace(int mode[VideoResolutionMax]) { | void VideoSetDeinterlace(int mode[VideoResolutionMax]) { | ||||||
| #ifdef CUVID | #ifdef CUVID | ||||||
|     VideoDeinterlace[0] = mode[0]; // 576i |     VideoDeinterlace[0] = mode[0]; // 576i | ||||||
|     VideoDeinterlace[1] = 1;       // mode[1];  // 720p |     VideoDeinterlace[1] = 0;       // mode[1];  // 720p | ||||||
|     VideoDeinterlace[2] = mode[2]; // fake 1080 |     VideoDeinterlace[2] = mode[2]; // fake 1080 | ||||||
|     VideoDeinterlace[3] = mode[3]; // 1080 |     VideoDeinterlace[3] = mode[3]; // 1080 | ||||||
|     VideoDeinterlace[4] = 1;       // mode[4];  2160p |     VideoDeinterlace[4] = 0;       // mode[4];  2160p | ||||||
| #else | #else | ||||||
|     VideoDeinterlace[0] = 1; // 576i |     VideoDeinterlace[0] = 1; // 576i | ||||||
|     VideoDeinterlace[1] = 0; // mode[1];  // 720p |     VideoDeinterlace[1] = 0; // mode[1];  // 720p | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user