19
|
1 |
/*
|
25
|
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: Media Recoder Adaptation for GST Header
|
|
15 |
*
|
|
16 |
*/
|
19
|
17 |
|
|
18 |
#ifndef XAMEDIARECORDERADAPTCTX_H_
|
|
19 |
#define XAMEDIARECORDERADAPTCTX_H_
|
|
20 |
|
|
21 |
#include "xaadaptationgst.h"
|
|
22 |
#include "xametadataadaptation.h"
|
|
23 |
|
|
24 |
/* TYPEDEFS */
|
|
25 |
|
|
26 |
typedef struct XASnapshotItfVars_
|
25
|
27 |
{
|
19
|
28 |
|
|
29 |
/*User variables*/
|
25
|
30 |
XAuint32 numpics;
|
|
31 |
XAuint32 fps;
|
|
32 |
XAboolean freeze;
|
|
33 |
gchar* fnametemplate;
|
|
34 |
XADataSink* xaSink;
|
19
|
35 |
|
|
36 |
/* internal variables */
|
25
|
37 |
gboolean waitforbuffer;
|
|
38 |
gboolean parsenegotiated;
|
|
39 |
XAuint32 numpicstaken;
|
19
|
40 |
|
25
|
41 |
GstBus* ssbus;
|
|
42 |
GstElement* sspipeline;
|
|
43 |
GstElement* ssbuffersrc;
|
|
44 |
GstElement* ssparser;
|
|
45 |
GstElement* ssscaler;
|
|
46 |
GstElement* ssfilter;
|
|
47 |
GstElement* ssencoder;
|
|
48 |
GstElement* sstagger;
|
|
49 |
GstElement* sssink;
|
|
50 |
gulong sighandler;
|
19
|
51 |
|
25
|
52 |
GstBuffer* snapshotbuffer;
|
19
|
53 |
|
25
|
54 |
} XASnapshotItfVars;
|
19
|
55 |
|
|
56 |
/* context to track buffer insufficient event */
|
25
|
57 |
typedef struct recordItfCtx_
|
|
58 |
{
|
19
|
59 |
XAImplSemHandle bufInsufficientSem;
|
|
60 |
XAboolean buffer_insufficient;
|
25
|
61 |
} recodtItfCtx;
|
19
|
62 |
|
|
63 |
typedef struct XAMediaRecorderAdaptationCtx_ XAMediaRecorderAdaptationCtx;
|
|
64 |
|
|
65 |
typedef struct XAMediaRecorderAdaptationCtx_
|
25
|
66 |
{
|
19
|
67 |
/* Parent*/
|
|
68 |
XAAdaptationGstCtx_ baseObj;
|
|
69 |
|
|
70 |
/* OMX-AL Variables */
|
25
|
71 |
XADataSource *xaAudioSource, *xaVideoSource;
|
|
72 |
XADataSink *xaSink;
|
|
73 |
XAuint8 recModes;
|
19
|
74 |
|
|
75 |
/* GST elements */
|
25
|
76 |
GstElement *datasink;
|
|
77 |
XAboolean isobjsink; /*is sink another XA object?*/
|
|
78 |
GstElement *codecbin;
|
|
79 |
GstElement *audioppbin;
|
|
80 |
GstElement *audiofilter;
|
|
81 |
GstElement *videoppbin;
|
|
82 |
GstElement *videofilter;
|
|
83 |
GstElement *videoextract;
|
|
84 |
GstElement *audiosource;
|
|
85 |
GstElement *audioqueue;
|
|
86 |
XAboolean isobjasrc; /*is audio source another XA object?*/
|
|
87 |
GstElement *videosource;
|
|
88 |
GstState vsrcOrigState;
|
|
89 |
GstElement *videoqueue;
|
|
90 |
XAboolean isobjvsrc; /*is video source another XA object?*/
|
|
91 |
XAboolean encodingchanged;
|
19
|
92 |
|
25
|
93 |
XAboolean mute;
|
|
94 |
XAuint32 imageEffectID;
|
|
95 |
XAboolean isStereoPosition;
|
|
96 |
XAuint32 xaRecordState;
|
|
97 |
XAmillidegree curRotation;
|
|
98 |
XAuint32 curMirror;
|
|
99 |
XAboolean isRecord;
|
19
|
100 |
|
|
101 |
/* internals */
|
25
|
102 |
XAboolean trackpositionenabled;
|
|
103 |
gboolean runpositiontimer;
|
|
104 |
GSourceFunc positionCb;
|
19
|
105 |
|
25
|
106 |
XAImplThreadHandle recordingEventThr;
|
|
107 |
recodtItfCtx recThrCtx;
|
19
|
108 |
|
|
109 |
/* Variables for snapshot */
|
25
|
110 |
XASnapshotItfVars snapshotVars;
|
19
|
111 |
|
25
|
112 |
XAMetadataAdaptVars *metadatavars;
|
19
|
113 |
|
|
114 |
/* Variables for encoders */
|
25
|
115 |
XAAudioEncoderSettings audioEncSettings;
|
|
116 |
XAVideoSettings videoEncSettings;
|
|
117 |
XAImageSettings imageEncSettings;
|
19
|
118 |
|
|
119 |
/*buffersink variable*/
|
25
|
120 |
guint64 writepos;
|
19
|
121 |
|
25
|
122 |
} XAMediaRecorderAdaptationCtx_;
|
19
|
123 |
|
|
124 |
/* FUNCTIONS */
|
25
|
125 |
XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(XADataSource* pAudioSrc,
|
|
126 |
XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes);
|
|
127 |
XAresult XAMediaRecorderAdapt_PostInit(XAAdaptationGstCtx* bCtx);
|
|
128 |
void XAMediaRecorderAdapt_Destroy(XAAdaptationGstCtx* bCtx);
|
19
|
129 |
/*XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx);*/
|
25
|
130 |
XAresult XAMediaRecorderAdapt_ChangeEncoders(
|
|
131 |
XAMediaRecorderAdaptationCtx_* mCtx);
|
|
132 |
XAresult XAMediaRecorderAdapt_CheckCodec(XAMediaRecorderAdaptationCtx_* mCtx,
|
|
133 |
XACapsType encType, XAuint32 encoderId);
|
19
|
134 |
|
25
|
135 |
void* XAMediaRecorderAdapt_RecordEventThr(void* ctx);
|
19
|
136 |
|
|
137 |
#endif /* XAMEDIARECORDERADAPTCTX_H_ */
|