khronosfws/openmax_al/src/mmf_adaptation/xaseekitfadaptationmmf.c
changeset 16 43d09473c595
child 25 6f7ceef7b1d1
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 #include "unistd.h"
       
    19 #include "xamediaplayeradaptctxmmf.h"
       
    20 #include "xaseekitfadaptationmmf.h"
       
    21 #include "cmmfbackendengine.h"
       
    22 #include <glib.h>
       
    23 
       
    24 /*
       
    25  * XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
       
    26  * Sets play state to GStreamer.
       
    27  * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
       
    28  * XAuint32 state - Play state to be set
       
    29  * @return XAresult ret - Success value
       
    30  */
       
    31 XAresult XASeekItfAdaptMMF_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode)
       
    32 {
       
    33     XAresult ret = XA_RESULT_SUCCESS;
       
    34     XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
       
    35 
       
    36     DEBUG_API("->XASeekItfAdaptMMF_SetPosition ");
       
    37     ret = mmf_seekitf_set_position(mCtx->mmfContext, pos);
       
    38     /* bCtx and parameter pointer validation happens in the calling function.
       
    39      * We don't need to repeat it here*/
       
    40 
       
    41     DEBUG_API("<-XASeekItfAdaptMMF_SetPosition");
       
    42     return ret;
       
    43 }
       
    44 
       
    45 XAresult XASeekItfAdaptMMF_SetLoop(XAAdaptationBaseCtx *bCtx, XAboolean loopEnable,
       
    46                                     XAmillisecond startPos, XAmillisecond endPos)
       
    47     {
       
    48         XAresult ret = XA_RESULT_SUCCESS;
       
    49         XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
       
    50 
       
    51         DEBUG_API("->XASeekItfAdaptMMF_SetLoop ");
       
    52 
       
    53         /* bCtx and parameter pointer validation happens in the calling function.
       
    54          * We don't need to repeat it here*/
       
    55         ret = mmf_seekitf_set_repeats(mCtx->mmfContext, loopEnable);
       
    56         
       
    57         ret = mmf_seekitf_set_playwindow(mCtx->mmfContext, startPos, endPos);
       
    58         
       
    59         
       
    60         
       
    61         DEBUG_API("<-XASeekItfAdaptMMF_SetLoop");
       
    62         return ret;
       
    63     }