Yardım Mt2de avi çalıştırmak

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

YunusEmreOfficial

sys.stdout.write("『RcT』YunusED\n")
Premium Üye
Usta Üye
Mesaj
888
Çözümler
15
Beğeni
609
Puan
839
Ticaret Puanı
0
Merhaba arkadaşlar,
Resource.cppye
m_resManager.RegisterResourceNewFunctionPointer("avi", NewVideo);
şöyle birşey tanımlamak istiyorum elimde BandiVideoPlayer.cpp ve BandiVideoPlayer.h BandiVideoLibrary.cpp ve BandiVideoLibrary.h dosyaları mevcut ne yaptımsa tanımlayamadım soyut tanımlıyosun felan dedi yapamadım bilen arkadaşım yardımcı olabilrmi acaba

Resource.cpp:
Genişlet Daralt Kopyala
#include "StdAfx.h"
#include "../eterLib/GrpExpandedImageInstance.h"
#include "../eterLib/GrpTextInstance.h"
#include "../eterLib/GrpMarkInstance.h"
#include "../eterLib/GrpSubImage.h"
#include "../eterLib/GrpText.h"
#include "../eterLib/AttributeData.h"
#include "../eterGrnLib/Thing.h"
#include "../eterGrnLib/ThingInstance.h"
#include "../effectLib/EffectMesh.h"
#include "../effectLib/EffectInstance.h"
#include "../gamelib/WeaponTrace.h"
#include "../gamelib/MapType.h"
#include "../gamelib/GameType.h"
#include "../gamelib/RaceData.h"
#include "../gamelib/RaceMotionData.h"
#include "../gamelib/ActorInstance.h"
#include "../gamelib/Area.h"
#include "../gamelib/ItemData.h"
#include "../gamelib/FlyingData.h"
#include "../gamelib/FlyTrace.h"
#include "../gamelib/FlyingInstance.h"
#include "../gamelib/FlyingData.h"

#include "Resource.h"

CResource* NewImage (const char* c_szFileName)
{
    return new CGraphicImage (c_szFileName);
}

CResource* NewSubImage (const char* c_szFileName)
{
    return new CGraphicSubImage (c_szFileName);
}

CResource* NewText (const char* c_szFileName)
{
    return new CGraphicText (c_szFileName);
}

CResource* NewThing (const char* c_szFileName)
{
    return new CGraphicThing (c_szFileName);
}

CResource* NewEffectMesh (const char* c_szFileName)
{
    return new CEffectMesh (c_szFileName);
}

CResource* NewAttributeData (const char* c_szFileName)
{
    return new CAttributeData (c_szFileName);
}

void CPythonResource::DumpFileList (const char* c_szFileName)
{
    m_resManager.DumpFileListToTextFile (c_szFileName);
}

void CPythonResource::Destroy()
{
    CFlyingInstance::DestroySystem();
    CActorInstance::DestroySystem();
    CArea::DestroySystem();
    CGraphicExpandedImageInstance::DestroySystem();
    CGraphicImageInstance::DestroySystem();
    CGraphicMarkInstance::DestroySystem();
    CGraphicThingInstance::DestroySystem();
    CGrannyModelInstance::DestroySystem();
    CGraphicTextInstance::DestroySystem();
    CEffectInstance::DestroySystem();
    CWeaponTrace::DestroySystem();
    CFlyTrace::DestroySystem();

    m_resManager.DestroyDeletingList();

    CFlyingData::DestroySystem();
    CItemData::DestroySystem();
    CEffectData::DestroySystem();
    CEffectMesh::SEffectMeshData::DestroySystem();
    CRaceData::DestroySystem();
    NRaceData::DestroySystem();
    CRaceMotionData::DestroySystem();

    m_resManager.Destroy();
}

