Home | History | Annotate | Download | only in single_core
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /**
     19  * @file pvaetestinput.h
     20  * @brief Test input to PVAuthorEngine unit test, using single core encoders
     21  */
     22 
     23 #ifndef PVAETESTINPUT_H_INCLUDED
     24 #define PVAETESTINPUT_H_INCLUDED
     25 
     26 #ifndef OSCL_BASE_H_INCLUDED
     27 #include "oscl_base.h"
     28 #endif
     29 #ifndef PVLOGGER_H_INCLUDED
     30 #include "pvlogger.h"
     31 #endif
     32 #ifndef PVMI_MIO_CONTROL_H_INCLUDED
     33 #include "pvmi_mio_control.h"
     34 #endif
     35 #ifndef OSCL_STRING_H_INCLUDED
     36 #include "oscl_string.h"
     37 #endif
     38 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED
     39 #include "oscl_string_containers.h"
     40 #endif
     41 #ifndef PVMI_MIO_FILEINPUT_FACTORY_H_INCLUDED
     42 #include "pvmi_mio_fileinput_factory.h"
     43 #endif
     44 
     45 // Forward declarations
     46 class PVMFNodeInterface;
     47 class PVInterface;
     48 
     49 
     50 class AVTConfig
     51 {
     52     public:
     53         AVTConfig()
     54         {
     55             iWidth = 0;
     56             iHeight = 0;
     57             iFps = 0;
     58             iFrameInterval = 0;
     59             iSamplingRate = 0;
     60             iNumChannels = 0;
     61             iLoopingEnable = false;
     62 
     63         };
     64 
     65         ~AVTConfig()
     66         {
     67             iWidth = 0;
     68             iHeight = 0;
     69             iFps = 0;
     70             iFrameInterval = 0;
     71             iSamplingRate = 0;
     72             iNumChannels = 0;
     73             iLoopingEnable = false;
     74 
     75         };
     76 
     77         AVTConfig(AVTConfig& arATVConfig)
     78         {
     79             iWidth = arATVConfig.iWidth;
     80             iHeight = arATVConfig.iHeight;
     81             iFps = arATVConfig.iFps;
     82             iFrameInterval = arATVConfig.iFrameInterval;
     83             iSamplingRate = arATVConfig.iSamplingRate;
     84             iNumChannels = arATVConfig.iNumChannels;
     85             iTextLogFile = arATVConfig.iTextLogFile;
     86             iTextConfigFile = arATVConfig.iTextConfigFile;
     87             iLoopingEnable = arATVConfig.iLoopingEnable;
     88 
     89         }
     90 
     91         int iWidth;
     92         int iHeight;
     93         OsclFloat iFps;
     94         int iFrameInterval;
     95         int iSamplingRate;
     96         int iNumChannels;
     97         OSCL_HeapString<OsclMemAllocator> iTextLogFile;
     98         OSCL_HeapString<OsclMemAllocator> iTextConfigFile;
     99         bool iLoopingEnable;
    100 };
    101 
    102 /** Enumerated list of test input types */
    103 typedef enum
    104 {
    105     INVALID_INPUT_TYPE = 0
    106     , YUV_FILE
    107     , M4V_FILE
    108     , H263_FILE
    109     , H264_FILE
    110     , AMR_IETF_FILE
    111     , AAC_ADIF_FILE
    112     , AAC_ADTS_FILE
    113     , PCM16_FILE
    114     , SYMBIAN_DEV_SOUND
    115     , YUV_WRONG_FILE //just introduced for error handling scenarios
    116     , TEXT_FILE
    117     , AMRWB_IETF_FILE
    118 } PVAETestInputType;
    119 
    120 #define ARRAY_SIZE  512
    121 
    122 ////////////////////////////////////////////////////////////////////////////
    123 class PVAETestInput
    124 {
    125     public:
    126         /** Default contructor */
    127         PVAETestInput();
    128 
    129         /** Default destructor */
    130         ~PVAETestInput() {};
    131 
    132         /**
    133          * Copy constructor
    134          * @param aInput Source object
    135          */
    136         PVAETestInput(const PVAETestInput& aInput);
    137 
    138         /**
    139          * Overloaded = operator
    140          * @param aInput Source object
    141          * @return Reference to this object with values copied from the source object
    142          */
    143         PVAETestInput& operator=(const PVAETestInput& aInput);
    144 
    145         /**
    146          * Query whether the specified input type is supported
    147          *
    148          * @param aType Input type to be supported
    149          * @return True if input type is supported, else false
    150          */
    151         bool IsTestInputTypeSupported(PVAETestInputType aType);
    152 
    153         /**
    154          * Creates an input node of the specified type.  DeleteInputNode() will need to
    155          * be called to deallocate the input node.  The default contructor will not
    156          * delete the input node created by this method.
    157          *
    158          * @param aType Type of input node to create
    159          * @return True for success, else false
    160          */
    161         int CreateInputNode(PVAETestInputType aType, const OSCL_wString& aFileName, AVTConfig iAVTConfig);
    162 
    163         /**
    164          * Deletes the input node contained by this object
    165          * @return True for success, else false
    166          */
    167         bool DeleteInputNode();
    168 
    169         PVMFNodeInterface* iNode; /** Input node */
    170         PVAETestInputType iType; /** Input type */
    171         PvmiMIOFileInputSettings iSettings; /**  settings data */
    172         Oscl_Vector<PVInterface*, OsclMemAllocator> iExtensions; /** Vector of extensions to the input node */
    173         // Media input module
    174         PvmiMIOControl* iMediaInput;
    175         uint32 iDuration;
    176 
    177     private:
    178         /**
    179          * Copy data from source object to this object
    180          * @param aInput Source object
    181          */
    182         void Copy(const PVAETestInput& aInput);
    183 
    184         /**
    185          * Creates PVMFFileInputNode of the specified type
    186          *
    187          * @param aType Type of test input
    188          * @return True for success, else false
    189          */
    190         bool CreateFileInputNode(PVAETestInputType aType);
    191 
    192         /**
    193          * Creates the MediaIO module object using its factory::create call and
    194          * also creates PVMediaIONode for it
    195          *
    196          * @param aType Type of test input
    197          * @return True for success, else false
    198          */
    199         bool CreateMIOInputNode(PVAETestInputType aType, const OSCL_wString& aFileName, AVTConfig iAVTConfig);
    200 
    201         PVLogger* iLogger; /** Logger object */
    202 };
    203 
    204 #endif // PVAETESTINPUT_H_INCLUDED
    205 
    206 
    207 
    208