aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2014-10-24 17:46:36 +0200
committerMemphiz <memphis@machzwo.de>2014-10-26 18:15:47 +0100
commitfa3a1802dd2ab68e459188f6199428dfebaf6b58 (patch)
tree51594b51fb9d0e6c54d1c0c2ac58c23c4cb40061
parent173af245c9af709b40cd840df8fbbed4b6f1edee (diff)
[ios] - fix the removed clamp for retina displays (need to fix the stride for some movies as it was done before)
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp66
1 files changed, 34 insertions, 32 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
index fc1cbc6a68..0dd24d5374 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
@@ -1530,38 +1530,40 @@ CDVDVideoCodecVideoToolBox::CreateVTSession(int width, int height, CMFormatDescr
OSStatus status;
#if defined(TARGET_DARWIN_IOS)
- // allow rendering without scaledown for all
- // retina devices (which have enough power to handle it)
- double scale = 0.0;
- //if (!DarwinHasRetina(scale))
- {
- // decoding, scaling and rendering above 1920 x 800 runs into
- // some bandwidth limit. detect and scale down to reduce
- // the bandwidth requirements.
- int width_clamp = 1920;
- if (!DarwinHasRetina(scale) && (width * height) > (1920 * 1080))
- width_clamp = 960;
-
- int new_width = CheckNP2(width);
- if (width != new_width)
- {
- // force picture width to power of two and scale up height
- // we do this because no GL_UNPACK_ROW_LENGTH in OpenGLES
- // and the CVPixelBufferPixel gets created using some
- // strange alignment when width is non-standard.
- double w_scaler = (double)new_width / width;
- width = new_width;
- height = height * w_scaler;
- }
- // scale output pictures down to 720p size for display
- if (width > width_clamp)
- {
- double w_scaler = (float)width_clamp / width;
- width = width_clamp;
- height = height * w_scaler;
- }
- }
- #endif
+ double scale = 0.0;
+
+ // decoding, scaling and rendering above 1920 x 800 runs into
+ // some bandwidth limit. detect and scale down to reduce
+ // the bandwidth requirements.
+ int width_clamp = 1280;
+ if ((width * height) > (1920 * 800))
+ width_clamp = 960;
+
+ // allow rendering without scaledown for all
+ // retina devices (which have enough power to handle it)
+ if (DarwinHasRetina(scale))
+ width_clamp = 1920;
+
+ int new_width = CheckNP2(width);
+ if (width != new_width)
+ {
+ // force picture width to power of two and scale up height
+ // we do this because no GL_UNPACK_ROW_LENGTH in OpenGLES
+ // and the CVPixelBufferPixel gets created using some
+ // strange alignment when width is non-standard.
+ double w_scaler = (double)new_width / width;
+ width = new_width;
+ height = height * w_scaler;
+ }
+
+ // scale output pictures down to 720p size for display
+ if (width > width_clamp)
+ {
+ double w_scaler = (float)width_clamp / width;
+ width = width_clamp;
+ height = height * w_scaler;
+ }
+#endif
destinationPixelBufferAttributes = CFDictionaryCreateMutable(
NULL, // CFAllocatorRef allocator
0, // CFIndex capacity