khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
child 21 999b2818a0eb
equal deleted inserted replaced
19:095bea5f582e 20:0ac9a5310753
     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 #ifndef XAADAPTATIONMMF_H_
       
    19 #define XAADAPTATIONMMF_H_
       
    20 
       
    21 #include <pthread.h>
       
    22 #include <semaphore.h>
       
    23 #include <garray.h>
       
    24 #include <string.h>
       
    25 #include <unistd.h>
       
    26 #include "openmaxalwrapper.h"
       
    27 #include "xaglobals.h"
       
    28 #include "xaplatform.h"
       
    29 #include "xaadptbasectx.h"
       
    30 #ifdef XA_IMPL_MEASURE_GST_DELAY
       
    31 #include <time.h>
       
    32 #endif /* XA_IMPL_MEASURE_GST_DELAY */
       
    33 
       
    34 /* MACROS */
       
    35 #define FLIP_NONE               0
       
    36 #define FLIP_CLOCKWISE          1 /* Rotate clockwise 90 degrees */
       
    37 #define FLIP_ROTATE_180         2 /* Rotate 180 degrees */
       
    38 #define FLIP_COUNTERCLOCKWISE   3 /* Rotate counter-clockwise 90 degrees */
       
    39 #define FLIP_HORIZONTAL         4 /* Flip image horizontally */
       
    40 #define FLIP_VERTICAL           5 /* Flip image vertically */
       
    41 
       
    42 /* TYPEDEFS */
       
    43 
       
    44 #define CONTENT_PIPE_BUFFER_SIZE 1000
       
    45 #define TEST_VIDEO_WIDTH     640
       
    46 #define TEST_VIDEO_HEIGHT    480
       
    47 
       
    48 /* Forward declaration of adaptation basecontext */
       
    49 typedef struct XAAdaptationMMFCtx_ XAAdaptationMMFCtx;
       
    50 
       
    51 /*
       
    52  * Structure that holds all common variables for every
       
    53  * mmf-Adaptation context structures.
       
    54  */
       
    55 typedef struct XAAdaptationMMFCtx_
       
    56     {
       
    57     XAAdaptationBaseCtx baseObj;
       
    58 
       
    59     } XAAdaptationMMFCtx_;
       
    60 
       
    61 typedef struct XAEngineAdaptationMMFCtx_
       
    62     {
       
    63     /* Parent*/
       
    64     XAAdaptationMMFCtx_ baseObj;
       
    65 
       
    66     } XAEngineAdaptationMMFCtx_;
       
    67 
       
    68 /*
       
    69  * Structure for Media Player specific gst-adaptation.
       
    70  */
       
    71 typedef struct XAMediaPlayerAdaptationMMFCtx_
       
    72     {
       
    73     /* Parent*/
       
    74     XAAdaptationMMFCtx_ baseObj;
       
    75 
       
    76     /* OMX-AL Variables */
       
    77     XADataSource *xaSource, *xaBankSrc;
       
    78     XADataSink *xaAudioSink, *xaVideoSink, *xaLEDArray, *xaVibra;
       
    79 
       
    80     /* MMF elements */
       
    81     XAboolean isobjsrc; /*is source another XA object?*/
       
    82 
       
    83     XAboolean isobjasink; /*is audio sink another XA object?*/
       
    84     XAboolean isobjvsink; /*is video sink another XA object?*/
       
    85 
       
    86     XAboolean mute;
       
    87     XAuint32 premutevol;
       
    88     XAuint32 imageEffectID;
       
    89     XAboolean isStereoPosition;
       
    90     XAmillidegree curRotation;
       
    91     XAuint32 curMirror;
       
    92 
       
    93     XAint32 buffering;
       
    94     XAuint32 rateprops;
       
    95     XAint16 playrate;
       
    96     /* internals */
       
    97     XAboolean trackpositionenabled;
       
    98 
       
    99     XAboolean loopingenabled;
       
   100 
       
   101     XAboolean cameraSinkSynced;
       
   102     void* mmfContext;
       
   103     void* mmfMetadataContext;
       
   104     XAboolean isForRadio;
       
   105     /*
       
   106      XAuint32                playerState;
       
   107      */
       
   108 
       
   109     } XAMediaPlayerAdaptationMMFCtx_;
       
   110 
       
   111 typedef struct XAMetadataAdaptationMMFCtx_
       
   112     {
       
   113     /* Parent*/
       
   114     XAAdaptationMMFCtx_ baseObj;
       
   115 
       
   116     /* OMX-AL Variables */
       
   117     XADataSource *xaSource;
       
   118 
       
   119     void* mmfContext;
       
   120     } XAMetadataAdaptationMMFCtx_;
       
   121 
       
   122 /*
       
   123  * Structure for Radio specific variables
       
   124  */
       
   125 typedef struct XARadioAdaptationCtx_
       
   126     {
       
   127 
       
   128     /* Parent*/
       
   129     XAAdaptationMMFCtx_ baseObj;
       
   130     XAuint32 frequency;
       
   131     XAuint8 range;
       
   132 
       
   133     pthread_t emulationThread;
       
   134     pthread_t rdsEmulationThread;
       
   135 
       
   136     } XARadioAdaptationCtx_;
       
   137 /* FUNCTIONS */
       
   138 /*
       
   139  * gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data );
       
   140  * Default CallBack handler for gst-bus messages. This will be called if object specific callback is
       
   141  * not implemented.
       
   142  */
       
   143 
       
   144 XAresult XAAdaptationBaseMMF_Init(XAAdaptationMMFCtx* pSelf, XAuint32 ctxId);
       
   145 XAresult XAAdaptationBaseMMF_PostInit(XAAdaptationMMFCtx* ctx);
       
   146 void XAAdaptationBaseMMF_Free(XAAdaptationMMFCtx* ctx);
       
   147 
       
   148 #endif /* XAADAPTATIONMMF_H_ */