mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
				synced 2023-10-10 17:16:51 +00:00 
			
		
		
		
	Report correct size in cSoftHdDevice::GetVideoSize.
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| User johns | ||||
| Date: | ||||
|  | ||||
|     Report correct video size in cSoftHdDevice::GetVideoSize. | ||||
|     Add picture adjustment support for vdpau. | ||||
|     Revert "mpeg_vdpau" back to "mpegvideo_vdpau". | ||||
|     Fix bug: Can't use software decoder with VDPAU. | ||||
|   | ||||
							
								
								
									
										36
									
								
								softhddev.c
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								softhddev.c
									
									
									
									
									
								
							| @@ -2019,6 +2019,42 @@ int64_t GetSTC(void) | ||||
|     return AV_NOPTS_VALUE; | ||||
| } | ||||
|  | ||||
| /** | ||||
| **	Get video stream size and aspect. | ||||
| ** | ||||
| **	@param width[OUT]	width of video stream | ||||
| **	@param height[OUT]	height of video stream | ||||
| **	@param aspect[OUT]	aspect ratio (4/3, 16/9, ...) of video stream | ||||
| */ | ||||
| void GetVideoSize(int *width, int *height, double *aspect) | ||||
| { | ||||
| #ifdef DEBUG | ||||
|     static int done_width; | ||||
|     static int done_height; | ||||
| #endif | ||||
|     int aspect_num; | ||||
|     int aspect_den; | ||||
|  | ||||
|     if (MyHwDecoder) { | ||||
| 	VideoGetVideoSize(MyHwDecoder, width, height, &aspect_num, | ||||
| 	    &aspect_den); | ||||
| 	*aspect = (double)aspect_num / (double)aspect_den; | ||||
|     } else { | ||||
| 	*width = 0; | ||||
| 	*height = 0; | ||||
| 	*aspect = 1.0;			// like default cDevice::GetVideoSize | ||||
|     } | ||||
|  | ||||
| #ifdef DEBUG | ||||
|     if (done_width != *width || done_height != *height) { | ||||
| 	Debug(3, "[softhddev]%s: %dx%d %g\n", __FUNCTION__, *width, *height, | ||||
| 	    *aspect); | ||||
| 	done_width = *width; | ||||
| 	done_height = *height; | ||||
|     } | ||||
| #endif | ||||
| } | ||||
|  | ||||
| /** | ||||
| **	Set trick play speed. | ||||
| ** | ||||
|   | ||||
| @@ -53,6 +53,8 @@ extern "C" | ||||
|     extern int SetPlayMode(int); | ||||
|     /// C plugin get current system time counter | ||||
|     extern int64_t GetSTC(void); | ||||
|     /// C plugin get video stream size and aspect | ||||
|     extern void GetVideoSize(int *, int *, double *); | ||||
|     /// C plugin set trick speed | ||||
|     extern void TrickSpeed(int); | ||||
|     /// C plugin clears all video and audio data from the device | ||||
|   | ||||
| @@ -1741,11 +1741,11 @@ void cSoftHdDevice::SetVideoFormat(bool video_format16_9) | ||||
| **	Returns the width, height and video_aspect ratio of the currently | ||||
| **	displayed video material. | ||||
| ** | ||||
| **	@note the size is used to scale the subtitle. | ||||
| **	@note the video_aspect is used to scale the subtitle. | ||||
| */ | ||||
| void cSoftHdDevice::GetVideoSize(int &width, int &height, double &video_aspect) | ||||
| { | ||||
|     ::GetOsdSize(&width, &height, &video_aspect); | ||||
|     ::GetVideoSize(&width, &height, &video_aspect); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
							
								
								
									
										40
									
								
								video.c
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								video.c
									
									
									
									
									
								
							| @@ -9698,6 +9698,46 @@ void VideoGetStats(VideoHwDecoder * hw_decoder, int *missed, int *duped, | ||||
| #endif | ||||
| } | ||||
|  | ||||
| /// | ||||
| ///	Get decoder video stream size. | ||||
| /// | ||||
| ///	@param hw_decoder	video hardware decoder | ||||
| ///	@param[out] width	video stream width | ||||
| ///	@param[out] height	video stream height | ||||
| ///	@param[out] aspect_num	video stream aspect numerator | ||||
| ///	@param[out] aspect_den	video stream aspect denominator | ||||
| /// | ||||
| void VideoGetVideoSize(VideoHwDecoder * hw_decoder, int *width, int *height, | ||||
|     int *aspect_num, int *aspect_den) | ||||
| { | ||||
|     *width = 1920; | ||||
|     *height = 1080; | ||||
|     *aspect_num = 16; | ||||
|     *aspect_den = 9; | ||||
|     // FIXME: test to check if working, than make module function | ||||
| #ifdef USE_VDPAU | ||||
|     if (VideoUsedModule == &VdpauModule) { | ||||
| 	*width = hw_decoder->Vdpau.InputWidth; | ||||
| 	*height = hw_decoder->Vdpau.InputHeight; | ||||
| 	av_reduce(aspect_num, aspect_den, | ||||
| 	    hw_decoder->Vdpau.InputWidth * hw_decoder->Vdpau.InputAspect.num, | ||||
| 	    hw_decoder->Vdpau.InputHeight * hw_decoder->Vdpau.InputAspect.den, | ||||
| 	    1024 * 1024); | ||||
|     } | ||||
| #endif | ||||
| #ifdef USE_VAAPI | ||||
|     if (VideoUsedModule == &VaapiModule) { | ||||
| 	*width = hw_decoder->Vaapi.InputWidth; | ||||
| 	*height = hw_decoder->Vaapi.InputHeight; | ||||
| 	av_reduce(aspect_num, aspect_den, | ||||
| 	    hw_decoder->Vaapi.InputWidth * hw_decoder->Vaapi.InputAspect.num, | ||||
| 	    hw_decoder->Vaapi.InputHeight * hw_decoder->Vaapi.InputAspect.den, | ||||
| 	    1024 * 1024); | ||||
|     } | ||||
| #endif | ||||
|  | ||||
| } | ||||
|  | ||||
| #ifdef USE_SCREENSAVER | ||||
|  | ||||
| //---------------------------------------------------------------------------- | ||||
|   | ||||
							
								
								
									
										3
									
								
								video.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								video.h
									
									
									
									
									
								
							| @@ -193,6 +193,9 @@ extern uint8_t *VideoGrabService(int *, int *, int *); | ||||
|     /// Get decoder statistics. | ||||
| extern void VideoGetStats(VideoHwDecoder *, int *, int *, int *, int *); | ||||
|  | ||||
|     /// Get video stream size | ||||
| extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *); | ||||
|  | ||||
| extern void VideoOsdInit(void);		///< Setup osd. | ||||
| extern void VideoOsdExit(void);		///< Cleanup osd. | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user