khronosfws/openmax_al/src/gst_adaptation/xamediarecorderadaptctx.h
changeset 25 6f7ceef7b1d1
parent 19 4a629bc82c5e
child 53 eabc8c503852
equal deleted inserted replaced
21:2ed61feeead6 25:6f7ceef7b1d1
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description: 
    14  * Description: Media Recoder Adaptation for GST Header
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 #ifndef XAMEDIARECORDERADAPTCTX_H_
    18 #ifndef XAMEDIARECORDERADAPTCTX_H_
    19 #define XAMEDIARECORDERADAPTCTX_H_
    19 #define XAMEDIARECORDERADAPTCTX_H_
    20 
    20 
    21 #include "xaadaptationgst.h"
    21 #include "xaadaptationgst.h"
    22 #include "xametadataadaptation.h"
    22 #include "xametadataadaptation.h"
    23 
    23 
    24 /* TYPEDEFS */
    24 /* TYPEDEFS */
    25 
    25 
    26 typedef struct XASnapshotItfVars_
    26 typedef struct XASnapshotItfVars_
    27 {
    27     {
    28 
    28 
    29     /*User variables*/
    29     /*User variables*/
    30     XAuint32        numpics;
    30     XAuint32 numpics;
    31     XAuint32        fps;
    31     XAuint32 fps;
    32     XAboolean       freeze;
    32     XAboolean freeze;
    33     gchar*          fnametemplate;
    33     gchar* fnametemplate;
    34     XADataSink*     xaSink;
    34     XADataSink* xaSink;
    35 
    35 
    36     /* internal variables */
    36     /* internal variables */
    37     gboolean        waitforbuffer;
    37     gboolean waitforbuffer;
    38     gboolean        parsenegotiated;
    38     gboolean parsenegotiated;
    39     XAuint32        numpicstaken;
    39     XAuint32 numpicstaken;
    40 
    40 
    41     GstBus*         ssbus;
    41     GstBus* ssbus;
    42     GstElement*     sspipeline;
    42     GstElement* sspipeline;
    43     GstElement*     ssbuffersrc;
    43     GstElement* ssbuffersrc;
    44     GstElement*     ssparser;
    44     GstElement* ssparser;
    45     GstElement*     ssscaler;
    45     GstElement* ssscaler;
    46     GstElement*     ssfilter;
    46     GstElement* ssfilter;
    47     GstElement*     ssencoder;
    47     GstElement* ssencoder;
    48     GstElement*     sstagger;
    48     GstElement* sstagger;
    49     GstElement*     sssink;
    49     GstElement* sssink;
    50     gulong          sighandler;
    50     gulong sighandler;
    51 
    51 
    52     GstBuffer*      snapshotbuffer;
    52     GstBuffer* snapshotbuffer;
    53 
    53 
    54 } XASnapshotItfVars;
    54     } XASnapshotItfVars;
    55 
    55 
    56 /* context to track buffer insufficient event */
    56 /* context to track buffer insufficient event */
    57 typedef struct recordItfCtx_{
    57 typedef struct recordItfCtx_
       
    58     {
    58     XAImplSemHandle bufInsufficientSem;
    59     XAImplSemHandle bufInsufficientSem;
    59     XAboolean buffer_insufficient;
    60     XAboolean buffer_insufficient;
    60 }recodtItfCtx;
    61     } recodtItfCtx;
    61 
    62 
    62 typedef struct XAMediaRecorderAdaptationCtx_ XAMediaRecorderAdaptationCtx;
    63 typedef struct XAMediaRecorderAdaptationCtx_ XAMediaRecorderAdaptationCtx;
    63 
    64 
    64 typedef struct XAMediaRecorderAdaptationCtx_
    65 typedef struct XAMediaRecorderAdaptationCtx_
    65 {
    66     {
    66     /* Parent*/
    67     /* Parent*/
    67     XAAdaptationGstCtx_ baseObj;
    68     XAAdaptationGstCtx_ baseObj;
    68 
    69 
    69     /* OMX-AL Variables */
    70     /* OMX-AL Variables */
    70     XADataSource            *xaAudioSource, *xaVideoSource;
    71     XADataSource *xaAudioSource, *xaVideoSource;
    71     XADataSink              *xaSink;
    72     XADataSink *xaSink;
    72     XAuint8                 recModes;
    73     XAuint8 recModes;
    73 
    74 
    74     /* GST elements */
    75     /* GST elements */
    75     GstElement              *datasink;
    76     GstElement *datasink;
    76     XAboolean               isobjsink;   /*is sink another XA object?*/
    77     XAboolean isobjsink; /*is sink another XA object?*/
    77     GstElement              *codecbin;
    78     GstElement *codecbin;
    78     GstElement              *audioppbin;
    79     GstElement *audioppbin;
    79     GstElement              *audiofilter;
    80     GstElement *audiofilter;
    80     GstElement              *videoppbin;
    81     GstElement *videoppbin;
    81     GstElement              *videofilter;
    82     GstElement *videofilter;
    82     GstElement              *videoextract;
    83     GstElement *videoextract;
    83     GstElement              *audiosource;
    84     GstElement *audiosource;
    84     GstElement              *audioqueue;
    85     GstElement *audioqueue;
    85     XAboolean               isobjasrc;    /*is audio source another XA object?*/
    86     XAboolean isobjasrc; /*is audio source another XA object?*/
    86     GstElement              *videosource;
    87     GstElement *videosource;
    87     GstState                vsrcOrigState;
    88     GstState vsrcOrigState;
    88     GstElement              *videoqueue;
    89     GstElement *videoqueue;
    89     XAboolean               isobjvsrc;    /*is video source another XA object?*/
    90     XAboolean isobjvsrc; /*is video source another XA object?*/
    90     XAboolean               encodingchanged;
    91     XAboolean encodingchanged;
    91 
    92 
    92     XAboolean               mute;
    93     XAboolean mute;
    93     XAuint32                imageEffectID;
    94     XAuint32 imageEffectID;
    94     XAboolean               isStereoPosition;
    95     XAboolean isStereoPosition;
    95     XAuint32                xaRecordState;
    96     XAuint32 xaRecordState;
    96     XAmillidegree           curRotation;
    97     XAmillidegree curRotation;
    97     XAuint32                curMirror;
    98     XAuint32 curMirror;
    98     XAboolean               isRecord;
    99     XAboolean isRecord;
    99 
   100 
   100     /* internals */
   101     /* internals */
   101     XAboolean               trackpositionenabled;
   102     XAboolean trackpositionenabled;
   102     gboolean                runpositiontimer;
   103     gboolean runpositiontimer;
   103     GSourceFunc             positionCb;
   104     GSourceFunc positionCb;
   104 
   105 
   105     XAImplThreadHandle      recordingEventThr;
   106     XAImplThreadHandle recordingEventThr;
   106     recodtItfCtx            recThrCtx;
   107     recodtItfCtx recThrCtx;
   107 
       
   108 
   108 
   109     /* Variables for snapshot */
   109     /* Variables for snapshot */
   110     XASnapshotItfVars       snapshotVars;
   110     XASnapshotItfVars snapshotVars;
   111 
   111 
   112     XAMetadataAdaptVars     *metadatavars;
   112     XAMetadataAdaptVars *metadatavars;
   113 
   113 
   114     /* Variables for encoders */
   114     /* Variables for encoders */
   115     XAAudioEncoderSettings  audioEncSettings;
   115     XAAudioEncoderSettings audioEncSettings;
   116     XAVideoSettings         videoEncSettings;
   116     XAVideoSettings videoEncSettings;
   117     XAImageSettings         imageEncSettings;
   117     XAImageSettings imageEncSettings;
   118 
   118 
   119     /*buffersink variable*/
   119     /*buffersink variable*/
   120     guint64                 writepos;
   120     guint64 writepos;
   121 
   121 
   122 } XAMediaRecorderAdaptationCtx_;
   122     } XAMediaRecorderAdaptationCtx_;
   123 
   123 
   124 /* FUNCTIONS */
   124 /* FUNCTIONS */
   125 XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(  XADataSource* pAudioSrc, XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
   125 XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(XADataSource* pAudioSrc,
   126 XAresult XAMediaRecorderAdapt_PostInit( XAAdaptationGstCtx* bCtx );
   126         XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes);
   127 void XAMediaRecorderAdapt_Destroy( XAAdaptationGstCtx* bCtx );
   127 XAresult XAMediaRecorderAdapt_PostInit(XAAdaptationGstCtx* bCtx);
       
   128 void XAMediaRecorderAdapt_Destroy(XAAdaptationGstCtx* bCtx);
   128 /*XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx);*/
   129 /*XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx);*/
   129 XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx_* mCtx );
   130 XAresult XAMediaRecorderAdapt_ChangeEncoders(
   130 XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx, XACapsType encType, XAuint32 encoderId );
   131         XAMediaRecorderAdaptationCtx_* mCtx);
       
   132 XAresult XAMediaRecorderAdapt_CheckCodec(XAMediaRecorderAdaptationCtx_* mCtx,
       
   133         XACapsType encType, XAuint32 encoderId);
   131 
   134 
   132 void*  XAMediaRecorderAdapt_RecordEventThr(void* ctx);
   135 void* XAMediaRecorderAdapt_RecordEventThr(void* ctx);
   133 
   136 
   134 #endif /* XAMEDIARECORDERADAPTCTX_H_ */
   137 #endif /* XAMEDIARECORDERADAPTCTX_H_ */