khronosfws/openmax_al/src/adaptation/xangavideosink.h
changeset 16 43d09473c595
parent 14 80975da52420
child 22 128eb6a32b84
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /*
       
    18 Media Helper Class for handling surface events
       
    19 
       
    20 Shy Ward
       
    21 */
       
    22 
       
    23 #ifndef XA_CNGAVIDEOSINK_H
       
    24 #define XA_CNGAVIDEOSINK_H
       
    25 
       
    26 #define ENABLE_GRAPHICS_SURFACE_INTEGRATION
       
    27 
       
    28 
       
    29 #ifdef __cplusplus
       
    30 
       
    31 #include <e32base.h>
       
    32 #ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
       
    33 #include <graphics/surface.h> //TSurfaceId
       
    34 #include <mmf/common/mmfvideo.h> //TVideoAspectRatio
       
    35 #include <mediaclientvideodisplay.h>
       
    36 #endif
       
    37 
       
    38 class CNgaVideoSink : public CBase,
       
    39                       public CActive
       
    40     {
       
    41 public:
       
    42 
       
    43     static CNgaVideoSink* NewL();
       
    44     ~CNgaVideoSink();
       
    45     void SurfaceCreated(int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
       
    46          							 int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);    
       
    47     void SetNativeDisplayInformation(void* display_info);
       
    48     
       
    49     // CActive methods
       
    50     virtual void RunL();
       
    51     virtual void DoCancel();
       
    52     void Activate();
       
    53 
       
    54     void CompleteRequest(TInt status = KErrNone);    
       
    55     
       
    56 private:
       
    57     CNgaVideoSink();
       
    58     void ConstructL();
       
    59     
       
    60     RThread     m_ThreadHandle;
       
    61     
       
    62     enum InitializeState
       
    63     {
       
    64         EInitializedReady = 0,
       
    65         EInitializedSuccess,
       
    66         EInitializedFailed,
       
    67     };
       
    68     
       
    69 #ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
       
    70     CMediaClientVideoDisplay* iMediaClientVideoDisplay;
       
    71     TSurfaceId surfaceId;
       
    72     TRect m_clipRect;
       
    73     TRect m_videoExtent;    
       
    74     TRect m_cropRegion;
       
    75     TVideoAspectRatio m_pixelAspectRatio;
       
    76     RWindow* m_pWindow;
       
    77     TRect m_cropRect;
       
    78     TSurfaceId m_surfaceId;
       
    79     InitializeState     m_MediaHelperInitialized;    
       
    80     TVideoRotation m_rotation;
       
    81     TReal32 m_scaleWidth;
       
    82     TReal32 m_scaleHeight;
       
    83     TInt m_horizPos;
       
    84     TInt m_vertPos;    
       
    85 
       
    86 #endif /*ENABLE_GRAPHICS_SURFACE_INTEGRATION*/    
       
    87     };
       
    88 #else  /* __cplusplus */
       
    89 
       
    90 
       
    91 extern void* nga_video_sink_init();
       
    92 
       
    93 extern void  surface_created(void* context,int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
       
    94                      									int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);
       
    95 extern void  setup_native_display(void* context, void* display_info);
       
    96 
       
    97 
       
    98 #endif /* __cplusplus */
       
    99 
       
   100 #endif /* XA_CNGAVIDEOSINK_H */