CPythonResource::CPythonResource()
{
    m_resManager.RegisterResourceNewFunctionPointer ("sub", NewSubImage);
    m_resManager.RegisterResourceNewFunctionPointer ("dds", NewImage);
    m_resManager.RegisterResourceNewFunctionPointer ("jpg", NewImage);
    m_resManager.RegisterResourceNewFunctionPointer ("tga", NewImage);
    m_resManager.RegisterResourceNewFunctionPointer ("bmp", NewImage);
    m_resManager.RegisterResourceNewFunctionPointer ("fnt", NewText);
    m_resManager.RegisterResourceNewFunctionPointer ("gr2", NewThing);
    m_resManager.RegisterResourceNewFunctionPointer ("mde", NewEffectMesh);
    m_resManager.RegisterResourceNewFunctionPointer ("mdatr", NewAttributeData);
}

CPythonResource::~CPythonResource()
{
}

Resource.h:
Genişlet Daralt Kopyala
#pragma once

#include "../EffectLib/StdAfx.h"
#include "../eterlib/Resource.h"
#include "../eterlib/ResourceManager.h"

enum EResourceTypes
{
    RES_TYPE_UNKNOWN,
};

class CPythonResource : public CSingleton<CPythonResource>
{
    public:
        CPythonResource();
        virtual ~CPythonResource();

        void Destroy();

        void DumpFileList (const char* c_szFileName);

    protected:
        CResourceManager m_resManager;
};

BandiVideoPlayer.cpp:
Genişlet Daralt Kopyala
#include "stdafx.h"
#include "BandiVideoPlayer.h"
#include "PythonApplication.h"
#define BANDILIB_ID  "YMIRGAMES_METIN2_20130903"
#define BANDILIB_KEY "8ea04df0"

/// D3DVERTEX structure
typedef struct _D3DVERTEX {                        // D3D Vertex
    D3DVECTOR pos;
    FLOAT rhw;
    FLOAT tu, tv;
} D3DVERTEX;

#define D3DFVF_VERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)

CBandiVideoPlayer::CBandiVideoPlayer(void): m_pixel_size(0)
{
    m_d3d8            = NULL;
    m_d3d8_device    = NULL;
    m_hWnd            = NULL;
    m_texture        = NULL;
    m_vertex_buffer = NULL;
    m_vid_width        = m_vid_height     = 0;
    m_tex_width        = m_tex_height     = 0;
    m_wsize_width    = m_wsize_height = 0;
}

CBandiVideoPlayer::~CBandiVideoPlayer(void)
{
}

void CBandiVideoPlayer::VideoPlay(const char* szFilename)
{
    BaseInit();
    //bandilib init
    CBandiVideoLibrary bandilib;  
    if(FAILED(bandilib.Create(BANDIVIDEO_DLL_FILE_NAME, NULL, NULL)))
    {
        MessageBox(NULL, "Error createing BandiVideoLibrary.", "Error", MB_OK | MB_ICONSTOP);
        return;
    }

    //certification
    if(FAILED(bandilib.Verify(BANDILIB_ID, BANDILIB_KEY)))
    {
        TraceError(" bandilib not certification !! ");
        return;
    }
   
       
    //videoFile Read
    if(FAILED(bandilib.Open(szFilename, FALSE)))
    {
        MessageBox(NULL, "Error Opening file.....", "Error", MB_OK | MB_ICONSTOP);
        return;
    }
    //VIDEO_INFO
    BVL_VIDEO_INFO info;
    if(FAILED(bandilib.GetVideoInfo(info)))
    {
        MessageBox(NULL, "Error getting video info....", "Error", MB_OK | MB_ICONSTOP);
        return;
    }
    if(FAILED(InitTexture(info.width, info.height)))
    {
        MessageBox(NULL, "Error opening texture...", "Error", MB_OK | MB_ICONSTOP);
        return;
    }
    bandilib.Play();
    do
    {
        BVL_STATUS status;
        bandilib.GetStatus(status);

        if(status == BVL_STATUS_PLAYEND)
        {
            bandilib.Close();
            break;
        }
        if(bandilib.IsNextFrame())
        {
            D3DLOCKED_RECT    rc;
            BYTE*            buf;
            INT                pitch;

            m_texture->LockRect(0, &rc, NULL, 0);
            buf = (BYTE*)rc.pBits;
            pitch = rc.Pitch;

            if(buf)
            {
                BVL_FRAME frame;
                frame.frame_buf = buf;
                frame.frame_buf_size = info.height * pitch;
                frame.pitch = pitch;
                frame.width = info.width;
                frame.height = info.height;
                frame.pixel_format = m_fmt_bvl;

                bandilib.GetFrame(frame, FALSE);

                m_texture->UnlockRect(NULL);

                //Show frame
                m_d3d8_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);
                m_d3d8_device->BeginScene();

                Draw(0,0,info.width, info.height);

                m_d3d8_device->EndScene();
                m_d3d8_device->Present(NULL, NULL, NULL, NULL);
            }
        }
        if(GetAsyncKeyState(VK_ESCAPE) & 0x0001 || GetAsyncKeyState(VK_LBUTTON) & 0x0001 || GetAsyncKeyState(VK_RBUTTON) & 0x0001 || GetAsyncKeyState(VK_SPACE) & 0x0001)
                break;

    }while(1);

    bandilib.Destroy();
    m_texture->Release();
}
HRESULT CBandiVideoPlayer::Draw(INT x, INT y, INT width, INT height)
{
    HRESULT hr;
    hr = m_d3d8_device->SetTexture(0, m_texture);
    if(FAILED(hr)) return hr;

    m_d3d8_device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
    m_d3d8_device->SetRenderState(D3DRS_LIGHTING, FALSE);
    m_d3d8_device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);

    RECT moveRect;
    CalMoveRect(width, height, moveRect);

    hr = SetVertices((float)moveRect.left, (float)moveRect.top,
        (float)(moveRect.right - moveRect.left), (float)(moveRect.bottom - moveRect.top));

    return hr;
}
//ºñÀ² ¸Â°Ô ¿µ»ó rect ±¸Çϱâ.
void CBandiVideoPlayer::CalMoveRect(int srcWidth, int srcHeight, RECT& movieRect)
{
    RECT windowRect;
    POINT p;
    p.x = 0;
    p.y = 0;
    ClientToScreen(m_hWnd, &p);
    GetClientRect(m_hWnd, &windowRect);
    OffsetRect(&windowRect, p.x, p.y);

    int nMovieWidth, nMovieHeight;
    if (srcWidth >= srcHeight)
    {
        nMovieWidth = (windowRect.right - windowRect.left);
        nMovieHeight =  srcHeight * nMovieWidth / srcWidth;
        if( nMovieHeight > windowRect.bottom - windowRect.top )
            nMovieHeight = windowRect.bottom - windowRect.top;
    }
    else
    {
        nMovieHeight = (windowRect.bottom - windowRect.top);
        nMovieWidth =  srcWidth * nMovieHeight / srcHeight;
        if( nMovieWidth > windowRect.right - windowRect.left )
            nMovieWidth = windowRect.right - windowRect.left;
    }
    movieRect.left = windowRect.left + ((windowRect.right - windowRect.left) - nMovieWidth) / 2;
    movieRect.top = windowRect.top + ((windowRect.bottom - windowRect.top) - nMovieHeight) / 2;
    movieRect.right = movieRect.left + nMovieWidth;
    movieRect.bottom = movieRect.top + nMovieHeight;
}


HRESULT CBandiVideoPlayer::SetVertices(float scr_x, float scr_y, float scr_width, float scr_height)
{
    D3DVERTEX    vertices[4];

    // Set vertices
    vertices[0].pos.x = scr_x;
    vertices[0].pos.y = scr_y;
    vertices[0].tu    = 0.0f;
    vertices[0].tv    = 0.0f;

    vertices[1].pos.x = scr_x + scr_width;
    vertices[1].pos.y = scr_y;
    vertices[1].tu    = 1.0f * ((float)m_vid_width / m_tex_width);
    vertices[1].tv    = 0.0f;

    vertices[2].pos.x = scr_x + scr_width;
    vertices[2].pos.y = scr_y + scr_height;
    vertices[2].tu    = 1.0f * ((float)m_vid_width / m_tex_width);
    vertices[2].tv    = 1.0f * ((float)m_vid_height / m_tex_height);

    vertices[3].pos.x = scr_x;
    vertices[3].pos.y = scr_y + scr_height;
    vertices[3].tu    = 0.0f ;
    vertices[3].tv    = 1.0f * ((float)m_vid_height / m_tex_height);


    vertices[0].pos.z = vertices[1].pos.z = vertices[2].pos.z = vertices[3].pos.z = 0.0f;
    vertices[0].rhw   = vertices[1].rhw   = vertices[2].rhw   = vertices[3].rhw   = 1.0f;

    m_d3d8_device->SetVertexShader(D3DFVF_VERTEX);
   
    return m_d3d8_device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertices, sizeof(D3DVERTEX));
}

HRESULT CBandiVideoPlayer::BaseInit(void)
{
    m_hWnd            = CPythonApplication::Instance().GetWindowHandle();
    m_d3d8            = CPythonApplication::Instance().GetDirectx8();
    m_d3d8_device    = CPythonApplication::Instance().GetDevice();
    m_wsize_width    = CPythonApplication::Instance().GetWidth();
    m_wsize_height    = CPythonApplication::Instance().GetHeight();

    GetTextureFromat();

    return S_OK;
}
//cla texture size
int CBandiVideoPlayer::CalcTexSize(int vid_size, BOOL pow2)
{
    // Power-of-2 texture dimensions are required.
    D3DCAPS8 caps;
    m_d3d8_device->GetDeviceCaps(&caps);
    if(pow2 && caps.TextureCaps & D3DPTEXTURECAPS_POW2)
    {
        int tex_size = 16;
        while (tex_size < vid_size)
            tex_size = tex_size<<1;

        return tex_size;
    }
   
    return vid_size;
}
//create texture
HRESULT CBandiVideoPlayer::InitTexture(INT vid_width, INT vid_height)
{
   
    HRESULT hr;
    LPDIRECT3DTEXTURE8 texture = NULL;
    BOOL pow2 = TRUE;
   
    D3DCAPS8 Caps;
    m_d3d8_device->GetDeviceCaps(&Caps);

    if(!!(Caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL))
    {
        pow2 = FALSE;
    }

    int tex_width  = CalcTexSize(vid_width, pow2);
    int tex_height = CalcTexSize(vid_height, pow2);


    hr = m_d3d8_device->CreateTexture(tex_width+1, tex_height+1, 1,D3DUSAGE_DYNAMIC,
                                    m_fmt_d3d, D3DPOOL_DEFAULT, &texture);
    if(FAILED(hr))
    {
        hr = m_d3d8_device->CreateTexture(tex_width+1, tex_height+1, 1, 0,
                                    m_fmt_d3d, D3DPOOL_MANAGED, &texture);
        if(FAILED(hr))
        {
            Beep(1000, 1000);
            ASSERT(0);
            return hr;
        }
    }

    D3DLOCKED_RECT locked_rect;

    if(SUCCEEDED(texture->LockRect(0, &locked_rect, NULL, 0)))
    {
        BYTE* dest = (BYTE*) locked_rect.pBits;
        int byte = tex_width * m_pixel_size;

        for(int y = 0 ; y < tex_height; ++y)
        {
            memset(dest, 0, byte);
            dest += locked_rect.Pitch;
        }

        texture->UnlockRect(NULL);
    }

    m_texture    = texture;
    m_tex_width  = tex_width;
    m_tex_height = tex_height;
    m_vid_width  = vid_width;
    m_vid_height = vid_height;

    return S_OK;
}

//Get textureformat
BOOL CBandiVideoPlayer::GetTextureFromat(void)
{
    struct
    {
        D3DFORMAT            d3d_fmt;
        BVL_PIXEL_FORMAT    bvl_fmt;
        int                    pixel_size;
    } fmt_list[] =
    {
        { D3DFMT_X8R8G8B8,  BVLPF_X8R8G8B8,    4},
        { D3DFMT_R8G8B8,    BVLPF_R8G8B8,    3},
        { D3DFMT_R5G6B5,    BVLPF_R5G6B5,    2},
        { D3DFMT_X1R5G5B5,  BVLPF_R5G5B5,    2},
    };

    D3DDISPLAYMODE d3ddm;
    HRESULT hr = m_d3d8->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, & d3ddm);
    if(SUCCEEDED(hr))
    {
        int fmt_count = sizeof(fmt_list)/sizeof(fmt_list[0]);
        for(int i = 0; i < fmt_count; i ++)
        {
            if(SUCCEEDED(m_d3d8->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3ddm.Format, 0, D3DRTYPE_TEXTURE, fmt_list[i].d3d_fmt)))
            {
                m_fmt_d3d        = fmt_list[i].d3d_fmt;
                m_fmt_bvl        = fmt_list[i].bvl_fmt;
                m_pixel_size    = fmt_list[i].pixel_size;
                return TRUE;
            }
        }
    }

    m_fmt_d3d     = D3DFMT_UNKNOWN;
    m_fmt_bvl     = BVLPF_NULL;
    m_pixel_size = NULL;
 
    return FALSE;
}

BandiVideoPlayer.h:
Genişlet Daralt Kopyala
#pragma once
#include "BandiVideoLibrary.h"

struct BV_DEVICE_DX8
{
    LPDIRECT3D8                m_d3d8;
    LPDIRECT3DDEVICE8        m_d3d8_device;
    HWND                    m_hWnd;
    LPDIRECT3DTEXTURE8        m_texture;
    LPDIRECT3DVERTEXBUFFER8    m_vertex_buffer;
    D3DFORMAT                m_fmt_d3d;
    BVL_PIXEL_FORMAT        m_fmt_bvl;
};

class CBandiVideoPlayer : public CSingleton<CBandiVideoPlayer>, public BV_DEVICE_DX8
{

private:
    int m_vid_width;
    int    m_vid_height;
    int m_tex_width;
    int    m_tex_height;
    int m_pixel_size;
    int m_wsize_width;
    int m_wsize_height;

public:
    HRESULT BaseInit(void);
    BOOL    GetTextureFromat(void);
    HRESULT InitTexture(INT vid_width, INT vid_height);
    int CalcTexSize(int vid_size, BOOL pow2);
    HRESULT Draw(INT x, INT y, INT width, INT height);
    HRESULT SetVertices(float scr_x, float scr_y, float scr_width, float scr_height);
    void    CalMoveRect(int srcWidth, int srcHeight, RECT& movieRect);

public:
    void VideoPlay(const char* szFilename);

public:
    CBandiVideoPlayer(void);
    ~CBandiVideoPlayer(void);
};

BandiVideoLibrary.h:
Genişlet Daralt Kopyala
////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// BandiVideoLibrary 2.1
///
/// Copyright(C) 2008-2011 BandiSoft.com All rights reserved.
///
/// Visit http://www.bandisoft.com for more information.
///
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

#include "bandivid.h"



#ifdef _WIN64
#    ifdef _DEBUG
#        define BANDIVIDEO_DLL_FILE_NAME        _T("bdvid64_d.dll")
#    else
#        define BANDIVIDEO_DLL_FILE_NAME        _T("bdvid64.dll")
#    endif
#    define BANDIVIDEO_RELEASE_DLL_FILE_NAME    _T("bdvid64.dll")
#else
#    ifdef _DEBUG
#        define BANDIVIDEO_DLL_FILE_NAME        _T("bdvid32_d.dll")
#    else
#        define BANDIVIDEO_DLL_FILE_NAME        _T("bdvid32.dll")
#    endif
#    define BANDIVIDEO_RELEASE_DLL_FILE_NAME    _T("bdvid32.dll")
#endif


////////////////////////////////////////////////////////////////////////////////////////////////////
// utility class for load library and create instance for video library
////////////////////////////////////////////////////////////////////////////////////////////////////
class CBandiVideoLibrary : public IBandiVideo2
{
public :
    CBandiVideoLibrary();
    ~CBandiVideoLibrary();

    HRESULT Create(LPCTSTR dll_path_name, IBandiVideoFileReader *reader = NULL, IBandiVideoSound *sound = NULL);
    void    Destroy();
    BOOL    IsCreated();

public :      
    // IUnknown
    HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** p) { return E_NOTIMPL; }
    ULONG   STDMETHODCALLTYPE AddRef(void)    {return 0;}
    ULONG   STDMETHODCALLTYPE Release(void)    {return 0;}

    // IBandiVideo2
    HRESULT        Verify(LPCSTR szID, LPCSTR szKey);        // ÀÎÁõÇ챉          
    INT            GetVersion();                            // ¹öÀü Á¤º¸      

    HRESULT        Open(LPCWSTR path_name, BOOL async = FALSE);
    HRESULT        Open(LPCSTR path_name, BOOL async = FALSE);
    HRESULT        Close();
    HRESULT        Play();
    HRESULT        Stop();
    HRESULT        Seek(INT64 value, BVL_SEEK_FLAG seek_flag);
    HRESULT        Pause(BOOL pause);

    BOOL        IsNextFrame();
    HRESULT        GetFrame(BVL_FRAME &frame, BOOL can_skip);
    HRESULT        GetVideoInfo(BVL_VIDEO_INFO &info);
    HRESULT        GetStatus(BVL_STATUS &status);

    HRESULT        SetVolume(INT volume);                // 0 ~ 255

private :
    HMODULE                    m_dll;
    LPCREATEBANDIVIDEO2        m_pCreateBandiVideo2;

public:
    IBandiVideo2*            m_bvl;
};

BandiVideoLibrary.cpp:
Genişlet Daralt Kopyala
////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// BandiVideoLibrary 2.1
///
/// Copyright(C) 2008-2011 BandiSoft.com All rights reserved.
///
/// Visit http://www.bandisoft.com for more information.
///
////////////////////////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "BandiVideoLibrary.h"

CBandiVideoLibrary::CBandiVideoLibrary()
{
    m_dll = NULL;
    m_pCreateBandiVideo2 = NULL;

    m_bvl = NULL;
}

CBandiVideoLibrary::~CBandiVideoLibrary()
{
    Destroy();
}

BOOL Is_WinXP_SP2_or_Later()
{
    OSVERSIONINFOEX osvi;
    DWORDLONG dwlConditionMask = 0;
    int op = VER_GREATER_EQUAL;

    // Initialize the OSVERSIONINFOEX structure.

    ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
    osvi.dwMajorVersion = 5;
    osvi.dwMinorVersion = 1;
    osvi.wServicePackMajor = 2;
    osvi.wServicePackMinor = 0;

    // Initialize the condition mask.

    VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, op);
    VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, op);
    VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMAJOR, op);
    VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMINOR, op);

    // Perform the test.

    return VerifyVersionInfo(
        &osvi,
        VER_MAJORVERSION | VER_MINORVERSION |
        VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
        dwlConditionMask);
}

// ¶óÀ̺귯¸® ÃʱâÈ
HRESULT CBandiVideoLibrary::Create(LPCTSTR dll_path_name, IBandiVideoFileReader *reader /*= NULL */, IBandiVideoSound *sound /*= NULL */)
{
    if(m_dll) {ASSERT(0); return BVERR_ALREADY_CREATED;}

    // check os version
    if (Is_WinXP_SP2_or_Later()==FALSE)        // does not support 98
    {
        return BVERR_UNSUPPORTED_OS;
    }

    // DLL ·Îµå
    m_dll = LoadLibrary(dll_path_name);
    if(m_dll==NULL)
    {
        m_dll = LoadLibrary(BANDIVIDEO_RELEASE_DLL_FILE_NAME);
        if(m_dll==NULL)
        {
            ASSERT(0);
            return BVERR_LOAD_LIBRARY_FAIL;
        }
    }

    m_pCreateBandiVideo2 = (LPCREATEBANDIVIDEO2)GetProcAddress(m_dll, "CreateBandiVideo2");
    if(m_pCreateBandiVideo2==NULL)
    {
        ASSERT(0);
        FreeLibrary(m_dll);
        m_dll = NULL;
        return BVERR_GET_PROC_ADDRESS_FAIL;
    }

    return m_pCreateBandiVideo2(BVL_VERSION, (void**)&m_bvl, reader, sound);                              
}


