/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*----------------------------------------------------------------------------*/
/*! @file u_mfmtrecg.h 
 *  $RCSfile: $
 *  $Revision: #1 $
 *  $Date: 2015/11/10 $
 *  $Author: dtvbm11 $
 *  
 *  @par Description:
 *         This file exports all media format recognizer specific definitions and structures.
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*! @addtogroup groupMW_MUTIL_MFMTRECG
 *  @{ 
 */
/*----------------------------------------------------------------------------*/

#ifndef _U_MFMTRECG_H_
#define _U_MFMTRECG_H_

/*-----------------------------------------------------------------------------
                    include files
 ----------------------------------------------------------------------------*/
#ifndef __KERNEL__ 

#include "u_mm_common.h"

#else

#include "u_mm_common.h"

#endif
/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
 ----------------------------------------------------------------------------*/
#define MP3_RECOGNIZER_NAME "mp3 recognizer"    /**<        */
#define MP3_EXTENSION_NAME  "mp3"    /**<        */

/* This structure enumerates all types of the notification of MFMTRECG to AP. */
/*------------------------------------------------------------------*/
/*! @enum  MFMTRECG_NFY_EVENT_TYPE_T
 *  @brief Mfmtrecg notify event type.
 *  @code
 *  typedef enum
 *  {
 *      MFMTRECG_NFY_EVENT_RECGNIZE_DONE,
 *      MFMTRECG_NFY_EVENT_RECGNIZE_ERROR,
 *      MFMTRECG_NFY_EVENT_HANDLE_CLOSED
 *  }   MFMTRECG_NFY_EVENT_TYPE_T;
 *  @endcode
 *  @li@c  MFMTRECG_NFY_EVENT_RECGNIZE_DONE                      - Recognize done.
 *  @li@c  MFMTRECG_NFY_EVENT_RECGNIZE_ERROR                    - Recognize error.
 *  @li@c  MFMTRECG_NFY_EVENT_HANDLE_CLOSED                      - Handle closed.
 */
/*------------------------------------------------------------------*/
typedef enum
{
    MFMTRECG_NFY_EVENT_RECGNIZE_DONE,
    MFMTRECG_NFY_EVENT_RECGNIZE_ERROR,
    MFMTRECG_NFY_EVENT_HANDLE_CLOSED
}   MFMTRECG_NFY_EVENT_TYPE_T;


/************************************************************************/
/* Error code                                                           */
/************************************************************************/
#define MFMTRECGR_OK                        ((INT32)    0)    /**<        */
#define MFMTRECGR_INSUFFICIENT_BUFFER       ((INT32)   -1)    /**<        */
#define MFMTRECGR_FILE_OR_DIR_MISSING       ((INT32)   -2)    /**<        */
#define MFMTRECGR_INV_HANDLE                ((INT32)   -3)    /**<        */
#define MFMTRECGR_OUT_OF_HANDLE             ((INT32)   -4)    /**<        */
#define MFMTRECGR_OUT_OF_MEMORY             ((INT32)   -5)    /**<        */
#define MFMTRECGR_FCT_NOT_SUPPORT           ((INT32)   -6)    /**<        */
#define MFMTRECGR_NAME_EXIST                ((INT32)   -7)    /**<        */
#define MFMTRECGR_INV_ARG                   ((INT32)   -8)    /**<        */
#define MFMTRECGR_HANDLER_NOT_FOUND          ((INT32)   -9)    /**<        */
#define MFMTRECGR_INTERNAL_ERR              ((INT32)   -10)    /**<        */
#define MFMTRECGR_REENTRY_LOADING           ((INT32)   -11)    /**<        */
#define MFMTRECGR_INITIAL_ERR               ((INT32)   -12)    /**<        */
#define MFMTRECGR_MSG_Q_ERR                 ((INT32)   -13)    /**<        */
#define MFMTRECGR_FILE_ERR                  ((INT32)   -14)    /**<        */
#define MFMTRECGR_CLI_ERROR                 ((INT32)   -15)    /**<        */
#define MFMTRECGR_AUTOFREE_ERROR            ((INT32)   -16)    /**<        */
#define MFMTRECGR_ES_UNKNOWN_FMT            ((INT32)   -17)    /**< This error code is only for audio es and video es, if current file/memory is a known format, such as ogg .etc, but use es_mfmtrecg, will return this error code.*/

/*-----------------------------------------------------------------------------
                    functions declarations
 ----------------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/*! @brief Minfo notify function when infor parse finished.
 *  @param [in] e_event  - It identifies the event type of notification.
 *  @param [in] pv_data1  - Specify the notification data1 which is followed with the notification event. 
 *  @param [in] pv_data2  - Specify the notification data1 which is followed with the notification event. 
 *  @param [in] pv_tag  - The client data specified by the client when callback has been called, the callback function will send it again.
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*------------------------------------------------------------------*/
typedef VOID (*x_mfmtrecg_nfy_fct) (
                        MFMTRECG_NFY_EVENT_TYPE_T   e_event,  /* (I) it identifies the event type of notification. */
                        const VOID*                 pv_data1, /* (I) specify the notification data1 which is followed with the notification event. */
                        const VOID*                 pv_data2, /* (I) specify the notification data2 which is followed with the notification event. */
                        const VOID*                 pv_tag);  /* (I) The client data specified by the client when callback has been called, the callback function will send it again. */


/*----------------------------------------------------------------------------*/
/*! @} */                                             /* end of groupMW_MUTIL_MFMTRECG */
/*----------------------------------------------------------------------------*/

/*! @page pageMW_MUTIL_MFMTRECG Multi Media Format Recognizer
 *  @par
 *  @section secMW_MUTIL_MFMTRECG_1  1. Introduction
 *      This function is to get the media format of the specified file or memery.
 *  @par
 *  @section secMW_MUTIL_MFMTRECG_2  2. Concept
 *      It will check the media format by the extention first. If not found, it will check all the format.
 *  @par
 *  @section secMW_MUTIL_MFMTRECG_3  3. Brief Design
 *      The regular format will be first and then the others, such as video ES and audio ES. By this way, it will speed up the recognize process.
 *  @par
 *      @include mfmtrecg_sample_code.c
 *      
 */

#endif /* _U_MFMTRECG_H_ */


