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

📄 decoder.h

📁 这是DVD中伺服部分的核心代码
💻 H
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  Copyright (c) 2006 Videon Central, Inc.                                 **
**  All rights reserved.                                                    **
**                                                                          **
**  The computer program contained herein contains proprietary information  **
**  which is the property of Videon Central, Inc.  The program may be used  **
**  and/or copied only with the written permission of Videon Central, Inc.  **
**  or in accordance with the terms and conditions stipulated in the        **
**  agreement/contract under which the programs have been supplied.         **
**                                                                          **
******************************************************************************
*****************************************************************************/
/**
 * @file decoder.h
 *
 * $Revision: 1.20 $ 
 *
 * Decoder base class - provides a decoder API and decoder event notification
 * services
 *
 */


#ifndef __DECODER_H
#define __DECODER_H

#include "mutex.h"
#include "reference_counter.h"
#include "decoder_types.h"
#include "error.h"
#include "vdvd_types.h"
#include "pe_app.h"



/********************************************************************************
                                    CONSTANTS
 ********************************************************************************/

#define     DECODER_EVENT_NOTIFICATION_TABLE_SIZE       25

#define     DECODER_IGNORE_START_TIME                   0
#define     DECODER_IGNORE_STOP_TIME                    0xffffffff






/********************************************************************************
                                    DATA TYPES
 ********************************************************************************/

    typedef enum tagDECODER_ID_TYPE
    {
        DECODER_ID_PRIMARY      = 1,
        DECODER_ID_SECONDARY    = 2,

        DECODER_ID_INVALID      = -1

    } DECODER_ID_TYPE;
 

    typedef struct tagDECODER_EVENT_NOTIFICATION_TABLE_ENTRY
    {
        DECODE_EVENT_TYPE           eventType;
        DECODE_NOTIFY_WAIT_TYPE     notifyType;
        uint32                      notifyRequestTime;

    } DECODER_EVENT_NOTIFICATION_TABLE_ENTRY;





    class Decoder;

    typedef void (*DECODE_NOTIFY_CALLBACK)(Decoder* decoder, DECODE_EVENT_TYPE event, void* eventData, void* context );





/********************************************************************************
                             Decoder class
 ********************************************************************************/


    class Decoder : public ReferenceChecker
    {
        private:

            DECODE_NOTIFY_CALLBACK                      m_notifyCallback;
            void*                                       m_notifyCallbackContext;
            DECODER_EVENT_NOTIFICATION_TABLE_ENTRY      m_eventNotificationTable[DECODER_EVENT_NOTIFICATION_TABLE_SIZE];
            uint32                                      m_eventNotificationTableSize;

        protected:

            Mutex                                       m_mutex;
            const char*                                 m_decoderName;

        public:


                                    Decoder                 ( void );

            virtual VDVD_ERROR      Create                  ( const char* decoderName );
            virtual VDVD_ERROR      Destroy                 ( void );

            virtual VDVD_ERROR      Setup                   ( DECODER_SETTINGS_TYPE* settings )=0;
            virtual VDVD_ERROR      Flush                   ( DECODER_TYPE decoderType, DECODE_FLUSH_MODE flushMode )=0;
            virtual VDVD_ERROR      SetPlayRate             ( PE_ISTREAMCTRL_PLAYRATE* playRate )=0;
            virtual VDVD_ERROR      Stop                    ( BOOLEAN holdPicture )=0;
            virtual VDVD_ERROR      Pause                   ( void )=0;
            virtual VDVD_ERROR      Resume                  ( void )=0;
            virtual VDVD_ERROR      SendData                ( void* buffer, uint32 bufferSize )=0;
            virtual VDVD_ERROR      ProcessEndOfStream      ( void )=0;

                    VDVD_ERROR      SetNotifyCallback       ( DECODE_NOTIFY_CALLBACK notifyCallback, void* notifyCallbackContext );
            virtual VDVD_ERROR      Notify                  ( DECODE_EVENT_TYPE eventType );
            virtual VDVD_ERROR      RequestNotification     ( DECODE_EVENT_TYPE decodeEventType, DECODE_NOTIFY_WAIT_TYPE decodeNotifyWaitType );
            
            virtual VDVD_ERROR      GetStatus               ( DECODE_STATUS_TYPE* status )=0;
            virtual VDVD_ERROR      SelectVideoStream       ( DECODE_VIDEO_PARAMETERS* parameters )=0;
            virtual VDVD_ERROR      SelectAudioStream       ( DECODE_AUDIO_PARAMETERS* parameters )=0;
    };






/********************************************************************************
                             Decoder API Declarations
 ********************************************************************************/

const char*     DecodeEventTypeName     ( DECODE_EVENT_TYPE decodeEventType );
const char*     DecodeNotifyWaitTypeName( DECODE_NOTIFY_WAIT_TYPE decodeNotifyWaitType );


VDVD_ERROR      GetDecoder              ( DECODER_ID_TYPE decoderId, Decoder** ppDecoder );




#endif


⌨️ 快捷键说明

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