⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hantrodecoderport.cpp

📁 freescale i.mx31 BSP CE5.0全部源码
💻 CPP
字号:
/*------------------------------------------------------------------------------
--                                                                            --
--       This software is confidential and proprietary and may be used        --
--        only as expressly authorized by a licensing agreement from          --
--                                                                            --
--                            Hantro Products Oy.                             --
--                                                                            --
--      In the event of publication, the following notice is applicable:      --
--                                                                            --
--                   (C) COPYRIGHT 2005 HANTRO PRODUCTS OY                    --
--                            ALL RIGHTS RESERVED                             --
--                                                                            --
--         The entire notice above must be reproduced on all copies.          --
--                                                                            --
--------------------------------------------------------------------------------
--
--  Description : Hantro MPEG-4/H.263 Video Decoder DirectX Media Object 
--
------------------------------------------------------------------------------*/


#include "MP4SwDecApi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*------------------------------------------------------------------------------

    Function name: MP4SwDecTrace

    Functional description: This function is used to write API traces to file.

    Inputs:     char *string    (pointer to input string)
    
    Outputs:    NONE
    
    Returns:    NONE

------------------------------------------------------------------------------*/
void MP4SwDecTrace(char *string)
{
    FILE *fp;

    fp = fopen("dec_api.trc", "at");

    if (!fp)
        return;

    fwrite(string, 1, strlen(string), fp);
    fwrite("\n", 1,1, fp);

    fclose(fp);
}

/*------------------------------------------------------------------------------

    Function name: MP4SwDecMalloc

    Functional description: Provides ANSI C "malloc" functionality for decoder.
                            

    Inputs:     unsigned int size   (size in bytes)
    
    Outputs:    NONE
    
    Returns:    pointer to allocated memory

------------------------------------------------------------------------------*/
void *MP4SwDecMalloc(unsigned int size)
{
    void *memPtr = (char*)malloc(size);
    
    return memPtr;
}

/*------------------------------------------------------------------------------

    Function name:  MP4SwDecFree

    Functional description: Provides ANSI C "free" functionality for decoder.

    Inputs:     void *ptr   (pointer to allocated memory)
    
    Outputs:    NONE
    
    Returns:    NONE

------------------------------------------------------------------------------*/
void MP4SwDecFree(void *ptr)
{
    if(ptr != NULL)
    {
        free(ptr);
    }
}

/*------------------------------------------------------------------------------

    Function name:  MP4SwDecMemset

    Functional description: Provides ANSI C "memset" functionality for decoder.

    Inputs:     void *ptr           (pointer to allocated memory)
                int c               (character to set)
                unsigned int size   (how many characters will be set)
    
    Outputs:    NONE
    
    Returns:    ptr

------------------------------------------------------------------------------*/
void *MP4SwDecMemset(void *ptr, int c, unsigned int size)
{
    void *rv = NULL;

    if (ptr != NULL)
    {
        rv = memset(ptr,c,size);
    }
    return rv;
}

/*------------------------------------------------------------------------------

    Function name:  MP4SwDecMemcpy

    Functional description: Provides ANSI C "memcpy" functionality for decoder.

    Inputs:     void *dest          (pointer to allocated memory)
                void *src           (character to set)
                unsigned int count  (how many characters will be set)
    
    Outputs:    NONE
    
    Returns:    

------------------------------------------------------------------------------*/
void MP4SwDecMemcpy(void *dest, void *src, unsigned int count)
{
	memcpy(dest, src, count);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -