15 * in graphics surface based displays for Helix engine. |
15 * in graphics surface based displays for Helix engine. |
16 * |
16 * |
17 */ |
17 */ |
18 |
18 |
19 // Include Files |
19 // Include Files |
|
20 #include <AccMonitorInfo.h> |
|
21 #include <AccMonitorCapabilities.h> |
20 #include "jdebug.h" |
22 #include "jdebug.h" |
21 #include "cmmasurfacewindow.h" |
23 #include "cmmasurfacewindow.h" |
22 #include "cmmaplayer.h" |
24 #include "cmmaplayer.h" |
23 |
25 |
24 // Used for iDisplay member |
26 // Used for iDisplay member |
25 #include "mmmadisplay.h" |
27 #include "mmmadisplay.h" |
26 |
28 |
27 CMMASurfaceWindow* CMMASurfaceWindow::NewL( |
29 EXPORT_C CMMASurfaceWindow* CMMASurfaceWindow::NewL( |
28 CMMAEventSource* aEventSource, |
30 CMMAEventSource* aEventSource, |
29 CMMAPlayer* aPlayer) |
31 CMMAPlayer* aPlayer, |
|
32 TBool aAVCableConnStatus) |
30 { |
33 { |
31 CMMASurfaceWindow* self = |
34 CMMASurfaceWindow* self = |
32 new(ELeave) CMMASurfaceWindow(aEventSource, |
35 new(ELeave) CMMASurfaceWindow(aEventSource, |
33 aPlayer); |
36 aPlayer, |
|
37 aAVCableConnStatus); |
34 return self; |
38 return self; |
35 } |
39 } |
36 |
40 |
37 // Destructor (virtual by CBase) |
41 // Destructor (virtual by CBase) |
38 CMMASurfaceWindow::~CMMASurfaceWindow() |
42 CMMASurfaceWindow::~CMMASurfaceWindow() |
44 // event from UI to be received by MUiEventConsumer. |
48 // event from UI to be received by MUiEventConsumer. |
45 } |
49 } |
46 |
50 |
47 CMMASurfaceWindow::CMMASurfaceWindow( |
51 CMMASurfaceWindow::CMMASurfaceWindow( |
48 CMMAEventSource* aEventSource, |
52 CMMAEventSource* aEventSource, |
49 CMMAPlayer* aPlayer): |
53 CMMAPlayer* aPlayer, |
|
54 TBool aAVCableConnStatus): |
50 iEventSource(aEventSource), |
55 iEventSource(aEventSource), |
51 iPlayer(aPlayer), |
56 iPlayer(aPlayer), |
52 iVideoDisplayInitState(EUIResourcesAndSurfaceParametersNotSet) |
57 iVideoDisplayInitState(EUIResourcesAndSurfaceParametersNotSet), |
|
58 iAVCableConnected(aAVCableConnStatus) |
53 { |
59 { |
54 // Empty rect until video size is known |
60 // Empty rect until video size is known |
55 iContentRect.SetRect(0, 0, 0, 0); |
61 iContentRect.SetRect(0, 0, 0, 0); |
56 iParentRect.SetRect(0, 0, 0, 0); |
62 iParentRect.SetRect(0, 0, 0, 0); |
57 iRWindowRect.SetRect(0, 0, 0, 0); |
63 iRWindowRect.SetRect(0, 0, 0, 0); |
118 TInt CMMASurfaceWindow::SetClipRect() |
124 TInt CMMASurfaceWindow::SetClipRect() |
119 { |
125 { |
120 DEBUG("MID::CMMASurfaceWindow::SetClipRect"); |
126 DEBUG("MID::CMMASurfaceWindow::SetClipRect"); |
121 |
127 |
122 // CMediaClientVideoDisplay expects client to RemoveDisplayWindow |
128 // CMediaClientVideoDisplay expects client to RemoveDisplayWindow |
123 // and AddDisplayWindow again everytime when RWindow rect changes |
129 // and AddDisplayWindow again everytime when RWindow rect changes. |
124 if (iMediaClientVideoDisplay && iWindow) |
130 // If audio/video cable is connected do not reposition the video, |
|
131 // this is done to prevent video playback pause. |
|
132 if (iMediaClientVideoDisplay && iWindow && !iAVCableConnected) |
125 { |
133 { |
126 iMediaClientVideoDisplay->RemoveDisplayWindow(*iWindow); |
134 iMediaClientVideoDisplay->RemoveDisplayWindow(*iWindow); |
127 |
135 |
128 TRect contentRect; |
136 TRect contentRect; |
129 if (iVisible) |
137 if (iVisible) |
459 } |
467 } |
460 break; |
468 break; |
461 } |
469 } |
462 } |
470 } |
463 |
471 |
464 void CMMASurfaceWindow::SetSurfaceParameters(const TSurfaceId& aSurfaceId, |
472 EXPORT_C void CMMASurfaceWindow::SetSurfaceParameters(const TSurfaceId& aSurfaceId, |
465 const TRect& aCropRect, |
473 const TRect& aCropRect, |
466 const TVideoAspectRatio& aPixelAspectRatio) |
474 const TVideoAspectRatio& aPixelAspectRatio) |
467 { |
475 { |
468 iSurfaceId = aSurfaceId; |
476 iSurfaceId = aSurfaceId; |
469 iCropRect = aCropRect; |
477 iCropRect = aCropRect; |
508 { |
516 { |
509 iDisplay->UIGetCallback(*this, CMMASurfaceWindow::EInitVideoDisplay); |
517 iDisplay->UIGetCallback(*this, CMMASurfaceWindow::EInitVideoDisplay); |
510 } |
518 } |
511 } |
519 } |
512 |
520 |
513 void CMMASurfaceWindow::SetChangedSurfaceParameters(const TSurfaceId& aSurfaceId, |
521 EXPORT_C void CMMASurfaceWindow::SetChangedSurfaceParameters(const TSurfaceId& aSurfaceId, |
514 const TRect& aCropRect, |
522 const TRect& aCropRect, |
515 const TVideoAspectRatio& aPixelAspectRatio) |
523 const TVideoAspectRatio& aPixelAspectRatio) |
516 { |
524 { |
517 iSurfaceId = aSurfaceId; |
525 iSurfaceId = aSurfaceId; |
518 iCropRect = aCropRect; |
526 iCropRect = aCropRect; |
522 { |
530 { |
523 iDisplay->UIGetCallback(*this, CMMASurfaceWindow::ESetChangedSurfaceParameters); |
531 iDisplay->UIGetCallback(*this, CMMASurfaceWindow::ESetChangedSurfaceParameters); |
524 } |
532 } |
525 } |
533 } |
526 |
534 |
527 void CMMASurfaceWindow::RemoveSurface() |
535 EXPORT_C void CMMASurfaceWindow::RemoveSurface() |
528 { |
536 { |
529 if (iDisplay) |
537 if (iDisplay) |
530 { |
538 { |
531 iDisplay->UIGetCallback(*this, |
539 iDisplay->UIGetCallback(*this, |
532 CMMASurfaceWindow::ERemoveSurface); |
540 CMMASurfaceWindow::ERemoveSurface); |