mirror of
				https://github.com/RetroDECK/ES-DE.git
				synced 2025-04-10 19:15:13 +00:00 
			
		
		
		
	Added 'rotation' and 'rotationOrigin' properties to the video element
Also changed the 'interpolation' property to also apply to the video stream
This commit is contained in:
		
							parent
							
								
									fcc46148e9
								
							
						
					
					
						commit
						0e2571e8dd
					
				|  | @ -303,6 +303,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>> | |||
|        {"cropSize", NORMALIZED_PAIR}, | ||||
|        {"maxSize", NORMALIZED_PAIR}, | ||||
|        {"origin", NORMALIZED_PAIR}, | ||||
|        {"rotation", FLOAT}, | ||||
|        {"rotationOrigin", NORMALIZED_PAIR}, | ||||
|        {"stationary", STRING}, | ||||
|        {"path", PATH}, | ||||
|        {"default", PATH}, | ||||
|  |  | |||
|  | @ -45,6 +45,7 @@ VideoComponent::VideoComponent() | |||
|     , mPlayAudio {true} | ||||
|     , mDrawPillarboxes {true} | ||||
|     , mRenderScanlines {false} | ||||
|     , mLinearInterpolation {false} | ||||
|     , mHasVideo {false} | ||||
|     , mGeneralFade {false} | ||||
|     , mFadeIn {1.0f} | ||||
|  | @ -211,12 +212,17 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, | |||
|     if (elem->has("audio")) | ||||
|         mPlayAudio = elem->get<bool>("audio"); | ||||
| 
 | ||||
|     mStaticImage.setRotation(mRotation); | ||||
|     mStaticImage.setRotationOrigin(mRotationOrigin); | ||||
| 
 | ||||
|     if (elem->has("interpolation")) { | ||||
|         const std::string& interpolation {elem->get<std::string>("interpolation")}; | ||||
|         if (interpolation == "linear") { | ||||
|             mLinearInterpolation = true; | ||||
|             mStaticImage.setLinearInterpolation(true); | ||||
|         } | ||||
|         else if (interpolation == "nearest") { | ||||
|             mLinearInterpolation = false; | ||||
|             mStaticImage.setLinearInterpolation(false); | ||||
|         } | ||||
|         else { | ||||
|  |  | |||
|  | @ -136,6 +136,7 @@ protected: | |||
|     bool mPlayAudio; | ||||
|     bool mDrawPillarboxes; | ||||
|     bool mRenderScanlines; | ||||
|     bool mLinearInterpolation; | ||||
|     bool mHasVideo; | ||||
|     bool mGeneralFade; | ||||
|     float mFadeIn; | ||||
|  |  | |||
|  | @ -1363,6 +1363,7 @@ void VideoFFmpegComponent::startVideoStream() | |||
| 
 | ||||
|         // Get an empty texture for rendering the video.
 | ||||
|         mTexture = TextureResource::get(""); | ||||
|         mTexture->setLinearMagnify(mLinearInterpolation); | ||||
| 
 | ||||
|         // This is used for the audio and video synchronization.
 | ||||
|         mTimeReference = std::chrono::high_resolution_clock::now(); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Leon Styhre
						Leon Styhre