summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/mmf/utils.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp
index 107a36d..294a9a2 100644
--- a/src/3rdparty/phonon/mmf/utils.cpp
+++ b/src/3rdparty/phonon/mmf/utils.cpp
@@ -59,80 +59,80 @@ MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType)
struct TScreenInfo
{
- int width;
- int height;
- int bpp;
- const char* address;
- int initialOffset;
- int lineOffset;
- TDisplayMode displayMode;
+ int width;
+ int height;
+ int bpp;
+ const char* address;
+ int initialOffset;
+ int lineOffset;
+ TDisplayMode displayMode;
};
void getScreenInfoL(TScreenInfo& info)
{
- info.displayMode = CEikonEnv::Static()->ScreenDevice()->DisplayMode();
-
- // Then we must set these as the input parameter
- info.width = info.displayMode;
- info.height = info.displayMode;
- info.initialOffset = info.displayMode;
- info.lineOffset = info.displayMode;
- info.bpp = info.displayMode;
-
- User::LeaveIfError( HAL::Get(HALData::EDisplayXPixels, info.width) );
- User::LeaveIfError( HAL::Get(HALData::EDisplayYPixels, info.width) );
-
- int address;
- User::LeaveIfError( HAL::Get(HALData::EDisplayMemoryAddress, address) );
- info.address = reinterpret_cast<const char*>(address);
-
- User::LeaveIfError( HAL::Get(HALData::EDisplayOffsetToFirstPixel, info.initialOffset) );
-
- User::LeaveIfError( HAL::Get(HALData::EDisplayOffsetBetweenLines, info.lineOffset) );
-
- User::LeaveIfError( HAL::Get(HALData::EDisplayBitsPerPixel, info.bpp) );
+ info.displayMode = CEikonEnv::Static()->ScreenDevice()->DisplayMode();
+
+ // Then we must set these as the input parameter
+ info.width = info.displayMode;
+ info.height = info.displayMode;
+ info.initialOffset = info.displayMode;
+ info.lineOffset = info.displayMode;
+ info.bpp = info.displayMode;
+
+ User::LeaveIfError( HAL::Get(HALData::EDisplayXPixels, info.width) );
+ User::LeaveIfError( HAL::Get(HALData::EDisplayYPixels, info.width) );
+
+ int address;
+ User::LeaveIfError( HAL::Get(HALData::EDisplayMemoryAddress, address) );
+ info.address = reinterpret_cast<const char*>(address);
+
+ User::LeaveIfError( HAL::Get(HALData::EDisplayOffsetToFirstPixel, info.initialOffset) );
+
+ User::LeaveIfError( HAL::Get(HALData::EDisplayOffsetBetweenLines, info.lineOffset) );
+
+ User::LeaveIfError( HAL::Get(HALData::EDisplayBitsPerPixel, info.bpp) );
}
QColor MMF::Utils::getScreenPixel(const QPoint& pos)
{
- TScreenInfo info;
- TRAPD(err, getScreenInfoL(info));
- QColor pixel;
- if(err == KErrNone and pos.x() < info.width and pos.y() < info.height)
- {
- const int bytesPerPixel = info.bpp / 8;
- Q_ASSERT(bytesPerPixel >= 3);
-
- const int stride = (info.width * bytesPerPixel) + info.lineOffset;
-
- const char* ptr =
- info.address
- + info.initialOffset
- + pos.y() * stride
- + pos.x() * bytesPerPixel;
-
- // BGRA
- pixel.setBlue(*ptr++);
- pixel.setGreen(*ptr++);
- pixel.setRed(*ptr++);
-
- if(bytesPerPixel == 4)
- pixel.setAlpha(*ptr++);
- }
- return pixel;
+ TScreenInfo info;
+ TRAPD(err, getScreenInfoL(info));
+ QColor pixel;
+ if(err == KErrNone and pos.x() < info.width and pos.y() < info.height)
+ {
+ const int bytesPerPixel = info.bpp / 8;
+ Q_ASSERT(bytesPerPixel >= 3);
+
+ const int stride = (info.width * bytesPerPixel) + info.lineOffset;
+
+ const char* ptr =
+ info.address
+ + info.initialOffset
+ + pos.y() * stride
+ + pos.x() * bytesPerPixel;
+
+ // BGRA
+ pixel.setBlue(*ptr++);
+ pixel.setGreen(*ptr++);
+ pixel.setRed(*ptr++);
+
+ if(bytesPerPixel == 4)
+ pixel.setAlpha(*ptr++);
+ }
+ return pixel;
}
// Debugging: for debugging video visibility
-void MMF::Utils::dumpScreenPixelSample()
+void MMF::Utils::dumpScreenPixelSample()
{
for(int i=0; i<20; ++i) {
- const QPoint pos(i*10, i*10);
- const QColor pixel = Utils::getScreenPixel(pos);
- RDebug::Printf(
- "Phonon::MMF::Utils::dumpScreenPixelSample %d %d = %d %d %d %d",
- pos.x(), pos.y(), pixel.red(), pixel.green(), pixel.blue(), pixel.alpha()
- );
+ const QPoint pos(i*10, i*10);
+ const QColor pixel = Utils::getScreenPixel(pos);
+ RDebug::Printf(
+ "Phonon::MMF::Utils::dumpScreenPixelSample %d %d = %d %d %d %d",
+ pos.x(), pos.y(), pixel.red(), pixel.green(), pixel.blue(), pixel.alpha()
+ );
}
}