summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/phonon/mmf')
-rw-r--r--src/3rdparty/phonon/mmf/defs.h2
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.cpp36
-rw-r--r--src/3rdparty/phonon/mmf/videoplayer.cpp20
3 files changed, 54 insertions, 4 deletions
diff --git a/src/3rdparty/phonon/mmf/defs.h b/src/3rdparty/phonon/mmf/defs.h
index 348a40f..e4e06e4 100644
--- a/src/3rdparty/phonon/mmf/defs.h
+++ b/src/3rdparty/phonon/mmf/defs.h
@@ -26,7 +26,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
// Defining this macro causes VideoOutput::paintEvent to write transparent
// alpha values directly into the backing store, rather than using QPainter
-//#define PHONON_MMF_DIRECT_WRITE_ALPHA
+#define PHONON_MMF_DIRECT_WRITE_ALPHA
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp
index d0f8707..58fa25d 100644
--- a/src/3rdparty/phonon/mmf/videooutput.cpp
+++ b/src/3rdparty/phonon/mmf/videooutput.cpp
@@ -29,12 +29,17 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QMoveEvent>
#include <QResizeEvent>
-// Required for implementation of transparentFill
+// Required for implementation of transparentFill (direct write to backing store)
#include <QtGui/private/qwidget_p.h>
#include <QtGui/private/qdrawhelper_p.h>
#include <QtGui/private/qwindowsurface_p.h>
#include <QImage>
+// Required for implementation of transparentFill (GC brush)
+#include <coecntrl.h>
+#include <w32std.h>
+#include <eikenv.h>
+
QT_BEGIN_NAMESPACE
@@ -140,11 +145,35 @@ void MMF::VideoOutput::transparentFill(const QVector<QRect>& rects)
{
TRACE_CONTEXT(VideoOutput::transparentFill, EVideoInternal);
TRACE_ENTRY_0();
+
+/*
+ // Graphics context brushing approach
+ RWindow *const window = static_cast<RWindow *>(winId()->DrawableWindow());
+ const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
+ CWindowGc& gc = CEikonEnv::Static()->SystemGc();
+ gc.Activate(*window);
+ gc.SetBrushColor(TRgb(255, 255, 255, 0));
+ gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+ gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+ window->Invalidate();
+ window->BeginRedraw();
+ gc.Clear();
+ window->EndRedraw();
+ gc.Deactivate();
+*/
+/*
+ // Direct draw into backing store approach (entire TLW)
QImage *image = window()->windowSurface()->buffer(window());
QRgb *data = reinterpret_cast<QRgb *>(image->bits());
const int row_stride = image->bytesPerLine() / 4;
+ const QRgb color =
+ //0xff0000ff // opaque blue
+ 0x000000ff // transparent blue
+ //0x00000000 // transparent black
+ ;
+
// Paint the entire surface
const int imageWidth = image->size().width();
const int imageHeight = image->size().height();
@@ -153,12 +182,13 @@ void MMF::VideoOutput::transparentFill(const QVector<QRect>& rects)
QRgb *ptr = row;
for(int x=0; x<imageWidth; ++x)
- *ptr++ = 0xff0000ff;
+ *ptr++ = color;
row += row_stride;
}
+*/
/*
- // Paint the specified regions
+ // Direct draw into backing store approach (specified regions)
for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
const QRect& rect = *it;
diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp
index e2c0b7d..cc56671 100644
--- a/src/3rdparty/phonon/mmf/videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer.cpp
@@ -30,6 +30,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "objectdump.h"
#endif
+#include <QtGui/private/qt_s60_p.h> // for QSymbianControl
+
QT_BEGIN_NAMESPACE
using namespace Phonon;
@@ -125,7 +127,9 @@ void MMF::VideoPlayer::doPlay()
updateMmfOutput();
}
+ TRAP_IGNORE(m_player->SetVolumeL(0)); // *** HACK ***
m_player->Play();
+ TRAP_IGNORE(m_player->SetVolumeL(0)); // *** HACK ***
}
void MMF::VideoPlayer::doPause()
@@ -402,11 +406,27 @@ void MMF::VideoPlayer::getNativeWindowSystemHandles()
VideoOutput& output = videoOutput();
CCoeControl* const control = output.winId();
+ // Inform control that it needs to brush rather than blit the backing store
+ QSymbianControl* const symbianControl = static_cast<QSymbianControl *>(control);
+ //symbianControl->setBlit(0xff00ff00); // opaque green
+ //symbianControl->setBlit(0x0000ff00); // transparent green
+ symbianControl->setBlit(0x00000000); // transparent black
+
CCoeEnv* const coeEnv = control->ControlEnv();
m_wsSession = &(coeEnv->WsSession());
m_screenDevice = coeEnv->ScreenDevice();
m_window = control->DrawableWindow();
+/*
+ // Set background window color
+ RWindow *const window = static_cast<RWindow *>(m_window);
+ const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
+ //const TInt err = window->SetTransparencyAlphaChannel();
+ //if (err == KErrNone)
+ window->SetBackgroundColor(TRgb(255, 0, 255, 255));
+ window->Invalidate(); // force a redraw
+*/
+
#ifdef _DEBUG
QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper);
dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs