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

📄 directfb_stub.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  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 directfb_stub.cpp
 *
 * $Revision: 1.13 $ 
 *
 * DirectFB interface stub
 *
 */

#include "directfb_stub.h"
#include "dbgprint.h"

#define DEBUG_DIRECTFB_STUB     (DBG_ERROR)
#define DBG_ON(x)               (DEBUG_DIRECTFB_STUB >= x)



/*********************************************************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif


DFBResult   DirectFBErrorFatal( DFBResult result )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("DirectFBErrorFatal\n"));    

    return ( DFB_OK ); 
}


#ifdef __cplusplus
    }
#endif


struct IDirectFBDisplayLayer    g_DfbDisplayLayer;
struct IDirectFB                g_Dfb;
struct IDirectFB*               pDfb = &g_Dfb;




/*********************************************************************************************************************/


DFBResult   IDirectFBSurface::Release ( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Release\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::Flip ( IDirectFBSurface* thiz, const DFBRegion* region, DFBSurfaceFlipFlags flags )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Flip\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::GetPalette ( IDirectFBSurface* thiz, IDirectFBPalette** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::GetPalette\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::GetSize ( IDirectFBSurface* thiz, int* ret_width, int* ret_height )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::GetSize\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::FillRectangle ( IDirectFBSurface* thiz, int x, int y, int w, int h )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::FillRectangle\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::SetColorIndex ( IDirectFBSurface* thiz, unsigned int index )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::SetColorIndex\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBSurface::Clear ( IDirectFBSurface* thiz, unsigned char r, unsigned char g, unsigned char b, unsigned char a )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Clear\n"));    

    return ( DFB_OK );
}



DFBResult IDirectFBSurface::Blit ( IDirectFBSurface* thiz, IDirectFBSurface* source, const DFBRectangle* source_rect, int x, int y )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Clear\n"));    

    return ( DFB_OK );
}



DFBResult IDirectFBSurface::SetPalette ( IDirectFBSurface* thiz, IDirectFBPalette* palette)
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Clear\n"));    

    return ( DFB_OK );
}



DFBResult IDirectFBSurface::FillRectangles ( IDirectFBSurface* thiz, const DFBRectangle* rects, unsigned int num )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Clear\n"));    

    return ( DFB_OK );
}



DFBResult IDirectFBSurface::Lock ( IDirectFBSurface* thiz, DFBSurfaceLockFlags flags, void** ret_ptr, int* ret_pitch )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Lock\n"));    

    return ( DFB_OK );
}




DFBResult IDirectFBSurface::Unlock ( IDirectFBSurface* thiz  )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::Unlock\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFBSurface::SetFont( IDirectFBSurface* thiz, IDirectFBFont* font )
{

    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::SetFont\n"));    

    return ( DFB_OK );
}



DFBResult IDirectFBSurface::DrawString( IDirectFBSurface* thiz, const char* text, int bytes, int x, int y, DFBSurfaceTextFlags flags )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurface::DrawString\n"));    

    return ( DFB_OK );
}




/*********************************************************************************************************************/

IDirectFBDisplayLayer::IDirectFBDisplayLayer ( void )
{
}



DFBResult   IDirectFBDisplayLayer::Release ( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::Release\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetCooperativeLevel ( IDirectFBDisplayLayer* thiz, DFBDisplayLayerCooperativeLevel level )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetCooperativeLevel\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetBackgroundColor ( IDirectFBDisplayLayer* thiz, unsigned char r, unsigned char g, unsigned char b, unsigned char a  )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetBackgroundColor\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::GetConfiguration ( IDirectFBDisplayLayer* thiz, DFBDisplayLayerConfig* ret_config )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::GetConfiguration\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetConfiguration ( IDirectFBDisplayLayer* thiz, const DFBDisplayLayerConfig* ret_config )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetConfiguration\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::GetSurface ( IDirectFBDisplayLayer* thiz, IDirectFBSurface** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::GetSurface\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetSourceRectangle ( IDirectFBDisplayLayer* thiz, int x, int y, int width, int height )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetSourceRectangle\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetScreenLocation ( IDirectFBDisplayLayer* thiz, float x, float y, float width, float height )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetScreenLocation\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::SetLevel( IDirectFBDisplayLayer* thiz, int level )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::SetLevel\n"));   

    return ( DFB_OK );
}



DFBResult   IDirectFBDisplayLayer::GetLevel( IDirectFBDisplayLayer* thiz, int* ret_level )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBDisplayLayer::GetLevel\n")); 

    *ret_level = -1;

    return ( DFB_OK );
}



/*********************************************************************************************************************/



DFBResult   IDirectFBImageProvider::Release( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBImageProvider::Release\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBImageProvider::GetSurfaceDescription ( IDirectFBImageProvider* thiz, DFBSurfaceDescription* ret_dsc )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBImageProvider::GetSurfaceDescription\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBImageProvider::RenderTo( IDirectFBImageProvider* thiz, IDirectFBSurface* destination, const DFBRectangle* destination_rect )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBImageProvider::RenderTo\n"));    

    return ( DFB_OK );
}



