deargui-vpl/ref/virtools/Samples/Behaviors/Video/Video.cpp

155 lines
6.0 KiB
C++

/*************************************************************************/
/* File : Video.cpp */
/* Author : Leïla AIT KACI */
/* */
/* Virtools SDK */
/* Copyright (c) Virtools 2005, All Rights Reserved. */
/*************************************************************************/
#include "CKAll.h"
#include "CKVideo.h"
#include "CKVideoManager.h"
#ifdef CK_LIB
#define RegisterBehaviorDeclarations Register_Video_BehaviorDeclarations
#define InitInstance _Video_InitInstance
#define ExitInstance _Video_ExitInstance
#define CKGetPluginInfoCount CKGet_Video_PluginInfoCount
#define CKGetPluginInfo CKGet_Video_PluginInfo
#define g_PluginInfo g_Video_PluginInfo
#else
#define RegisterBehaviorDeclarations RegisterBehaviorDeclarations
#define InitInstance InitInstance
#define ExitInstance ExitInstance
#define CKGetPluginInfoCount CKGetPluginInfoCount
#define CKGetPluginInfo CKGetPluginInfo
#define g_PluginInfo g_PluginInfo
#endif
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void RegisterVideoPropertiesParams (CKParameterManager* pm);
void RegisterInputPropertiesParams (CKParameterManager* pm);
void RegisterOutputPropertiesParams (CKParameterManager* pm);
void RegisterVideoControlParams (CKParameterManager* pm);
void RegisterOutputControlParams (CKParameterManager* pm);
void RegisterVideoParamOp (CKParameterManager* pm);
CKERROR InitInstance(CKContext* context)
{
CKParameterManager* pm = context->GetParameterManager();
//////////////////////////////////////////////////////////////////////////
// Register Common parameters
//////////////////////////////////////////////////////////////////////////
#define PARAMETERS_TYPE CKGUID(0x50006c6,0x5d250140)
pm->RegisterNewEnum(PARAMETERS_TYPE, "", "All=0,Properties Only=1,Controls Only=2");
CKParameterTypeDesc* TypeDesc;
TypeDesc = pm->GetParameterTypeDescription(PARAMETERS_TYPE);
TypeDesc->dwFlags |= CKPARAMETERTYPE_HIDDEN;
//////////////////////////////////////////////////////////////////////////
// Register BB specific parameters
//////////////////////////////////////////////////////////////////////////
RegisterVideoPropertiesParams(pm);
RegisterInputPropertiesParams(pm);
RegisterOutputPropertiesParams(pm);
RegisterVideoControlParams(pm);
RegisterOutputControlParams(pm);
//////////////////////////////////////////////////////////////////////////
// Register Parameter Operations
//////////////////////////////////////////////////////////////////////////
RegisterVideoParamOp(pm);
return CK_OK;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void UnregisterVideoPropertiesParams (CKParameterManager* pm);
void UnregisterInputPropertiesParams (CKParameterManager* pm);
void UnregisterOutputPropertiesParams (CKParameterManager* pm);
void UnregisterVideoControlParams (CKParameterManager* pm);
void UnregisterOutputControlParams (CKParameterManager* pm);
void UnregisterVideoParamOp (CKParameterManager* pm);
CKERROR ExitInstance(CKContext* context)
{
CKParameterManager* pm = context->GetParameterManager();
//////////////////////////////////////////////////////////////////////////
// Unregister Common parameters
//////////////////////////////////////////////////////////////////////////
pm->UnRegisterParameterType(PARAMETERS_TYPE);
//////////////////////////////////////////////////////////////////////////
// Unregister BB specific parameters
//////////////////////////////////////////////////////////////////////////
UnregisterVideoPropertiesParams(pm);
UnregisterInputPropertiesParams(pm);
UnregisterOutputPropertiesParams(pm);
UnregisterVideoControlParams(pm);
UnregisterOutputControlParams(pm);
//////////////////////////////////////////////////////////////////////////
// Unregister Parameter Operations
//////////////////////////////////////////////////////////////////////////
UnregisterVideoParamOp(pm);
return CK_OK;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void RegisterBehaviorDeclarations(XObjectDeclarationArray *reg)
{
// Basics
RegisterBehavior(reg, FillBehaviorVideoPlayerDecl );
RegisterBehavior(reg, FillBehaviorVideoLoaderDecl );
RegisterBehavior(reg, FillBehaviorVideoSeekDecl );
RegisterBehavior(reg, FillBehaviorVideoCaptureDecl );
// Controls
RegisterBehavior(reg, FillBehaviorVideoControlDecl );
RegisterBehavior(reg, FillBehaviorOutputControlDecl );
RegisterBehavior(reg, FillBehaviorInputControlDecl );
RegisterBehavior(reg, FillBehaviorInputFormatsDecl );
// Properties
RegisterBehavior(reg, FillBehaviorVideoPropertiesDecl );
RegisterBehavior(reg, FillBehaviorInputPropertiesDecl );
RegisterBehavior(reg, FillBehaviorOutputPropertiesDecl );
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#define PLUGIN_COUNT 1
int CKGetPluginInfoCount() {
return PLUGIN_COUNT;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
CKPluginInfo g_PluginInfo[PLUGIN_COUNT];
CKPluginInfo* CKGetPluginInfo(int Index)
{
int Plugin = 0;
g_PluginInfo[Plugin].m_Author = "Virtools";
g_PluginInfo[Plugin].m_Description = "BBs for CKVideo Management";
g_PluginInfo[Plugin].m_Extension = "";
g_PluginInfo[Plugin].m_Type = CKPLUGIN_BEHAVIOR_DLL;
g_PluginInfo[Plugin].m_Version = 0x00010000;
g_PluginInfo[Plugin].m_InitInstanceFct = InitInstance;
g_PluginInfo[Plugin].m_ExitInstanceFct = ExitInstance;
g_PluginInfo[Plugin].m_GUID = CKGUID(0xD854D4C8,0x40049375);
g_PluginInfo[Plugin].m_Summary = "BBs for CKVideo Management";
Plugin++;
return &g_PluginInfo[Index];
}