umc_h264_spl.h

来自「audio-video-codecs.rar语音编解码器」· C头文件 代码 · 共 102 行

H
102
字号
/*
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2003-2007 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __UMC_H264_SPLITTER_H__
#define __UMC_H264_SPLITTER_H__

#include "umc_defs.h"
#if defined (UMC_ENABLE_H264_SPLITTER)

#include "umc_structures.h"
#include "umc_media_data.h"
#include "umc_h264_au_stream.h"
#include "umc_h264_nalu_stream.h"

#include <memory>

namespace UMC
{
    /**
     * Imitates the splitter fucntionality
     */
    class H264AnnexBSplitter
    {
    public:

        H264AnnexBSplitter();
        ~H264AnnexBSplitter();

        /**
         * Initializes helper - opens the source file
         */
        Status Init(const vm_char * p_sFilename);
        /**
         * Closes the helper - closes the source file
         */
        Status Close();

        /**
         * Returns the next frame from the stream
         * @param p_iWidth, p_iHeight - the width and the height of the frame respectively
         * @remark in case there are no frames, returns UMC_ERR_END_OF_STREAM
         */
        Status GetNextVideoData(MediaData & p_Frame);

    protected:

        /**
         * Initializes internal state
         */
        void Init();

        /**
         * Loads the next chunk of the bytestream
         */
        virtual Status LoadByteData(MediaData & p_data);

        /**
         * Returns the next NALU from the bytestream
         */
        Status GetNALUData(MediaData & p_data);

        /**
         * Returns whether the NALU stream has more binary data to parse
         */
        bool HasMoreBinData();

    private:
        // The source file handle
        vm_file * m_fSource;
        // File buffer
        MediaData m_dataFile;

        enum
        {
            BUFFER_SIZE = 262144
        };

        // The buffer for the media data
        Ipp8u m_aFileBuffer[BUFFER_SIZE];

    protected:
        // nalu stream
        H264_NALU_Stream m_streamNALU;
        // au stream
        H264_AU_Stream m_streamAU;
        // Indicates wether we had sent all AU units
        bool m_bEndOfAUSeen;
        // Indicates weather the source file eof seen
        bool m_bEndOfSourceSeen;
    };
}

#endif // UMC_ENABLE_H264_SPLITTER
#endif //  __UMC_H264_HELPER_H__

⌨️ 快捷键说明

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