BOOL CBandiVideoLibrary::IsCreated()
{
    return m_bvl ? TRUE : FALSE;
}


// ¶óÀ̺귯¸® ÇØÁ¦
void CBandiVideoLibrary::Destroy()
{
    if(m_bvl)
    {
        m_bvl->Release();
        m_bvl = NULL;
    }

    m_pCreateBandiVideo2 = NULL;
    if(m_dll) FreeLibrary(m_dll);
    m_dll = NULL;
}

// ÀÎÁõÇ챉          
HRESULT    CBandiVideoLibrary::Verify(LPCSTR id, LPCSTR key)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Verify(id, key);
}

// ¹öÀü Á¤º¸
INT        CBandiVideoLibrary::GetVersion()
{
    if(m_bvl==NULL) {ASSERT(0); return 0;}
    return m_bvl->GetVersion();
}

HRESULT    CBandiVideoLibrary::Open(LPCWSTR path_name, BOOL async)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Open(path_name, async);
}

HRESULT CBandiVideoLibrary::Open(LPCSTR path_name, BOOL async)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
   
    WCHAR wszPath[MAX_PATH+1];
    MultiByteToWideChar(CP_ACP, NULL, path_name, -1, wszPath, MAX_PATH);
   
    return m_bvl->Open(wszPath, async);
}

HRESULT CBandiVideoLibrary::Close()
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Close();
}

HRESULT CBandiVideoLibrary::Play()
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Play();
}

HRESULT CBandiVideoLibrary::Stop()
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Stop();
}

HRESULT    CBandiVideoLibrary::Seek(INT64 value, BVL_SEEK_FLAG seek_flag)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Seek(value, seek_flag);
}

HRESULT    CBandiVideoLibrary::Pause(BOOL pause)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->Pause(pause);
}

BOOL    CBandiVideoLibrary::IsNextFrame()
{
    if(m_bvl==NULL) {ASSERT(0); return FALSE;}
    return m_bvl->IsNextFrame();
}

HRESULT    CBandiVideoLibrary::GetFrame(BVL_FRAME &frame, BOOL can_skip)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->GetFrame(frame, can_skip);
}

HRESULT    CBandiVideoLibrary::GetVideoInfo(BVL_VIDEO_INFO &info)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->GetVideoInfo(info);
}

HRESULT CBandiVideoLibrary::GetStatus(BVL_STATUS &status)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->GetStatus(status);
}

HRESULT CBandiVideoLibrary::SetVolume(INT volume)
{
    if(m_bvl==NULL) {ASSERT(0); return BVERR_LIBRARY_NOT_LOADED;}
    return m_bvl->SetVolume(volume);
}
 
tam olarak ne yapmaya çalışıyorsun onu anlatsana
knk client açılırken video oynuyo ya onu çalıştırmaya çalışyıorum.

Linkleri görebilmek için giriş yap veya kayıt ol.


Sistemi ekledim bi sorun yok ama video açılmıyo png görmüyodu ekledim video uzantısı .avi olarak var acaba onudamı görmüyo diye ekliyim dedim kabul etmiyo beceremedim. 😂
 
knk client açılırken video oynuyo ya onu çalıştırmaya çalışyıorum.

Linkleri görebilmek için giriş yap veya kayıt ol.


Sistemi ekledim bi sorun yok ama video açılmıyo png görmüyodu ekledim video uzantısı .avi olarak var acaba onudamı görmüyo diye ekliyim dedim kabul etmiyo beceremedim. 😂
eski dosyalar introlu açılıyordu hep bandi kütüphanesi hatırlamıyorum ama onun kaldırılmış kodlarını bul geri ekle.
 
Üst