khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp
changeset 16 43d09473c595
parent 12 5a06f39ad45b
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    18 Media Helper Class for handling surface events
    18 Media Helper Class for handling surface events
    19 
    19 
    20 Shy Ward
    20 Shy Ward
    21 */
    21 */
    22 
    22 
    23 #include "XANGAVideoSink.h"
    23 #include "xangavideosink.h"
    24 #include "openmaxalwrapper.h"
    24 #include "openmaxalwrapper.h"
    25 
    25 
    26 
    26 
    27 CNgaVideoSink* CNgaVideoSink::NewL()
    27 CNgaVideoSink* CNgaVideoSink::NewL()
    28 {
    28 {
    31 	return self;
    31 	return self;
    32 }
    32 }
    33 
    33 
    34 CNgaVideoSink::~CNgaVideoSink()
    34 CNgaVideoSink::~CNgaVideoSink()
    35 {
    35 {
    36 	iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
    36     RemoveWindow();
    37 	delete iMediaClientVideoDisplay;
    37     
    38   if(IsActive())
    38     delete iMediaClientVideoDisplay;
    39   {
    39     if(IsActive())
    40      Cancel();
    40     {
    41   }	
    41     Cancel();
       
    42     }	
    42 }
    43 }
    43     
    44     
       
    45 void CNgaVideoSink::RemoveWindow()
       
    46     {
       
    47     iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
       
    48     }
       
    49 
    44 CNgaVideoSink::CNgaVideoSink()
    50 CNgaVideoSink::CNgaVideoSink()
    45                   :CActive(EPriorityStandard)
    51                   :CActive(EPriorityStandard)
    46 {
    52 {
    47 	iMediaClientVideoDisplay = NULL;
    53 	iMediaClientVideoDisplay = NULL;
    48   CActiveScheduler::Add(this);
    54   CActiveScheduler::Add(this);
   131   m_clipRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
   137   m_clipRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
   132   m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
   138   m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
   133   m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
   139   m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
   134   
   140   
   135 
   141 
   136   iMediaClientVideoDisplay->AddDisplayWindowL(m_pWindow, m_clipRect, m_cropRegion, m_videoExtent, m_scaleWidth, m_scaleHeight,
   142   TRAPD(err, iMediaClientVideoDisplay->AddDisplayWindowL(m_pWindow, m_clipRect, m_cropRegion, m_videoExtent, m_scaleWidth, m_scaleHeight,
   137                                                m_rotation, EAutoScaleBestFit, m_horizPos, m_vertPos, m_pWindow);  
   143                                                m_rotation, EAutoScaleBestFit, m_horizPos, m_vertPos, m_pWindow));  
   138 
   144 
   139 }
   145 }
   140 
   146 
   141 extern "C" {
   147 extern "C" {
   142 
   148