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: MMF Adaptation Context |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <assert.h> |
|
19 #include <string.h> |
|
20 #include "xaadaptationmmf.h" |
|
21 #include "xaadaptationmmf.h" |
|
22 #include "xaobjectitf.h" |
|
23 #include "xamediaplayeradaptctxmmf.h" |
|
24 |
|
25 /* |
|
26 * XAAdaptationBaseCtx* XAAdaptationBase_Create() |
|
27 * 1st phase initialization function for Adaptation Base context structure. |
|
28 * Reserves memory for base context and initializes GStreamer FW. |
|
29 */ |
|
30 XAresult XAAdaptationBaseMMF_Init(XAAdaptationMMFCtx* pSelf, XAuint32 ctxId) |
|
31 { |
|
32 DEBUG_API("->XAAdaptationBase_Init"); |
|
33 |
|
34 if (pSelf) |
|
35 { |
|
36 if (XAAdaptationBase_Init(&(pSelf->baseObj), ctxId) |
|
37 != XA_RESULT_SUCCESS) |
|
38 { |
|
39 DEBUG_ERR("Failed to init base context!!!"); |
|
40 free(pSelf); |
|
41 pSelf = NULL; |
|
42 DEBUG_API("<-XAAdaptationBase_Init"); |
|
43 return XA_RESULT_MEMORY_FAILURE; |
|
44 } |
|
45 } |
|
46 else |
|
47 { |
|
48 DEBUG_ERR("Invalid Adaptation Base Context.") |
|
49 return XA_RESULT_PARAMETER_INVALID; |
|
50 } |
|
51 |
|
52 DEBUG_API("<-XAAdaptationBase_Init"); |
|
53 return XA_RESULT_SUCCESS; |
|
54 } |
|
55 |
|
56 /* |
|
57 * XAresult XAAdaptationBase_PostInit() |
|
58 * 2nd phase initialization for Adaptation Base. |
|
59 */ |
|
60 XAresult XAAdaptationBaseMMF_PostInit(XAAdaptationMMFCtx* ctx) |
|
61 { |
|
62 XAresult ret = XA_RESULT_SUCCESS; |
|
63 DEBUG_API("->XAAdaptationBase_PostInit"); |
|
64 if(ctx) |
|
65 { |
|
66 ret = XAAdaptationBase_PostInit(&ctx->baseObj); |
|
67 } |
|
68 else |
|
69 { |
|
70 ret = XA_RESULT_PARAMETER_INVALID; |
|
71 } |
|
72 DEBUG_API("<-XAAdaptationBase_PostInit"); |
|
73 return ret; |
|
74 } |
|
75 |
|
76 /* |
|
77 * void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx ) |
|
78 * Frees all Base context variables . |
|
79 */ |
|
80 void XAAdaptationBaseMMF_Free(XAAdaptationMMFCtx* ctx) |
|
81 { |
|
82 DEBUG_API("->XAAdaptationBaseMMF_Free"); |
|
83 if(ctx) |
|
84 { |
|
85 XAAdaptationBase_Free(&ctx->baseObj); |
|
86 } |
|
87 DEBUG_API("<-XAAdaptationBaseMMF_Free"); |
|
88 } |
|
89 |
|