Content Plugin is a plugin type that provides menu items, UI elements, and context-specific functionality. These plugins can add custom menu items to AVS4YOU application context menus, create custom dialogs, and interact with users.
When implementing the PluginType() function, return:
Plugins::PluginType::Content
Create a dynamic-link library (DLL) project in Visual Studio or another IDE.
Required files:
CContentPluginIntf.h - plugin interfaceCBase.h - base definitionsAVSConsts.h - AVS application constantsYour plugin must export the following functions:
PluginType() - returns plugin typePluginId() - unique plugin identifierPluginName() - plugin namePluginVersion() - plugin versionIsApplicationSupported(int appId) - checks application supportCreatePlugin() - creates plugin instanceDeletePlugin(PluginHandle) - deletes plugin instancePluginIcon(PluginHandle) - icon pathPluginInfo(PluginHandle) - additional information (JSON)#define PLUGIN_EXPORTS
#include "CContentPluginIntf.h"
#include <string>
// Plugin data
class MyPlugin {
public:
std::wstring language = L"en";
void* parentWindow = nullptr;
std::wstring tempPath;
};
// Information functions
PLUGIN_API Plugins::PluginType __stdcall PluginType() {
return Plugins::PluginType::Content;
}
PLUGIN_API wchar_t* __stdcall PluginId() {
return _wcsdup(L"com.example.myplugin");
}
PLUGIN_API wchar_t* __stdcall PluginName() {
return _wcsdup(L"My Content Plugin");
}
PLUGIN_API wchar_t* __stdcall PluginVersion() {
return _wcsdup(L"1.0.0");
}
PLUGIN_API bool __stdcall IsApplicationSupported(int appId) {
// Support for AVS Video Editor
return appId == AVS_VIDEO_EDITOR;
}
// Instance management
PLUGIN_API PluginHandle __stdcall CreatePlugin() {
return new MyPlugin();
}
PLUGIN_API void __stdcall DeletePlugin(PluginHandle handle) {
delete static_cast<MyPlugin*>(handle);
}
// String release
PLUGIN_API void __stdcall ReleasePluginString(wchar_t* str) {
free(str);
}
CreatePlugin()PLUGIN_API PluginHandle __stdcall CreatePlugin()
Description: Creates a new plugin instance.
Returns: Handle (pointer) to the created plugin instance.
Note: Memory must be released using DeletePlugin().
DeletePlugin(PluginHandle handle)PLUGIN_API void __stdcall DeletePlugin(PluginHandle handle)
Description: Deletes a plugin instance and releases its resources.
Parameters:
handle - handle to the plugin instance to be deletedPluginType()PLUGIN_API Plugins::PluginType __stdcall PluginType()
Description: Returns the plugin type.
Returns: Plugins::PluginType::Content
PluginId()PLUGIN_API wchar_t* __stdcall PluginId()
Description: Returns the unique plugin identifier.
Returns: String containing the plugin ID (e.g., “com.company.pluginname”).
Note: Memory must be released using ReleasePluginString().
PluginName()PLUGIN_API wchar_t* __stdcall PluginName()
Description: Returns the plugin name.
Returns: String containing the plugin name.
Note: Memory must be released using ReleasePluginString().
PluginVersion()PLUGIN_API wchar_t* __stdcall PluginVersion()
Description: Returns the plugin version.
Returns: String containing the version (e.g., “1.0.0”).
Note: Memory must be released using ReleasePluginString().
PluginIcon(PluginHandle handle)PLUGIN_API wchar_t* __stdcall PluginIcon(PluginHandle handle)
Description: Returns the path to the plugin icon.
Parameters:
handle - handle to the plugin instanceReturns: String containing the icon file path.
Note: Memory must be released using ReleasePluginString().
IsApplicationSupported(int appId)PLUGIN_API bool __stdcall IsApplicationSupported(int appId)
Description: Checks if the specified application is supported by the plugin.
Parameters:
appId - application identifier (constants from AVSConsts.h)Returns: true if the application is supported, otherwise false.
Application constants:
AVS_VIDEO_EDITOR (4) - AVS Video EditorAVS_AUDIO_EDITOR (1) - AVS Audio EditorAVS_PHOTO_EDITOR (5) - AVS Photo EditorPluginInfo(PluginHandle handle)PLUGIN_API wchar_t* __stdcall PluginInfo(PluginHandle handle)
Description: Returns additional information about the plugin in JSON format.
Parameters:
handle - handle to the plugin instanceReturns: JSON string with additional information.
Note: Memory must be released using ReleasePluginString().
ReleasePluginString(wchar_t* str)PLUGIN_API void __stdcall ReleasePluginString(wchar_t* str)
Description: Releases memory allocated for a plugin string.
Parameters:
str - pointer to the string to be releasedImportant: Must be called for ALL strings obtained from the plugin.
SetLanguage(PluginHandle handle, const wchar_t* language)PLUGIN_API void __stdcall SetLanguage(PluginHandle handle, const wchar_t* language)
Description: Sets the language for the plugin interface.
Parameters:
handle - handle to the plugin instancelanguage - language code (e.g., “en”, “ru”, “de”)Purpose: Affects localization of menu items and UI elements.
SetParentWindow(PluginHandle handle, void* hwnd)PLUGIN_API void __stdcall SetParentWindow(PluginHandle handle, void* hwnd)
Description: Sets the parent window for plugin dialogs.
Parameters:
handle - handle to the plugin instancehwnd - window handle (HWND cast to void*)Purpose: Used for proper modal dialog behavior and ownership.
SetTemporaryPath(PluginHandle handle, wchar_t* path)PLUGIN_API void __stdcall SetTemporaryPath(PluginHandle handle, wchar_t* path)
Description: Sets the temporary files path for the plugin.
Parameters:
handle - handle to the plugin instancepath - path to the temporary directoryPurpose: Plugin should use this directory for any temporary files.
CleanTemporaryFiles(PluginHandle handle)PLUGIN_API void __stdcall CleanTemporaryFiles(PluginHandle handle)
Description: Cleans up temporary files created by the plugin.
Parameters:
handle - handle to the plugin instanceWhen to call: Should be called when plugin is no longer needed.
CleanCachedData(PluginHandle handle)PLUGIN_API void __stdcall CleanCachedData(PluginHandle handle)
Description: Cleans up cached data created by the plugin.
Parameters:
handle - handle to the plugin instanceWhen to call: Should be called before plugin is uninstalled.
GetMenuForContext(PluginHandle handle, Plugins::ContextType context)PLUGIN_API wchar_t* __stdcall GetMenuForContext(PluginHandle handle, Plugins::ContextType context)
Description: Gets the menu structure for a specific context.
Parameters:
handle - handle to the plugin instancecontext - context type from Plugins::ContextType enumerationReturns: XML or JSON string describing the context menu structure.
Note: Memory must be released using ReleasePluginString().
Context types:
ContextType::Unknown (0) - Unknown contextContextType::MediaLibrary (1) - Media libraryContextType::Video (2) - Video contextContextType::Audio (3) - Audio contextContextType::Text (4) - Text contextContextType::Image (5) - Image contextGetPluginMenu(PluginHandle handle)PLUGIN_API wchar_t* __stdcall GetPluginMenu(PluginHandle handle)
Description: Gets the main plugin menu structure.
Parameters:
handle - handle to the plugin instanceReturns: XML or JSON string describing the plugin menu structure.
Note: Memory must be released using ReleasePluginString().
GetIconById(PluginHandle handle, int iconId)PLUGIN_API wchar_t* __stdcall GetIconById(PluginHandle handle, int iconId)
Description: Gets an icon by its identifier.
Parameters:
handle - handle to the plugin instanceiconId - icon identifierReturns: String containing icon path or data.
Note: Memory must be released using ReleasePluginString().
ClickMenuItem(PluginHandle handle, int itemId)PLUGIN_API void __stdcall ClickMenuItem(PluginHandle handle, int itemId)
Description: Handles a menu item click event.
Parameters:
handle - handle to the plugin instanceitemId - menu item identifierPurpose: Called when user clicks a menu item provided by the plugin.
SetCallbackHandler(PluginHandle handle, AsyncCallback callback, void* userData)PLUGIN_API void __stdcall SetCallbackHandler(PluginHandle handle, AsyncCallback callback, void* userData)
Description: Sets the callback handler for asynchronous operations.
Parameters:
handle - handle to the plugin instancecallback - callback function pointeruserData - user-defined data to be passed to the callbackAsyncCallback type:
typedef void (*AsyncCallback)(wchar_t*, wchar_t*, int, void*);
Purpose: Used for notifications and asynchronous operation results.
_wcsdup() or malloc()).ReleasePluginString() function.ReleasePluginString() correctly frees memory.{
"items": [
{
"id": 1,
"title": "My Plugin Action",
"icon": 100
},
{
"id": 2,
"title": "Settings",
"icon": 101
}
]
}
PLUGIN_API void __stdcall ClickMenuItem(PluginHandle handle, int itemId) {
MyPlugin* plugin = static_cast<MyPlugin*>(handle);
switch(itemId) {
case 1:
// Perform action
DoAction(plugin);
break;
case 2:
// Open settings
ShowSettings(plugin);
break;
}
}
All required header files are located in the sdk/include/ directory:
CContentPluginIntf.h - Content plugin interfaceCBase.h - base definitions and typesAVSConsts.h - AVS application constantsCPluginBase.h - base plugin class (optional)examples/content-plugin/docs/EffectPlugin-README.mdDocument version: 1.0 Last updated: 2026-01-23