/*********************************************************************************************************************/



DFBResult   IDirectFB::SetVideoMode ( struct IDirectFB* thiz, int width, int height, int bpp )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::SetVideoMode\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFB::GetDisplayLayer ( struct IDirectFB* thiz, DFBDisplayLayerID layer_id,  IDirectFBDisplayLayer   **ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::GetDisplayLayer\n"));    

    *ret_interface = &g_DfbDisplayLayer;

    return ( DFB_OK );
}



DFBResult   IDirectFB::CreateImageProvider ( struct IDirectFB* thiz, const char* filename, IDirectFBImageProvider  **ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::CreateImageProvider\n"));    

    return ( DFB_OK );
}


DFBResult   IDirectFB::CreateSurfaceManager  ( IDirectFB* thiz, unsigned int size, unsigned int minimum_page_size, DFBSurfaceManagerTypes type, IDirectFBSurfaceManager** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::CreateSurfaceManager\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFB::CreatePalette ( IDirectFB* thiz, const DFBPaletteDescription* desc, IDirectFBPalette** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::CreatePalette\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFB::CreateSurface ( IDirectFB* thiz, const DFBSurfaceDescription* desc, IDirectFBSurface** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::CreateSurface\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFB::CreateMemoryFont ( IDirectFB* thiz, const void* data, unsigned int length, const DFBFontDescription* desc, IDirectFBFont** ret_interface  )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFB::CreateMemoryFont\n"));    

    return ( DFB_OK );
}





/*********************************************************************************************************************/



DFBResult   IDirectFBPalette::Release( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBPalette::Release\n"));    

    return ( DFB_OK );
}



DFBResult   IDirectFBPalette::SetEntries  ( IDirectFBPalette* thiz, const DFBColor* entries, unsigned int num_entries, unsigned int offset )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBPalette::SetEntries\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFBPalette::GetEntries ( IDirectFBPalette* thiz, DFBColor* ret_entries, unsigned int num_entries, unsigned int offset )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBPalette::GetEntries\n"));    

    return ( DFB_OK );
}




/*********************************************************************************************************************/

DFBResult IDirectFBSurfaceManager::Release ( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurfaceManager::CreateSurface\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFBSurfaceManager::CreateSurface ( IDirectFBSurfaceManager* thiz, const DFBSurfaceDescription* desc, IDirectFBSurface** ret_interface )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBSurfaceManager::CreateSurface\n"));    

    return ( DFB_OK );
}


/*********************************************************************************************************************/

DFBResult IDirectFBFont::Release ( void* thiz )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBFont::Release\n"));    

    return ( DFB_OK );
}


DFBResult IDirectFBFont::GetStringWidth ( IDirectFBFont* thiz, const char* text, int bytes, int* ret_width )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("IDirectFBFont::GetStringWidth\n"));    

    return ( DFB_OK );
}



/*********************************************************************************************************************/

DfbExtObject    DfbExtBDHDMVPresentationLayer = { "DfbExtBDHDMVPresentationLayer" }; 
DfbExtObject    DfbExtBDHDMVInteractiveLayer  = { "DfbExtBDHDMVInteractiveLayer" }; 
DfbExtObject    DfbExtSplashscreenLayer       = { "DfbExtSplashscreenLayer" }; 


DfbExtHandle    DfbExtDisplayLayerOpen ( int layer )
{
    DfbExtHandle        handle = NULL;

    switch ( layer ) 
    {
        case DFB_EXT_BD_HDMV_PRESENTATION_LAYER:    handle = &DfbExtBDHDMVPresentationLayer;    break;
        case DFB_EXT_BD_HDMV_INTERACTIVE_LAYER:     handle = &DfbExtBDHDMVInteractiveLayer;     break;
        case DFB_EXT_SPLASHSCREEN_LAYER:            handle = &DfbExtSplashscreenLayer;          break;
       
        default:
            DBGPRINT(DBG_ON(DBG_ERROR),("DfbExtDisplayLayerOpen: unknown layer id\n"));    
            handle = NULL;
        break;
    }

    if ( handle != NULL ) 
    {            
        DBGPRINT(DBG_ON(DBG_TRACE),("DfbExtDisplayLayerOpen: name=%s\n",handle->name));    
    }

    return ( handle );
}



DfbExtResult    DfbExtDisplayLayerClose ( DfbExtHandle layer )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("DfbExtDisplayLayerClose\n"));    

    return ( 0 );
}



DfbExtResult    DfbExtLayerGet ( DfbExtHandle layer, DfbExtLayerSettingsType* settings )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("DfbExtLayerGet\n"));    

    return ( 0 );
}



DfbExtResult    DfbExtSetCurrentPTS ( unsigned long int currentPTS )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("DfbExtSetCurrentPTS\n"));    

    return ( 0 );
}


DfbExtResult    DfbExtSetVideoSource ( void* decodeHandle, DfbExtFrameRate frameRate )
{
    DBGPRINT(DBG_ON(DBG_TRACE),("DfbExtSetVideoSource\n"));    

    return ( 0 );
}
             




⌨️ 快捷键说明

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