mirror of
				https://github.com/jojo61/vdr-plugin-softhdcuvid.git
				synced 2025-03-01 10:39:28 +00:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 72cb77f771 | ||
|  | c679d812d1 | ||
|  | 47b461ab46 | ||
|  | 8629946041 | ||
|  | a222f6a1d5 | ||
|  | b51589aaa9 | ||
|  | c3af54aae0 | ||
|  | 4e96489e35 | ||
|  | 65017da5ac | 
							
								
								
									
										18
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Makefile
									
									
									
									
									
								
							| @@ -24,7 +24,7 @@ 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 | ||||||
| @@ -35,7 +35,6 @@ YADIF = 1 | |||||||
|  |  | ||||||
| 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): | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										28
									
								
								codec.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								codec.c
									
									
									
									
									
								
							| @@ -716,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) { | ||||||
| @@ -881,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 | ||||||
| @@ -1161,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")); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -1220,6 +1232,7 @@ 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]; | ||||||
| @@ -1227,6 +1240,7 @@ void CodecAudioDecode(AudioDecoder *audio_decoder, const AVPacket *avpkt) { | |||||||
|                 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, | ||||||
|   | |||||||
| @@ -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.16" | static const char *const VERSION = "3.19" | ||||||
| #ifdef GIT_REV | #ifdef GIT_REV | ||||||
|                                    "-GIT" GIT_REV |                                    "-GIT" GIT_REV | ||||||
| #endif | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user