commit efb8c4fd713a9ac8bd0a21435145f276d37c1d8c Author: Eduardo Ramos Date: Thu Jun 17 10:35:42 2021 +0200 Initial commit for release diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2a0343 --- /dev/null +++ b/.gitignore @@ -0,0 +1,220 @@ +# Created by https://www.gitignore.io/api/java,netbeans,node,intellij,eclipse,osx + +### NetBeans ### +nbproject/ +nbproject +nbproject/private/ +./build/ +nbbuild/ +dist/ +nbdist/ +nbactions.xml +.nb-gradle/ + + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +.idea +*.iml + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + + +### Eclipse ### + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + + +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Java ### +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3782d11 --- /dev/null +++ b/README.md @@ -0,0 +1,93 @@ +# Introduction + +This is a native driver for [Webcam Capture](https://github.com/sarxos/webcam-capture) that is reliable, has very good performance, fast startup time and is able to correctly list the detailed capabilities of video devices such as resolutions and device IDs. + +Currently it works on Windows only, with the `CaptureManagerDriver`, based on [CaptureManager-SDK](https://www.codeproject.com/Articles/1017223/CaptureManager-SDK-Capturing-Recording-and-Streami), which uses the MediaFoundation Windows API. + +# How to use + +1. Download this repository and run `mvn install` +2. Add `com.github.eduramiba:webcam-capture-driver-native:1.0.0-SNAPSHOT` dependency to your application. +3. Copy the DLLs of the `natives` folder for your system into the java library path. +4. Use the driver with `Webcam.setDriver(new CaptureManagerDriver())` +5. List the devices with `Webcam.getWebcams()` as normal and use the library in your preferred way. In JavaFX it's recommended to do it as in the example below. + +# Simple example with JavaFX + +```java +import com.github.eduramiba.webcamcapture.drivers.WebcamDeviceWithBufferOperations; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.CaptureManagerDriver; +import com.github.sarxos.webcam.Webcam; +import com.github.sarxos.webcam.WebcamDevice; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javafx.application.Application; +import javafx.application.Platform; +import javafx.scene.Scene; +import javafx.scene.image.ImageView; +import javafx.scene.image.WritableImage; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestCaptureManagerDriver extends Application { + + private static final Logger LOG = LoggerFactory.getLogger(TestCaptureManagerDriver.class); + + public static final ScheduledExecutorService EXECUTOR = Executors.newScheduledThreadPool(4); + + public static void main(String[] args) { + Webcam.setDriver(new CaptureManagerDriver()); + + launch(args); + } + + @Override + public void start(Stage stage) throws Exception { + ImageView imageView = new ImageView(); + HBox root = new HBox(); + root.getChildren().add(imageView); + + Webcam.getWebcams().stream() + .findFirst() + .ifPresent((final Webcam camera) -> { + final WebcamDevice device = camera.getDevice(); + LOG.info("Found camera: {}, device = {}", camera, device); + + final int width = device.getResolution().width; + final int height = device.getResolution().height; + final WritableImage fxImage = new WritableImage(width, height); + Platform.runLater(() -> { + imageView.setImage(fxImage); + }); + + camera.open(); + if (device instanceof WebcamDeviceWithBufferOperations) { + EXECUTOR.scheduleAtFixedRate(() -> { + ((WebcamDeviceWithBufferOperations) device).updateFXIMage(fxImage); + }, 0, 16, TimeUnit.MILLISECONDS); + } + }); + + // Create the Scene + Scene scene = new Scene(root); + // Add the scene to the Stage + stage.setScene(scene); + // Set the title of the Stage + stage.setTitle("Displaying an Image"); + // Display the Stage + stage.show(); + } +} +``` + +# Future work + +* Publish this as a maven central artifact. At the moment you will need to build it yourself. +* Implement MacOS and Linux native driver that uses LibUVC. + +# Notes + +The source code in `natives` folder and `capturemanager` java package has been copied from [CaptureManager-SDK](https://www.codeproject.com/Articles/1017223/CaptureManager-SDK-Capturing-Recording-and-Streami) and slightly improved for this driver. \ No newline at end of file diff --git a/maven-version-rules.xml b/maven-version-rules.xml new file mode 100644 index 0000000..f6aa52a --- /dev/null +++ b/maven-version-rules.xml @@ -0,0 +1,67 @@ + + + + + (?i).*alpha.* + + (?i).*beta.* + (?i).*[-.]b([0-9]+)? + + (?i).*[-.](rc|cr)[-]?([0-9]+)? + + (?i).*[-.]m([0-9]+)? + + (?i).*[-.]pr([0-9]+)? + + (?i).*jboss.* + + (?i).*\-b[0-9]+\.[0-9]+$ + + + (?i)RELEASE.* + + + (?i).*[-.]jre[0-9]+ + + + (?i).*[-.]ea\+[0-9]+[a-zA-Z]? + + + + + + ^200.\d+(\.\d+)?$ + + + + + ^200.\d+(\.\d+)?$ + + + + + ^200.\d+(\.\d+)?$ + + + + + ^200.\d+(\.\d+)?$ + + + + + 99.0-does-not-exist + + + + + 1.4-atlassian-1 + + + + + 9.0.0 + + + + diff --git a/natives/capturemanager/CaptureManagerNativeProxy.sln b/natives/capturemanager/CaptureManagerNativeProxy.sln new file mode 100644 index 0000000..49db56f --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CaptureManagerNativeProxy", "CaptureManagerNativeProxy\CaptureManagerNativeProxy.vcxproj", "{1D0E9171-8D1E-4A94-A48A-F5E92326908C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Debug|Win32.ActiveCfg = Debug|Win32 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Debug|Win32.Build.0 = Debug|Win32 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Debug|x64.ActiveCfg = Debug|x64 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Debug|x64.Build.0 = Debug|x64 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Release|Win32.ActiveCfg = Release|Win32 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Release|Win32.Build.0 = Release|Win32 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Release|x64.ActiveCfg = Release|x64 + {1D0E9171-8D1E-4A94-A48A-F5E92326908C}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerControlNative.cpp new file mode 100644 index 0000000..76f40ed --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerControlNative.cpp @@ -0,0 +1,114 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_CaptureManagerControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_CaptureManagerControlNative + * Method: createControl + * Signature: (JLjava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerControlNative_createControl + (JNIEnv *aPtrEnv, jobject, jlong aPtr, jstring aStringIID) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lICaptureManagerControl; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lICaptureManagerControl)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lIID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lIID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lIUnknown; + + lhr = lICaptureManagerControl->createControl( + lIID, + &lIUnknown); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lIUnknown.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_CaptureManagerControlNative + * Method: createMisc + * Signature: (JLjava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerControlNative_createMisc + (JNIEnv *aPtrEnv, jobject, jlong aPtr, jstring aStringIID) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lICaptureManagerControl; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lICaptureManagerControl)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lIID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lIID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lIUnknown; + + lhr = lICaptureManagerControl->createMisc( + lIID, + &lIUnknown); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lIUnknown.detach(); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.cpp b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.cpp new file mode 100644 index 0000000..de97e56 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.cpp @@ -0,0 +1,156 @@ +#define WIN32_LEAN_AND_MEAN + + +#include +#include +#include + + +#include "JNI\capturemanager_classes_CaptureManagerNativeProxy.h" + +#include "ComPtrCustom.h" + +BOOL gComInit = FALSE; + +typedef HRESULT(STDAPICALLTYPE *PDllGetClassObject) (REFCLSID, REFIID, void**); + +#ifdef __cplusplus +extern "C" { +#endif + + /* + * Class: capturemanager_classes_CaptureManagerNativeProxy_getPtrClass + * Method: explicitGetPtrClass + * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_explicitGetPtrClass + (JNIEnv * aPtrEnv, jobject aClass, jstring aStringFilePath, jstring aStringCLSID, jstring aStringGUID) + { + jlong lresult = 0; + + do + { + HRESULT lhresult(E_FAIL); + + gComInit = TRUE; + + HMODULE lhLibrary = nullptr; + + if (lhLibrary == nullptr) + { + const jchar *lPtrStringFilePath = aPtrEnv->GetStringChars(aStringFilePath, nullptr); + + lhLibrary = GetModuleHandle((wchar_t*)lPtrStringFilePath); + + if (lhLibrary == nullptr) + break; + } + + PDllGetClassObject lPtrFuncDllGetClassObject = nullptr; + + lPtrFuncDllGetClassObject = (PDllGetClassObject)GetProcAddress(lhLibrary, "DllGetClassObject"); + + if (lPtrFuncDllGetClassObject == nullptr) + break; + + const jchar *lPtrStringCLSID = aPtrEnv->GetStringChars(aStringCLSID, nullptr); + + CLSID lCLSID; + + lhresult = CLSIDFromString((wchar_t*)lPtrStringCLSID, &lCLSID); + + if (FAILED(lhresult)) + break; + + CComPtrCustom lClassFactory; + + lhresult = lPtrFuncDllGetClassObject(lCLSID, IID_PPV_ARGS(&lClassFactory)); + + if (FAILED(lhresult)) + break; + + if (!lClassFactory) + break; + + const jchar *lPtrStringGUID = aPtrEnv->GetStringChars(aStringGUID, nullptr); + + CLSID lInterfaceID; + + lhresult = CLSIDFromString((wchar_t*)lPtrStringGUID, &lInterfaceID); + + if (FAILED(lhresult)) + break; + + CComPtrCustom lIUnknown; + + lhresult = lClassFactory->CreateInstance( + nullptr, + lInterfaceID, + (void**)&lIUnknown); + + if (FAILED(lhresult)) + break; + + if (!lIUnknown) + break; + + lresult = (jlong)lIUnknown.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_CaptureManagerNativeProxy_getPtrClass + * Method: getPtrClass + * Signature: (Ljava/lang/String;Ljava/lang/String;)J + */ + JNIEXPORT void JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_freeLibrary + (JNIEnv * aPtrEnv, jobject aClass, jstring aFileName) + { + do + { + HMODULE lhLibrary = nullptr; + + const jchar *lPtrFileName = aPtrEnv->GetStringChars(aFileName, nullptr); + + lhLibrary = GetModuleHandle((wchar_t*)lPtrFileName); + + if (lhLibrary == nullptr) + break; + + BOOL lresult = FreeLibrary(lhLibrary); + + while (lresult != FALSE) + { + lresult = FreeLibrary(lhLibrary); + } + + } while (false); + } + + /* + * Class: capturemanager_classes_CaptureManagerNativeProxy_Release + * Method: Release + * Signature: (J)V + */ + JNIEXPORT void JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_Release + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + do + { + if (aPtr != 0) + { + IUnknown* aPtrIUnknown = (IUnknown*)aPtr; + + if (aPtrIUnknown != nullptr) + aPtrIUnknown->Release(); + } + + } while (false); + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj new file mode 100644 index 0000000..5a53590 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj @@ -0,0 +1,200 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {1D0E9171-8D1E-4A94-A48A-F5E92326908C} + Win32Proj + CaptureManagerNativeProxy + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + true + .\Includes;$(IncludePath) + + + true + .\Includes;$(IncludePath) + + + false + .\Includes;$(IncludePath) + + + false + .\Includes;$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CAPTUREMANAGERNATIVEPROXY_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + jawt.lib;%(AdditionalDependencies) + $(ProjectDir)JavaLib\$(PlatformTarget);%(AdditionalLibraryDirectories) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CAPTUREMANAGERNATIVEPROXY_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + C:\Program Files\Java\jdk1.8.0_92\lib;%(AdditionalLibraryDirectories) + jawt.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CAPTUREMANAGERNATIVEPROXY_EXPORTS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + + + Windows + true + true + true + $(ProjectDir)JavaLib\$(PlatformTarget);%(AdditionalLibraryDirectories) + jawt.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CAPTUREMANAGERNATIVEPROXY_EXPORTS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + + + Windows + true + true + true + jawt.lib;%(AdditionalDependencies) + $(ProjectDir)JavaLib\$(PlatformTarget);%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj.filters b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj.filters new file mode 100644 index 0000000..313396b --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerNativeProxy.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerTypeInfo.h b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerTypeInfo.h new file mode 100644 index 0000000..634c589 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/CaptureManagerTypeInfo.h @@ -0,0 +1,5846 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.00.0603 */ +/* at Wed Jan 27 10:49:03 2021 + */ +/* Compiler settings for CaptureManagerTypeInfo.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.00.0603 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __CaptureManagerTypeInfo_h__ +#define __CaptureManagerTypeInfo_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ILogPrintOutControl_FWD_DEFINED__ +#define __ILogPrintOutControl_FWD_DEFINED__ +typedef interface ILogPrintOutControl ILogPrintOutControl; + +#endif /* __ILogPrintOutControl_FWD_DEFINED__ */ + + +#ifndef __ISourceControl_FWD_DEFINED__ +#define __ISourceControl_FWD_DEFINED__ +typedef interface ISourceControl ISourceControl; + +#endif /* __ISourceControl_FWD_DEFINED__ */ + + +#ifndef __ISinkControl_FWD_DEFINED__ +#define __ISinkControl_FWD_DEFINED__ +typedef interface ISinkControl ISinkControl; + +#endif /* __ISinkControl_FWD_DEFINED__ */ + + +#ifndef __IFileSinkFactory_FWD_DEFINED__ +#define __IFileSinkFactory_FWD_DEFINED__ +typedef interface IFileSinkFactory IFileSinkFactory; + +#endif /* __IFileSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallSinkFactory_FWD_DEFINED__ +#define __ISampleGrabberCallSinkFactory_FWD_DEFINED__ +typedef interface ISampleGrabberCallSinkFactory ISampleGrabberCallSinkFactory; + +#endif /* __ISampleGrabberCallSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCall_FWD_DEFINED__ +#define __ISampleGrabberCall_FWD_DEFINED__ +typedef interface ISampleGrabberCall ISampleGrabberCall; + +#endif /* __ISampleGrabberCall_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ +#define __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ +typedef interface ISampleGrabberCallbackSinkFactory ISampleGrabberCallbackSinkFactory; + +#endif /* __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallback_FWD_DEFINED__ +#define __ISampleGrabberCallback_FWD_DEFINED__ +typedef interface ISampleGrabberCallback ISampleGrabberCallback; + +#endif /* __ISampleGrabberCallback_FWD_DEFINED__ */ + + +#ifndef __IEVRSinkFactory_FWD_DEFINED__ +#define __IEVRSinkFactory_FWD_DEFINED__ +typedef interface IEVRSinkFactory IEVRSinkFactory; + +#endif /* __IEVRSinkFactory_FWD_DEFINED__ */ + + +#ifndef __IEVRMultiSinkFactory_FWD_DEFINED__ +#define __IEVRMultiSinkFactory_FWD_DEFINED__ +typedef interface IEVRMultiSinkFactory IEVRMultiSinkFactory; + +#endif /* __IEVRMultiSinkFactory_FWD_DEFINED__ */ + + +#ifndef __IMediaTypeParser_FWD_DEFINED__ +#define __IMediaTypeParser_FWD_DEFINED__ +typedef interface IMediaTypeParser IMediaTypeParser; + +#endif /* __IMediaTypeParser_FWD_DEFINED__ */ + + +#ifndef __IStrideForBitmap_FWD_DEFINED__ +#define __IStrideForBitmap_FWD_DEFINED__ +typedef interface IStrideForBitmap IStrideForBitmap; + +#endif /* __IStrideForBitmap_FWD_DEFINED__ */ + + +#ifndef __IStreamControl_FWD_DEFINED__ +#define __IStreamControl_FWD_DEFINED__ +typedef interface IStreamControl IStreamControl; + +#endif /* __IStreamControl_FWD_DEFINED__ */ + + +#ifndef __ISpreaderNodeFactory_FWD_DEFINED__ +#define __ISpreaderNodeFactory_FWD_DEFINED__ +typedef interface ISpreaderNodeFactory ISpreaderNodeFactory; + +#endif /* __ISpreaderNodeFactory_FWD_DEFINED__ */ + + +#ifndef __ISwitcherNodeFactory_FWD_DEFINED__ +#define __ISwitcherNodeFactory_FWD_DEFINED__ +typedef interface ISwitcherNodeFactory ISwitcherNodeFactory; + +#endif /* __ISwitcherNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IMixerNodeFactory_FWD_DEFINED__ +#define __IMixerNodeFactory_FWD_DEFINED__ +typedef interface IMixerNodeFactory IMixerNodeFactory; + +#endif /* __IMixerNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IEncoderControl_FWD_DEFINED__ +#define __IEncoderControl_FWD_DEFINED__ +typedef interface IEncoderControl IEncoderControl; + +#endif /* __IEncoderControl_FWD_DEFINED__ */ + + +#ifndef __IEncoderNodeFactory_FWD_DEFINED__ +#define __IEncoderNodeFactory_FWD_DEFINED__ +typedef interface IEncoderNodeFactory IEncoderNodeFactory; + +#endif /* __IEncoderNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IWebCamControl_FWD_DEFINED__ +#define __IWebCamControl_FWD_DEFINED__ +typedef interface IWebCamControl IWebCamControl; + +#endif /* __IWebCamControl_FWD_DEFINED__ */ + + +#ifndef __IByteStreamSinkFactory_FWD_DEFINED__ +#define __IByteStreamSinkFactory_FWD_DEFINED__ +typedef interface IByteStreamSinkFactory IByteStreamSinkFactory; + +#endif /* __IByteStreamSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISessionControl_FWD_DEFINED__ +#define __ISessionControl_FWD_DEFINED__ +typedef interface ISessionControl ISessionControl; + +#endif /* __ISessionControl_FWD_DEFINED__ */ + + +#ifndef __ISession_FWD_DEFINED__ +#define __ISession_FWD_DEFINED__ +typedef interface ISession ISession; + +#endif /* __ISession_FWD_DEFINED__ */ + + +#ifndef __ISessionCallback_FWD_DEFINED__ +#define __ISessionCallback_FWD_DEFINED__ +typedef interface ISessionCallback ISessionCallback; + +#endif /* __ISessionCallback_FWD_DEFINED__ */ + + +#ifndef __ICaptureManagerControl_FWD_DEFINED__ +#define __ICaptureManagerControl_FWD_DEFINED__ +typedef interface ICaptureManagerControl ICaptureManagerControl; + +#endif /* __ICaptureManagerControl_FWD_DEFINED__ */ + + +#ifndef __IVersionControl_FWD_DEFINED__ +#define __IVersionControl_FWD_DEFINED__ +typedef interface IVersionControl IVersionControl; + +#endif /* __IVersionControl_FWD_DEFINED__ */ + + +#ifndef __IEVRStreamControl_FWD_DEFINED__ +#define __IEVRStreamControl_FWD_DEFINED__ +typedef interface IEVRStreamControl IEVRStreamControl; + +#endif /* __IEVRStreamControl_FWD_DEFINED__ */ + + +#ifndef __IInitilaizeCaptureSource_FWD_DEFINED__ +#define __IInitilaizeCaptureSource_FWD_DEFINED__ +typedef interface IInitilaizeCaptureSource IInitilaizeCaptureSource; + +#endif /* __IInitilaizeCaptureSource_FWD_DEFINED__ */ + + +#ifndef __ICurrentMediaType_FWD_DEFINED__ +#define __ICurrentMediaType_FWD_DEFINED__ +typedef interface ICurrentMediaType ICurrentMediaType; + +#endif /* __ICurrentMediaType_FWD_DEFINED__ */ + + +#ifndef __ISourceRequestResult_FWD_DEFINED__ +#define __ISourceRequestResult_FWD_DEFINED__ +typedef interface ISourceRequestResult ISourceRequestResult; + +#endif /* __ISourceRequestResult_FWD_DEFINED__ */ + + +#ifndef __ICaptureProcessor_FWD_DEFINED__ +#define __ICaptureProcessor_FWD_DEFINED__ +typedef interface ICaptureProcessor ICaptureProcessor; + +#endif /* __ICaptureProcessor_FWD_DEFINED__ */ + + +#ifndef __IRenderingControl_FWD_DEFINED__ +#define __IRenderingControl_FWD_DEFINED__ +typedef interface IRenderingControl IRenderingControl; + +#endif /* __IRenderingControl_FWD_DEFINED__ */ + + +#ifndef __ISwitcherControl_FWD_DEFINED__ +#define __ISwitcherControl_FWD_DEFINED__ +typedef interface ISwitcherControl ISwitcherControl; + +#endif /* __ISwitcherControl_FWD_DEFINED__ */ + + +#ifndef __IVideoMixerControl_FWD_DEFINED__ +#define __IVideoMixerControl_FWD_DEFINED__ +typedef interface IVideoMixerControl IVideoMixerControl; + +#endif /* __IVideoMixerControl_FWD_DEFINED__ */ + + +#ifndef __IAudioMixerControl_FWD_DEFINED__ +#define __IAudioMixerControl_FWD_DEFINED__ +typedef interface IAudioMixerControl IAudioMixerControl; + +#endif /* __IAudioMixerControl_FWD_DEFINED__ */ + + +#ifndef __ISARSinkFactory_FWD_DEFINED__ +#define __ISARSinkFactory_FWD_DEFINED__ +typedef interface ISARSinkFactory ISARSinkFactory; + +#endif /* __ISARSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISARVolumeControl_FWD_DEFINED__ +#define __ISARVolumeControl_FWD_DEFINED__ +typedef interface ISARVolumeControl ISARVolumeControl; + +#endif /* __ISARVolumeControl_FWD_DEFINED__ */ + + +#ifndef __CoLogPrintOut_FWD_DEFINED__ +#define __CoLogPrintOut_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class CoLogPrintOut CoLogPrintOut; +#else +typedef struct CoLogPrintOut CoLogPrintOut; +#endif /* __cplusplus */ + +#endif /* __CoLogPrintOut_FWD_DEFINED__ */ + + +#ifndef __CoCaptureManager_FWD_DEFINED__ +#define __CoCaptureManager_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class CoCaptureManager CoCaptureManager; +#else +typedef struct CoCaptureManager CoCaptureManager; +#endif /* __cplusplus */ + +#endif /* __CoCaptureManager_FWD_DEFINED__ */ + + +#ifndef __ISourceControl_FWD_DEFINED__ +#define __ISourceControl_FWD_DEFINED__ +typedef interface ISourceControl ISourceControl; + +#endif /* __ISourceControl_FWD_DEFINED__ */ + + +#ifndef __ISinkControl_FWD_DEFINED__ +#define __ISinkControl_FWD_DEFINED__ +typedef interface ISinkControl ISinkControl; + +#endif /* __ISinkControl_FWD_DEFINED__ */ + + +#ifndef __IFileSinkFactory_FWD_DEFINED__ +#define __IFileSinkFactory_FWD_DEFINED__ +typedef interface IFileSinkFactory IFileSinkFactory; + +#endif /* __IFileSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISessionControl_FWD_DEFINED__ +#define __ISessionControl_FWD_DEFINED__ +typedef interface ISessionControl ISessionControl; + +#endif /* __ISessionControl_FWD_DEFINED__ */ + + +#ifndef __ISession_FWD_DEFINED__ +#define __ISession_FWD_DEFINED__ +typedef interface ISession ISession; + +#endif /* __ISession_FWD_DEFINED__ */ + + +#ifndef __ISessionCallback_FWD_DEFINED__ +#define __ISessionCallback_FWD_DEFINED__ +typedef interface ISessionCallback ISessionCallback; + +#endif /* __ISessionCallback_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallSinkFactory_FWD_DEFINED__ +#define __ISampleGrabberCallSinkFactory_FWD_DEFINED__ +typedef interface ISampleGrabberCallSinkFactory ISampleGrabberCallSinkFactory; + +#endif /* __ISampleGrabberCallSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCall_FWD_DEFINED__ +#define __ISampleGrabberCall_FWD_DEFINED__ +typedef interface ISampleGrabberCall ISampleGrabberCall; + +#endif /* __ISampleGrabberCall_FWD_DEFINED__ */ + + +#ifndef __IMediaTypeParser_FWD_DEFINED__ +#define __IMediaTypeParser_FWD_DEFINED__ +typedef interface IMediaTypeParser IMediaTypeParser; + +#endif /* __IMediaTypeParser_FWD_DEFINED__ */ + + +#ifndef __IStrideForBitmap_FWD_DEFINED__ +#define __IStrideForBitmap_FWD_DEFINED__ +typedef interface IStrideForBitmap IStrideForBitmap; + +#endif /* __IStrideForBitmap_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ +#define __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ +typedef interface ISampleGrabberCallbackSinkFactory ISampleGrabberCallbackSinkFactory; + +#endif /* __ISampleGrabberCallbackSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCallback_FWD_DEFINED__ +#define __ISampleGrabberCallback_FWD_DEFINED__ +typedef interface ISampleGrabberCallback ISampleGrabberCallback; + +#endif /* __ISampleGrabberCallback_FWD_DEFINED__ */ + + +#ifndef __IEVRSinkFactory_FWD_DEFINED__ +#define __IEVRSinkFactory_FWD_DEFINED__ +typedef interface IEVRSinkFactory IEVRSinkFactory; + +#endif /* __IEVRSinkFactory_FWD_DEFINED__ */ + + +#ifndef __IStreamControl_FWD_DEFINED__ +#define __IStreamControl_FWD_DEFINED__ +typedef interface IStreamControl IStreamControl; + +#endif /* __IStreamControl_FWD_DEFINED__ */ + + +#ifndef __ISpreaderNodeFactory_FWD_DEFINED__ +#define __ISpreaderNodeFactory_FWD_DEFINED__ +typedef interface ISpreaderNodeFactory ISpreaderNodeFactory; + +#endif /* __ISpreaderNodeFactory_FWD_DEFINED__ */ + + +#ifndef __ISwitcherNodeFactory_FWD_DEFINED__ +#define __ISwitcherNodeFactory_FWD_DEFINED__ +typedef interface ISwitcherNodeFactory ISwitcherNodeFactory; + +#endif /* __ISwitcherNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IEncoderControl_FWD_DEFINED__ +#define __IEncoderControl_FWD_DEFINED__ +typedef interface IEncoderControl IEncoderControl; + +#endif /* __IEncoderControl_FWD_DEFINED__ */ + + +#ifndef __IEncoderNodeFactory_FWD_DEFINED__ +#define __IEncoderNodeFactory_FWD_DEFINED__ +typedef interface IEncoderNodeFactory IEncoderNodeFactory; + +#endif /* __IEncoderNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IWebCamControl_FWD_DEFINED__ +#define __IWebCamControl_FWD_DEFINED__ +typedef interface IWebCamControl IWebCamControl; + +#endif /* __IWebCamControl_FWD_DEFINED__ */ + + +#ifndef __IByteStreamSinkFactory_FWD_DEFINED__ +#define __IByteStreamSinkFactory_FWD_DEFINED__ +typedef interface IByteStreamSinkFactory IByteStreamSinkFactory; + +#endif /* __IByteStreamSinkFactory_FWD_DEFINED__ */ + + +#ifndef __IVersionControl_FWD_DEFINED__ +#define __IVersionControl_FWD_DEFINED__ +typedef interface IVersionControl IVersionControl; + +#endif /* __IVersionControl_FWD_DEFINED__ */ + + +#ifndef __IEVRStreamControl_FWD_DEFINED__ +#define __IEVRStreamControl_FWD_DEFINED__ +typedef interface IEVRStreamControl IEVRStreamControl; + +#endif /* __IEVRStreamControl_FWD_DEFINED__ */ + + +#ifndef __IEVRMultiSinkFactory_FWD_DEFINED__ +#define __IEVRMultiSinkFactory_FWD_DEFINED__ +typedef interface IEVRMultiSinkFactory IEVRMultiSinkFactory; + +#endif /* __IEVRMultiSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ICaptureProcessor_FWD_DEFINED__ +#define __ICaptureProcessor_FWD_DEFINED__ +typedef interface ICaptureProcessor ICaptureProcessor; + +#endif /* __ICaptureProcessor_FWD_DEFINED__ */ + + +#ifndef __IInitilaizeCaptureSource_FWD_DEFINED__ +#define __IInitilaizeCaptureSource_FWD_DEFINED__ +typedef interface IInitilaizeCaptureSource IInitilaizeCaptureSource; + +#endif /* __IInitilaizeCaptureSource_FWD_DEFINED__ */ + + +#ifndef __ISourceRequestResult_FWD_DEFINED__ +#define __ISourceRequestResult_FWD_DEFINED__ +typedef interface ISourceRequestResult ISourceRequestResult; + +#endif /* __ISourceRequestResult_FWD_DEFINED__ */ + + +#ifndef __ICurrentMediaType_FWD_DEFINED__ +#define __ICurrentMediaType_FWD_DEFINED__ +typedef interface ICurrentMediaType ICurrentMediaType; + +#endif /* __ICurrentMediaType_FWD_DEFINED__ */ + + +#ifndef __IRenderingControl_FWD_DEFINED__ +#define __IRenderingControl_FWD_DEFINED__ +typedef interface IRenderingControl IRenderingControl; + +#endif /* __IRenderingControl_FWD_DEFINED__ */ + + +#ifndef __ISwitcherControl_FWD_DEFINED__ +#define __ISwitcherControl_FWD_DEFINED__ +typedef interface ISwitcherControl ISwitcherControl; + +#endif /* __ISwitcherControl_FWD_DEFINED__ */ + + +#ifndef __IMixerNodeFactory_FWD_DEFINED__ +#define __IMixerNodeFactory_FWD_DEFINED__ +typedef interface IMixerNodeFactory IMixerNodeFactory; + +#endif /* __IMixerNodeFactory_FWD_DEFINED__ */ + + +#ifndef __IVideoMixerControl_FWD_DEFINED__ +#define __IVideoMixerControl_FWD_DEFINED__ +typedef interface IVideoMixerControl IVideoMixerControl; + +#endif /* __IVideoMixerControl_FWD_DEFINED__ */ + + +#ifndef __IAudioMixerControl_FWD_DEFINED__ +#define __IAudioMixerControl_FWD_DEFINED__ +typedef interface IAudioMixerControl IAudioMixerControl; + +#endif /* __IAudioMixerControl_FWD_DEFINED__ */ + + +#ifndef __ISARSinkFactory_FWD_DEFINED__ +#define __ISARSinkFactory_FWD_DEFINED__ +typedef interface ISARSinkFactory ISARSinkFactory; + +#endif /* __ISARSinkFactory_FWD_DEFINED__ */ + + +#ifndef __ISARVolumeControl_FWD_DEFINED__ +#define __ISARVolumeControl_FWD_DEFINED__ +typedef interface ISARVolumeControl ISARVolumeControl; + +#endif /* __ISARVolumeControl_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_CaptureManagerTypeInfo_0000_0000 */ +/* [local] */ + +typedef /* [helpstring][v1_enum][uuid] */ DECLSPEC_UUID("5CA95537-3733-441D-B9F4-1F38CCFC56D3") +enum LogLevel + { + INFO_LEVEL = 0, + ERROR_LEVEL = ( INFO_LEVEL + 1 ) + } LogLevel; + +typedef /* [helpstring][v1_enum][uuid] */ DECLSPEC_UUID("A492B132-CF20-4562-BAC4-290EB4D0ADA4") +enum WebCamParametrFlag + { + Auto = 1, + Manual = 2 + } WebCamParametrFlag; + +typedef /* [helpstring][v1_enum][uuid] */ DECLSPEC_UUID("437C2465-72D9-436E-9B51-327EF76DB4A5") +enum WebCamParametr + { + BRIGHTNESS = 0, + CONTRAST = ( BRIGHTNESS + 1 ) , + HUE = ( CONTRAST + 1 ) , + SATURATION = ( HUE + 1 ) , + SHARPNESS = ( SATURATION + 1 ) , + GAMMA = ( SHARPNESS + 1 ) , + COLORENABLE = ( GAMMA + 1 ) , + WHITRBALANCE = ( COLORENABLE + 1 ) , + BACKLIGHTCOMPENSATION = ( WHITRBALANCE + 1 ) , + GAIN = ( BACKLIGHTCOMPENSATION + 1 ) , + PAN = ( GAIN + 1 ) , + TILT = ( PAN + 1 ) , + ROLL = ( TILT + 1 ) , + ZOOM = ( ROLL + 1 ) , + EXPOSURE = ( ZOOM + 1 ) , + IRIS = ( EXPOSURE + 1 ) , + FOCUS = ( IRIS + 1 ) + } WebCamParametr; + +typedef /* [helpstring][v1_enum][uuid] */ DECLSPEC_UUID("DFAE427C-9493-4022-8FD2-D0280B9A422C") +enum SessionCallbackEventCode + { + UnknownEvent = 0, + Error = ( UnknownEvent + 1 ) , + Status_Error = ( Error + 1 ) , + Execution_Error = ( Status_Error + 1 ) , + ItIsReadyToStart = ( Execution_Error + 1 ) , + ItIsStarted = ( ItIsReadyToStart + 1 ) , + ItIsPaused = ( ItIsStarted + 1 ) , + ItIsStopped = ( ItIsPaused + 1 ) , + ItIsEnded = ( ItIsStopped + 1 ) , + ItIsClosed = ( ItIsEnded + 1 ) , + VideoCaptureDeviceRemoved = ( ItIsClosed + 1 ) + } SessionCallbackEventCode; + + + +extern RPC_IF_HANDLE __MIDL_itf_CaptureManagerTypeInfo_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_CaptureManagerTypeInfo_0000_0000_v0_0_s_ifspec; + +#ifndef __ILogPrintOutControl_INTERFACE_DEFINED__ +#define __ILogPrintOutControl_INTERFACE_DEFINED__ + +/* interface ILogPrintOutControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ILogPrintOutControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("73B67834-E7BD-40B7-9730-8C13BF098B9F") + ILogPrintOutControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setVerbose( + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath, + /* [in] */ boolean aState) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE addPrintOutDestination( + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE removePrintOutDestination( + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ILogPrintOutControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ILogPrintOutControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ILogPrintOutControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ILogPrintOutControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ILogPrintOutControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ILogPrintOutControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ILogPrintOutControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ILogPrintOutControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setVerbose )( + ILogPrintOutControl * This, + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath, + /* [in] */ boolean aState); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *addPrintOutDestination )( + ILogPrintOutControl * This, + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *removePrintOutDestination )( + ILogPrintOutControl * This, + /* [in] */ DWORD aLevelType, + /* [in] */ BSTR aFilePath); + + END_INTERFACE + } ILogPrintOutControlVtbl; + + interface ILogPrintOutControl + { + CONST_VTBL struct ILogPrintOutControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ILogPrintOutControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ILogPrintOutControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ILogPrintOutControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ILogPrintOutControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ILogPrintOutControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ILogPrintOutControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ILogPrintOutControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ILogPrintOutControl_setVerbose(This,aLevelType,aFilePath,aState) \ + ( (This)->lpVtbl -> setVerbose(This,aLevelType,aFilePath,aState) ) + +#define ILogPrintOutControl_addPrintOutDestination(This,aLevelType,aFilePath) \ + ( (This)->lpVtbl -> addPrintOutDestination(This,aLevelType,aFilePath) ) + +#define ILogPrintOutControl_removePrintOutDestination(This,aLevelType,aFilePath) \ + ( (This)->lpVtbl -> removePrintOutDestination(This,aLevelType,aFilePath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ILogPrintOutControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISourceControl_INTERFACE_DEFINED__ +#define __ISourceControl_INTERFACE_DEFINED__ + +/* interface ISourceControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISourceControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1276CC17-BCA8-4200-87BB-7180EF562447") + ISourceControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfSources( + /* [out][in] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getSourceOutputMediaType( + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrOutputMediaType) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceNode( + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceNodeWithDownStreamConnection( + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSource( + /* [in] */ BSTR aSymbolicLink, + /* [out] */ IUnknown **aPtrPtrMediaSource) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceFromCaptureProcessor( + /* [in] */ IUnknown *aPtrCaptureProcessor, + /* [out] */ IUnknown **aPtrPtrMediaSource) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getSourceOutputMediaTypeFromMediaSource( + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrOutputMediaType) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceNodeFromExternalSource( + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceNodeFromExternalSourceWithDownStreamConnection( + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSourceControl( + /* [in] */ BSTR aSymbolicLink, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISourceControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISourceControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISourceControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISourceControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISourceControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISourceControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISourceControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISourceControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfSources )( + ISourceControl * This, + /* [out][in] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getSourceOutputMediaType )( + ISourceControl * This, + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrOutputMediaType); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceNode )( + ISourceControl * This, + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceNodeWithDownStreamConnection )( + ISourceControl * This, + /* [in] */ BSTR aSymbolicLink, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSource )( + ISourceControl * This, + /* [in] */ BSTR aSymbolicLink, + /* [out] */ IUnknown **aPtrPtrMediaSource); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceFromCaptureProcessor )( + ISourceControl * This, + /* [in] */ IUnknown *aPtrCaptureProcessor, + /* [out] */ IUnknown **aPtrPtrMediaSource); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getSourceOutputMediaTypeFromMediaSource )( + ISourceControl * This, + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrOutputMediaType); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceNodeFromExternalSource )( + ISourceControl * This, + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceNodeFromExternalSourceWithDownStreamConnection )( + ISourceControl * This, + /* [in] */ IUnknown *aPtrMediaSource, + /* [in] */ DWORD aIndexStream, + /* [in] */ DWORD aIndexMediaType, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSourceControl )( + ISourceControl * This, + /* [in] */ BSTR aSymbolicLink, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl); + + END_INTERFACE + } ISourceControlVtbl; + + interface ISourceControl + { + CONST_VTBL struct ISourceControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISourceControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISourceControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISourceControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISourceControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISourceControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISourceControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISourceControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISourceControl_getCollectionOfSources(This,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfSources(This,aPtrPtrXMLstring) ) + +#define ISourceControl_getSourceOutputMediaType(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrPtrOutputMediaType) \ + ( (This)->lpVtbl -> getSourceOutputMediaType(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrPtrOutputMediaType) ) + +#define ISourceControl_createSourceNode(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createSourceNode(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrPtrTopologyNode) ) + +#define ISourceControl_createSourceNodeWithDownStreamConnection(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrDownStreamTopologyNode,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createSourceNodeWithDownStreamConnection(This,aSymbolicLink,aIndexStream,aIndexMediaType,aPtrDownStreamTopologyNode,aPtrPtrTopologyNode) ) + +#define ISourceControl_createSource(This,aSymbolicLink,aPtrPtrMediaSource) \ + ( (This)->lpVtbl -> createSource(This,aSymbolicLink,aPtrPtrMediaSource) ) + +#define ISourceControl_createSourceFromCaptureProcessor(This,aPtrCaptureProcessor,aPtrPtrMediaSource) \ + ( (This)->lpVtbl -> createSourceFromCaptureProcessor(This,aPtrCaptureProcessor,aPtrPtrMediaSource) ) + +#define ISourceControl_getSourceOutputMediaTypeFromMediaSource(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrPtrOutputMediaType) \ + ( (This)->lpVtbl -> getSourceOutputMediaTypeFromMediaSource(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrPtrOutputMediaType) ) + +#define ISourceControl_createSourceNodeFromExternalSource(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createSourceNodeFromExternalSource(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrPtrTopologyNode) ) + +#define ISourceControl_createSourceNodeFromExternalSourceWithDownStreamConnection(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrDownStreamTopologyNode,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createSourceNodeFromExternalSourceWithDownStreamConnection(This,aPtrMediaSource,aIndexStream,aIndexMediaType,aPtrDownStreamTopologyNode,aPtrPtrTopologyNode) ) + +#define ISourceControl_createSourceControl(This,aSymbolicLink,aREFIID,aPtrPtrControl) \ + ( (This)->lpVtbl -> createSourceControl(This,aSymbolicLink,aREFIID,aPtrPtrControl) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISourceControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISinkControl_INTERFACE_DEFINED__ +#define __ISinkControl_INTERFACE_DEFINED__ + +/* interface ISinkControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISinkControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C6BA3732-197E-438B-8E73-277759A7B58F") + ISinkControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfSinks( + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSinkFactory( + /* [in] */ REFGUID aRefContainerTypeGUID, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrSink) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISinkControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISinkControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISinkControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISinkControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISinkControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISinkControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISinkControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISinkControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfSinks )( + ISinkControl * This, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSinkFactory )( + ISinkControl * This, + /* [in] */ REFGUID aRefContainerTypeGUID, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrSink); + + END_INTERFACE + } ISinkControlVtbl; + + interface ISinkControl + { + CONST_VTBL struct ISinkControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISinkControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISinkControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISinkControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISinkControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISinkControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISinkControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISinkControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISinkControl_getCollectionOfSinks(This,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfSinks(This,aPtrPtrXMLstring) ) + +#define ISinkControl_createSinkFactory(This,aRefContainerTypeGUID,aREFIID,aPtrPtrSink) \ + ( (This)->lpVtbl -> createSinkFactory(This,aRefContainerTypeGUID,aREFIID,aPtrPtrSink) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISinkControl_INTERFACE_DEFINED__ */ + + +#ifndef __IFileSinkFactory_INTERFACE_DEFINED__ +#define __IFileSinkFactory_INTERFACE_DEFINED__ + +/* interface IFileSinkFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IFileSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D6E342E3-7DDD-4858-AB91-4253643864C2") + IFileSinkFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNodes( + /* [in] */ VARIANT aArrayPtrCompressedMediaTypes, + /* [in] */ BSTR aPtrFileName, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IFileSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IFileSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IFileSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IFileSinkFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IFileSinkFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IFileSinkFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IFileSinkFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IFileSinkFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNodes )( + IFileSinkFactory * This, + /* [in] */ VARIANT aArrayPtrCompressedMediaTypes, + /* [in] */ BSTR aPtrFileName, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes); + + END_INTERFACE + } IFileSinkFactoryVtbl; + + interface IFileSinkFactory + { + CONST_VTBL struct IFileSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IFileSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IFileSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IFileSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IFileSinkFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IFileSinkFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IFileSinkFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IFileSinkFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IFileSinkFactory_createOutputNodes(This,aArrayPtrCompressedMediaTypes,aPtrFileName,aPtrArrayPtrTopologyOutputNodes) \ + ( (This)->lpVtbl -> createOutputNodes(This,aArrayPtrCompressedMediaTypes,aPtrFileName,aPtrArrayPtrTopologyOutputNodes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IFileSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabberCallSinkFactory_INTERFACE_DEFINED__ +#define __ISampleGrabberCallSinkFactory_INTERFACE_DEFINED__ + +/* interface ISampleGrabberCallSinkFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabberCallSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("759D24FF-C5D6-4B65-8DDF-8A2B2BECDE39") + ISampleGrabberCallSinkFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNode( + /* [in] */ REFGUID aRefMajorType, + /* [in] */ REFGUID aRefSubType, + /* [in] */ DWORD aSampleByteSize, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrISampleGrabberCall) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISampleGrabberCallSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabberCallSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabberCallSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabberCallSinkFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISampleGrabberCallSinkFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISampleGrabberCallSinkFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISampleGrabberCallSinkFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISampleGrabberCallSinkFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNode )( + ISampleGrabberCallSinkFactory * This, + /* [in] */ REFGUID aRefMajorType, + /* [in] */ REFGUID aRefSubType, + /* [in] */ DWORD aSampleByteSize, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrISampleGrabberCall); + + END_INTERFACE + } ISampleGrabberCallSinkFactoryVtbl; + + interface ISampleGrabberCallSinkFactory + { + CONST_VTBL struct ISampleGrabberCallSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabberCallSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISampleGrabberCallSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISampleGrabberCallSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISampleGrabberCallSinkFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISampleGrabberCallSinkFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISampleGrabberCallSinkFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISampleGrabberCallSinkFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISampleGrabberCallSinkFactory_createOutputNode(This,aRefMajorType,aRefSubType,aSampleByteSize,aREFIID,aPtrPtrISampleGrabberCall) \ + ( (This)->lpVtbl -> createOutputNode(This,aRefMajorType,aRefSubType,aSampleByteSize,aREFIID,aPtrPtrISampleGrabberCall) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISampleGrabberCallSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabberCall_INTERFACE_DEFINED__ +#define __ISampleGrabberCall_INTERFACE_DEFINED__ + +/* interface ISampleGrabberCall */ +/* [dual][helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabberCall; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("118AD3F7-D9A3-4146-AB35-F16421DC995E") + ISampleGrabberCall : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE readData( + /* [in] */ LPVOID aPtrData, + /* [out] */ DWORD *aByteSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISampleGrabberCallVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabberCall * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabberCall * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabberCall * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISampleGrabberCall * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISampleGrabberCall * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISampleGrabberCall * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISampleGrabberCall * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *readData )( + ISampleGrabberCall * This, + /* [in] */ LPVOID aPtrData, + /* [out] */ DWORD *aByteSize); + + END_INTERFACE + } ISampleGrabberCallVtbl; + + interface ISampleGrabberCall + { + CONST_VTBL struct ISampleGrabberCallVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabberCall_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISampleGrabberCall_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISampleGrabberCall_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISampleGrabberCall_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISampleGrabberCall_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISampleGrabberCall_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISampleGrabberCall_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISampleGrabberCall_readData(This,aPtrData,aByteSize) \ + ( (This)->lpVtbl -> readData(This,aPtrData,aByteSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISampleGrabberCall_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabberCallbackSinkFactory_INTERFACE_DEFINED__ +#define __ISampleGrabberCallbackSinkFactory_INTERFACE_DEFINED__ + +/* interface ISampleGrabberCallbackSinkFactory */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabberCallbackSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3D64C48E-EDA4-4EE1-8436-58B64DD7CF13") + ISampleGrabberCallbackSinkFactory : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNode( + /* [in] */ REFGUID aRefMajorType, + /* [in] */ REFGUID aRefSubType, + /* [in] */ IUnknown *aPtrISampleGrabberCallback, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISampleGrabberCallbackSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabberCallbackSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabberCallbackSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabberCallbackSinkFactory * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNode )( + ISampleGrabberCallbackSinkFactory * This, + /* [in] */ REFGUID aRefMajorType, + /* [in] */ REFGUID aRefSubType, + /* [in] */ IUnknown *aPtrISampleGrabberCallback, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + END_INTERFACE + } ISampleGrabberCallbackSinkFactoryVtbl; + + interface ISampleGrabberCallbackSinkFactory + { + CONST_VTBL struct ISampleGrabberCallbackSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabberCallbackSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISampleGrabberCallbackSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISampleGrabberCallbackSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISampleGrabberCallbackSinkFactory_createOutputNode(This,aRefMajorType,aRefSubType,aPtrISampleGrabberCallback,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createOutputNode(This,aRefMajorType,aRefSubType,aPtrISampleGrabberCallback,aPtrPtrTopologyNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISampleGrabberCallbackSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabberCallback_INTERFACE_DEFINED__ +#define __ISampleGrabberCallback_INTERFACE_DEFINED__ + +/* interface ISampleGrabberCallback */ +/* [helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabberCallback; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C52F4DC9-BD3F-45FC-9839-1340AEFD25AF") + ISampleGrabberCallback : public IUnknown + { + public: + virtual /* [local][helpstring] */ HRESULT STDMETHODCALLTYPE invoke( + /* [in] */ REFGUID aGUIDMajorMediaType, + /* [in] */ DWORD aSampleFlags, + /* [in] */ LONGLONG aSampleTime, + /* [in] */ LONGLONG aSampleDuration, + /* [in] */ LPVOID aPtrSampleBuffer, + /* [in] */ DWORD aSampleSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISampleGrabberCallbackVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabberCallback * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabberCallback * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabberCallback * This); + + /* [local][helpstring] */ HRESULT ( STDMETHODCALLTYPE *invoke )( + ISampleGrabberCallback * This, + /* [in] */ REFGUID aGUIDMajorMediaType, + /* [in] */ DWORD aSampleFlags, + /* [in] */ LONGLONG aSampleTime, + /* [in] */ LONGLONG aSampleDuration, + /* [in] */ LPVOID aPtrSampleBuffer, + /* [in] */ DWORD aSampleSize); + + END_INTERFACE + } ISampleGrabberCallbackVtbl; + + interface ISampleGrabberCallback + { + CONST_VTBL struct ISampleGrabberCallbackVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabberCallback_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISampleGrabberCallback_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISampleGrabberCallback_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISampleGrabberCallback_invoke(This,aGUIDMajorMediaType,aSampleFlags,aSampleTime,aSampleDuration,aPtrSampleBuffer,aSampleSize) \ + ( (This)->lpVtbl -> invoke(This,aGUIDMajorMediaType,aSampleFlags,aSampleTime,aSampleDuration,aPtrSampleBuffer,aSampleSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISampleGrabberCallback_INTERFACE_DEFINED__ */ + + +#ifndef __IEVRSinkFactory_INTERFACE_DEFINED__ +#define __IEVRSinkFactory_INTERFACE_DEFINED__ + +/* interface IEVRSinkFactory */ +/* [dual][helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IEVRSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2F34AF87-D349-45AA-A5F1-E4104D5C458E") + IEVRSinkFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNode( + /* [in] */ LPVOID aHWND, + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IEVRSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEVRSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEVRSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEVRSinkFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IEVRSinkFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IEVRSinkFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IEVRSinkFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IEVRSinkFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNode )( + IEVRSinkFactory * This, + /* [in] */ LPVOID aHWND, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + END_INTERFACE + } IEVRSinkFactoryVtbl; + + interface IEVRSinkFactory + { + CONST_VTBL struct IEVRSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEVRSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IEVRSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IEVRSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IEVRSinkFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IEVRSinkFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IEVRSinkFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IEVRSinkFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IEVRSinkFactory_createOutputNode(This,aHWND,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createOutputNode(This,aHWND,aPtrPtrTopologyNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IEVRSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __IEVRMultiSinkFactory_INTERFACE_DEFINED__ +#define __IEVRMultiSinkFactory_INTERFACE_DEFINED__ + +/* interface IEVRMultiSinkFactory */ +/* [dual][helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IEVRMultiSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("10E52132-A73F-4A9E-A91B-FE18C91D6837") + IEVRMultiSinkFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNodes( + /* [in] */ LPVOID aHandle, + /* [in] */ IUnknown *aPtrUnkTarget, + /* [in] */ DWORD aOutputNodeAmount, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IEVRMultiSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEVRMultiSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEVRMultiSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEVRMultiSinkFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IEVRMultiSinkFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IEVRMultiSinkFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IEVRMultiSinkFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IEVRMultiSinkFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNodes )( + IEVRMultiSinkFactory * This, + /* [in] */ LPVOID aHandle, + /* [in] */ IUnknown *aPtrUnkTarget, + /* [in] */ DWORD aOutputNodeAmount, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes); + + END_INTERFACE + } IEVRMultiSinkFactoryVtbl; + + interface IEVRMultiSinkFactory + { + CONST_VTBL struct IEVRMultiSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEVRMultiSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IEVRMultiSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IEVRMultiSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IEVRMultiSinkFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IEVRMultiSinkFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IEVRMultiSinkFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IEVRMultiSinkFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IEVRMultiSinkFactory_createOutputNodes(This,aHandle,aPtrUnkTarget,aOutputNodeAmount,aPtrArrayPtrTopologyOutputNodes) \ + ( (This)->lpVtbl -> createOutputNodes(This,aHandle,aPtrUnkTarget,aOutputNodeAmount,aPtrArrayPtrTopologyOutputNodes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IEVRMultiSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __IMediaTypeParser_INTERFACE_DEFINED__ +#define __IMediaTypeParser_INTERFACE_DEFINED__ + +/* interface IMediaTypeParser */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IMediaTypeParser; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("74F0DC2B-E470-4359-A1E7-467B521BDFE1") + IMediaTypeParser : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE parse( + /* [in] */ IUnknown *aPtrMediaType, + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IMediaTypeParserVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMediaTypeParser * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMediaTypeParser * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMediaTypeParser * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMediaTypeParser * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMediaTypeParser * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMediaTypeParser * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMediaTypeParser * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *parse )( + IMediaTypeParser * This, + /* [in] */ IUnknown *aPtrMediaType, + /* [out] */ BSTR *aPtrPtrXMLstring); + + END_INTERFACE + } IMediaTypeParserVtbl; + + interface IMediaTypeParser + { + CONST_VTBL struct IMediaTypeParserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMediaTypeParser_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IMediaTypeParser_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IMediaTypeParser_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IMediaTypeParser_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IMediaTypeParser_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IMediaTypeParser_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IMediaTypeParser_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IMediaTypeParser_parse(This,aPtrMediaType,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> parse(This,aPtrMediaType,aPtrPtrXMLstring) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IMediaTypeParser_INTERFACE_DEFINED__ */ + + +#ifndef __IStrideForBitmap_INTERFACE_DEFINED__ +#define __IStrideForBitmap_INTERFACE_DEFINED__ + +/* interface IStrideForBitmap */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IStrideForBitmap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("74D903C9-69E6-4FC7-BF7A-9F47605C52BE") + IStrideForBitmap : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getStrideForBitmap( + /* [in] */ REFGUID aMFVideoFormat, + /* [in] */ DWORD aWidthInPixels, + /* [out] */ LONG *aPtrStride) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IStrideForBitmapVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IStrideForBitmap * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IStrideForBitmap * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IStrideForBitmap * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IStrideForBitmap * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IStrideForBitmap * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IStrideForBitmap * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IStrideForBitmap * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getStrideForBitmap )( + IStrideForBitmap * This, + /* [in] */ REFGUID aMFVideoFormat, + /* [in] */ DWORD aWidthInPixels, + /* [out] */ LONG *aPtrStride); + + END_INTERFACE + } IStrideForBitmapVtbl; + + interface IStrideForBitmap + { + CONST_VTBL struct IStrideForBitmapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IStrideForBitmap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IStrideForBitmap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IStrideForBitmap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IStrideForBitmap_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IStrideForBitmap_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IStrideForBitmap_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IStrideForBitmap_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IStrideForBitmap_getStrideForBitmap(This,aMFVideoFormat,aWidthInPixels,aPtrStride) \ + ( (This)->lpVtbl -> getStrideForBitmap(This,aMFVideoFormat,aWidthInPixels,aPtrStride) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IStrideForBitmap_INTERFACE_DEFINED__ */ + + +#ifndef __IStreamControl_INTERFACE_DEFINED__ +#define __IStreamControl_INTERFACE_DEFINED__ + +/* interface IStreamControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IStreamControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E8F25B4A-8C71-4C9E-BD8C-82260DC4C21B") + IStreamControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfStreamControlNodeFactories( + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createStreamControlNodeFactory( + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrStreamControlNodeFactory) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IStreamControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IStreamControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IStreamControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IStreamControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IStreamControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IStreamControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IStreamControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IStreamControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfStreamControlNodeFactories )( + IStreamControl * This, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createStreamControlNodeFactory )( + IStreamControl * This, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrStreamControlNodeFactory); + + END_INTERFACE + } IStreamControlVtbl; + + interface IStreamControl + { + CONST_VTBL struct IStreamControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IStreamControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IStreamControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IStreamControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IStreamControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IStreamControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IStreamControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IStreamControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IStreamControl_getCollectionOfStreamControlNodeFactories(This,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfStreamControlNodeFactories(This,aPtrPtrXMLstring) ) + +#define IStreamControl_createStreamControlNodeFactory(This,aREFIID,aPtrPtrStreamControlNodeFactory) \ + ( (This)->lpVtbl -> createStreamControlNodeFactory(This,aREFIID,aPtrPtrStreamControlNodeFactory) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IStreamControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISpreaderNodeFactory_INTERFACE_DEFINED__ +#define __ISpreaderNodeFactory_INTERFACE_DEFINED__ + +/* interface ISpreaderNodeFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISpreaderNodeFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("85DFAAA1-4CC0-4A88-AE28-8F492E552CCA") + ISpreaderNodeFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSpreaderNode( + /* [in] */ VARIANT aArrayPtrDownStreamTopologyNodes, + /* [out] */ IUnknown **aPtrPtrTopologySpreaderNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISpreaderNodeFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISpreaderNodeFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISpreaderNodeFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISpreaderNodeFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISpreaderNodeFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISpreaderNodeFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISpreaderNodeFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISpreaderNodeFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSpreaderNode )( + ISpreaderNodeFactory * This, + /* [in] */ VARIANT aArrayPtrDownStreamTopologyNodes, + /* [out] */ IUnknown **aPtrPtrTopologySpreaderNode); + + END_INTERFACE + } ISpreaderNodeFactoryVtbl; + + interface ISpreaderNodeFactory + { + CONST_VTBL struct ISpreaderNodeFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISpreaderNodeFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISpreaderNodeFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISpreaderNodeFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISpreaderNodeFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISpreaderNodeFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISpreaderNodeFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISpreaderNodeFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISpreaderNodeFactory_createSpreaderNode(This,aArrayPtrDownStreamTopologyNodes,aPtrPtrTopologySpreaderNode) \ + ( (This)->lpVtbl -> createSpreaderNode(This,aArrayPtrDownStreamTopologyNodes,aPtrPtrTopologySpreaderNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISpreaderNodeFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISwitcherNodeFactory_INTERFACE_DEFINED__ +#define __ISwitcherNodeFactory_INTERFACE_DEFINED__ + +/* interface ISwitcherNodeFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISwitcherNodeFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B8187D19-EBFD-4F8D-80D9-A15EBA3B369C") + ISwitcherNodeFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSwitcherNode( + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologySwitcherNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISwitcherNodeFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISwitcherNodeFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISwitcherNodeFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISwitcherNodeFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISwitcherNodeFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISwitcherNodeFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISwitcherNodeFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISwitcherNodeFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSwitcherNode )( + ISwitcherNodeFactory * This, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [out] */ IUnknown **aPtrPtrTopologySwitcherNode); + + END_INTERFACE + } ISwitcherNodeFactoryVtbl; + + interface ISwitcherNodeFactory + { + CONST_VTBL struct ISwitcherNodeFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISwitcherNodeFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISwitcherNodeFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISwitcherNodeFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISwitcherNodeFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISwitcherNodeFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISwitcherNodeFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISwitcherNodeFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISwitcherNodeFactory_createSwitcherNode(This,aPtrDownStreamTopologyNode,aPtrPtrTopologySwitcherNode) \ + ( (This)->lpVtbl -> createSwitcherNode(This,aPtrDownStreamTopologyNode,aPtrPtrTopologySwitcherNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISwitcherNodeFactory_INTERFACE_DEFINED__ */ + + +#ifndef __IMixerNodeFactory_INTERFACE_DEFINED__ +#define __IMixerNodeFactory_INTERFACE_DEFINED__ + +/* interface IMixerNodeFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IMixerNodeFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A213FD96-223C-479B-9EF4-F2864F5D001D") + IMixerNodeFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createMixerNodes( + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [in] */ DWORD aInputNodeAmount, + /* [out] */ VARIANT *aPtrArrayPtrTopologyInputNodes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IMixerNodeFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMixerNodeFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMixerNodeFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMixerNodeFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMixerNodeFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMixerNodeFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMixerNodeFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMixerNodeFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createMixerNodes )( + IMixerNodeFactory * This, + /* [in] */ IUnknown *aPtrDownStreamTopologyNode, + /* [in] */ DWORD aInputNodeAmount, + /* [out] */ VARIANT *aPtrArrayPtrTopologyInputNodes); + + END_INTERFACE + } IMixerNodeFactoryVtbl; + + interface IMixerNodeFactory + { + CONST_VTBL struct IMixerNodeFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMixerNodeFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IMixerNodeFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IMixerNodeFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IMixerNodeFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IMixerNodeFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IMixerNodeFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IMixerNodeFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IMixerNodeFactory_createMixerNodes(This,aPtrDownStreamTopologyNode,aInputNodeAmount,aPtrArrayPtrTopologyInputNodes) \ + ( (This)->lpVtbl -> createMixerNodes(This,aPtrDownStreamTopologyNode,aInputNodeAmount,aPtrArrayPtrTopologyInputNodes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IMixerNodeFactory_INTERFACE_DEFINED__ */ + + +#ifndef __IEncoderControl_INTERFACE_DEFINED__ +#define __IEncoderControl_INTERFACE_DEFINED__ + +/* interface IEncoderControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IEncoderControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96223507-D8FF-4EC1-B125-71AA7F9726A4") + IEncoderControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfEncoders( + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getMediaTypeCollectionOfEncoder( + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFCLSID aRefEncoderCLSID, + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createEncoderNodeFactory( + /* [in] */ REFCLSID aRefEncoderCLSID, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrEncoderNodeFactory) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IEncoderControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEncoderControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEncoderControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEncoderControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IEncoderControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IEncoderControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IEncoderControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IEncoderControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfEncoders )( + IEncoderControl * This, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getMediaTypeCollectionOfEncoder )( + IEncoderControl * This, + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFCLSID aRefEncoderCLSID, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createEncoderNodeFactory )( + IEncoderControl * This, + /* [in] */ REFCLSID aRefEncoderCLSID, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrEncoderNodeFactory); + + END_INTERFACE + } IEncoderControlVtbl; + + interface IEncoderControl + { + CONST_VTBL struct IEncoderControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEncoderControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IEncoderControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IEncoderControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IEncoderControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IEncoderControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IEncoderControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IEncoderControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IEncoderControl_getCollectionOfEncoders(This,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfEncoders(This,aPtrPtrXMLstring) ) + +#define IEncoderControl_getMediaTypeCollectionOfEncoder(This,aPtrUncompressedMediaType,aRefEncoderCLSID,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getMediaTypeCollectionOfEncoder(This,aPtrUncompressedMediaType,aRefEncoderCLSID,aPtrPtrXMLstring) ) + +#define IEncoderControl_createEncoderNodeFactory(This,aRefEncoderCLSID,aREFIID,aPtrPtrEncoderNodeFactory) \ + ( (This)->lpVtbl -> createEncoderNodeFactory(This,aRefEncoderCLSID,aREFIID,aPtrPtrEncoderNodeFactory) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IEncoderControl_INTERFACE_DEFINED__ */ + + +#ifndef __IEncoderNodeFactory_INTERFACE_DEFINED__ +#define __IEncoderNodeFactory_INTERFACE_DEFINED__ + +/* interface IEncoderNodeFactory */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IEncoderNodeFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A56E11D8-D602-4792-8570-38C283FC0AA3") + IEncoderNodeFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createCompressedMediaType( + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFGUID aRefEncodingModeGUID, + /* [in] */ DWORD aEncodingModeValue, + /* [in] */ DWORD aIndexCompressedMediaType, + /* [out] */ IUnknown **aPtrPtrCompressedMediaType) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createEncoderNode( + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFGUID aRefEncodingModeGUID, + /* [in] */ DWORD aEncodingModeValue, + /* [in] */ DWORD aIndexCompressedMediaType, + /* [in] */ IUnknown *aPtrDownStreamNode, + /* [out] */ IUnknown **aPtrPtrEncoderNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IEncoderNodeFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEncoderNodeFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEncoderNodeFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEncoderNodeFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IEncoderNodeFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IEncoderNodeFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IEncoderNodeFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IEncoderNodeFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createCompressedMediaType )( + IEncoderNodeFactory * This, + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFGUID aRefEncodingModeGUID, + /* [in] */ DWORD aEncodingModeValue, + /* [in] */ DWORD aIndexCompressedMediaType, + /* [out] */ IUnknown **aPtrPtrCompressedMediaType); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createEncoderNode )( + IEncoderNodeFactory * This, + /* [in] */ IUnknown *aPtrUncompressedMediaType, + /* [in] */ REFGUID aRefEncodingModeGUID, + /* [in] */ DWORD aEncodingModeValue, + /* [in] */ DWORD aIndexCompressedMediaType, + /* [in] */ IUnknown *aPtrDownStreamNode, + /* [out] */ IUnknown **aPtrPtrEncoderNode); + + END_INTERFACE + } IEncoderNodeFactoryVtbl; + + interface IEncoderNodeFactory + { + CONST_VTBL struct IEncoderNodeFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEncoderNodeFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IEncoderNodeFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IEncoderNodeFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IEncoderNodeFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IEncoderNodeFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IEncoderNodeFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IEncoderNodeFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IEncoderNodeFactory_createCompressedMediaType(This,aPtrUncompressedMediaType,aRefEncodingModeGUID,aEncodingModeValue,aIndexCompressedMediaType,aPtrPtrCompressedMediaType) \ + ( (This)->lpVtbl -> createCompressedMediaType(This,aPtrUncompressedMediaType,aRefEncodingModeGUID,aEncodingModeValue,aIndexCompressedMediaType,aPtrPtrCompressedMediaType) ) + +#define IEncoderNodeFactory_createEncoderNode(This,aPtrUncompressedMediaType,aRefEncodingModeGUID,aEncodingModeValue,aIndexCompressedMediaType,aPtrDownStreamNode,aPtrPtrEncoderNode) \ + ( (This)->lpVtbl -> createEncoderNode(This,aPtrUncompressedMediaType,aRefEncodingModeGUID,aEncodingModeValue,aIndexCompressedMediaType,aPtrDownStreamNode,aPtrPtrEncoderNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IEncoderNodeFactory_INTERFACE_DEFINED__ */ + + +#ifndef __IWebCamControl_INTERFACE_DEFINED__ +#define __IWebCamControl_INTERFACE_DEFINED__ + +/* interface IWebCamControl */ +/* [helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IWebCamControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3BD92C4C-5E06-4901-AE0B-D97E3902EAFC") + IWebCamControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCamParametrs( + /* [out] */ BSTR *aXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCamParametr( + /* [in] */ DWORD aParametrIndex, + /* [out] */ LONG *aCurrentValue, + /* [out] */ LONG *aMin, + /* [out] */ LONG *aMax, + /* [out] */ LONG *aStep, + /* [out] */ LONG *aDefault, + /* [out] */ LONG *aFlag) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setCamParametr( + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue, + /* [in] */ LONG aFlag) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IWebCamControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IWebCamControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IWebCamControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IWebCamControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IWebCamControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IWebCamControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IWebCamControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IWebCamControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCamParametrs )( + IWebCamControl * This, + /* [out] */ BSTR *aXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCamParametr )( + IWebCamControl * This, + /* [in] */ DWORD aParametrIndex, + /* [out] */ LONG *aCurrentValue, + /* [out] */ LONG *aMin, + /* [out] */ LONG *aMax, + /* [out] */ LONG *aStep, + /* [out] */ LONG *aDefault, + /* [out] */ LONG *aFlag); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setCamParametr )( + IWebCamControl * This, + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue, + /* [in] */ LONG aFlag); + + END_INTERFACE + } IWebCamControlVtbl; + + interface IWebCamControl + { + CONST_VTBL struct IWebCamControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IWebCamControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IWebCamControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IWebCamControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IWebCamControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IWebCamControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IWebCamControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IWebCamControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IWebCamControl_getCamParametrs(This,aXMLstring) \ + ( (This)->lpVtbl -> getCamParametrs(This,aXMLstring) ) + +#define IWebCamControl_getCamParametr(This,aParametrIndex,aCurrentValue,aMin,aMax,aStep,aDefault,aFlag) \ + ( (This)->lpVtbl -> getCamParametr(This,aParametrIndex,aCurrentValue,aMin,aMax,aStep,aDefault,aFlag) ) + +#define IWebCamControl_setCamParametr(This,aParametrIndex,aNewValue,aFlag) \ + ( (This)->lpVtbl -> setCamParametr(This,aParametrIndex,aNewValue,aFlag) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IWebCamControl_INTERFACE_DEFINED__ */ + + +#ifndef __IByteStreamSinkFactory_INTERFACE_DEFINED__ +#define __IByteStreamSinkFactory_INTERFACE_DEFINED__ + +/* interface IByteStreamSinkFactory */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IByteStreamSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2E891049-964A-4D08-8F36-95CE8CB0DE9B") + IByteStreamSinkFactory : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNodes( + /* [in] */ VARIANT aArrayPtrCompressedMediaTypes, + /* [in] */ IUnknown *aPtrByteStream, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IByteStreamSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IByteStreamSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IByteStreamSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IByteStreamSinkFactory * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNodes )( + IByteStreamSinkFactory * This, + /* [in] */ VARIANT aArrayPtrCompressedMediaTypes, + /* [in] */ IUnknown *aPtrByteStream, + /* [out] */ VARIANT *aPtrArrayPtrTopologyOutputNodes); + + END_INTERFACE + } IByteStreamSinkFactoryVtbl; + + interface IByteStreamSinkFactory + { + CONST_VTBL struct IByteStreamSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IByteStreamSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IByteStreamSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IByteStreamSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IByteStreamSinkFactory_createOutputNodes(This,aArrayPtrCompressedMediaTypes,aPtrByteStream,aPtrArrayPtrTopologyOutputNodes) \ + ( (This)->lpVtbl -> createOutputNodes(This,aArrayPtrCompressedMediaTypes,aPtrByteStream,aPtrArrayPtrTopologyOutputNodes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IByteStreamSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISessionControl_INTERFACE_DEFINED__ +#define __ISessionControl_INTERFACE_DEFINED__ + +/* interface ISessionControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISessionControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D0C58520-A941-4C0F-81B0-3ED8A4DE11ED") + ISessionControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createSession( + /* [in] */ VARIANT aArrayPtrSourceNodesOfTopology, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISessionControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISessionControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISessionControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISessionControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISessionControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISessionControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISessionControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISessionControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createSession )( + ISessionControl * This, + /* [in] */ VARIANT aArrayPtrSourceNodesOfTopology, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrSession); + + END_INTERFACE + } ISessionControlVtbl; + + interface ISessionControl + { + CONST_VTBL struct ISessionControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISessionControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISessionControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISessionControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISessionControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISessionControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISessionControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISessionControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISessionControl_createSession(This,aArrayPtrSourceNodesOfTopology,aREFIID,aPtrPtrSession) \ + ( (This)->lpVtbl -> createSession(This,aArrayPtrSourceNodesOfTopology,aREFIID,aPtrPtrSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISessionControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISession_INTERFACE_DEFINED__ +#define __ISession_INTERFACE_DEFINED__ + +/* interface ISession */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("742AC001-D1E0-40A8-8EFE-BA1A550F8805") + ISession : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE startSession( + /* [in] */ LONGLONG aStartPositionInHundredNanosecondUnits, + /* [in] */ REFGUID aGUIDTimeFormat) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE stopSession( void) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE pauseSession( void) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE closeSession( void) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getSessionDescriptor( + /* [out] */ DWORD *aPtrSessionDescriptor) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getIConnectionPointContainer( + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISessionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISession * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISession * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISession * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISession * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISession * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISession * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISession * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *startSession )( + ISession * This, + /* [in] */ LONGLONG aStartPositionInHundredNanosecondUnits, + /* [in] */ REFGUID aGUIDTimeFormat); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *stopSession )( + ISession * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *pauseSession )( + ISession * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *closeSession )( + ISession * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getSessionDescriptor )( + ISession * This, + /* [out] */ DWORD *aPtrSessionDescriptor); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getIConnectionPointContainer )( + ISession * This, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl); + + END_INTERFACE + } ISessionVtbl; + + interface ISession + { + CONST_VTBL struct ISessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISession_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISession_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISession_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISession_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISession_startSession(This,aStartPositionInHundredNanosecondUnits,aGUIDTimeFormat) \ + ( (This)->lpVtbl -> startSession(This,aStartPositionInHundredNanosecondUnits,aGUIDTimeFormat) ) + +#define ISession_stopSession(This) \ + ( (This)->lpVtbl -> stopSession(This) ) + +#define ISession_pauseSession(This) \ + ( (This)->lpVtbl -> pauseSession(This) ) + +#define ISession_closeSession(This) \ + ( (This)->lpVtbl -> closeSession(This) ) + +#define ISession_getSessionDescriptor(This,aPtrSessionDescriptor) \ + ( (This)->lpVtbl -> getSessionDescriptor(This,aPtrSessionDescriptor) ) + +#define ISession_getIConnectionPointContainer(This,aREFIID,aPtrPtrControl) \ + ( (This)->lpVtbl -> getIConnectionPointContainer(This,aREFIID,aPtrPtrControl) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISession_INTERFACE_DEFINED__ */ + + +#ifndef __ISessionCallback_INTERFACE_DEFINED__ +#define __ISessionCallback_INTERFACE_DEFINED__ + +/* interface ISessionCallback */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISessionCallback; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("522E9849-E3A8-4FD0-853F-97D9B02B0E72") + ISessionCallback : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE invoke( + /* [in] */ DWORD aCallbackEventCode, + /* [in] */ DWORD aSessionDescriptor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISessionCallbackVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISessionCallback * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISessionCallback * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISessionCallback * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *invoke )( + ISessionCallback * This, + /* [in] */ DWORD aCallbackEventCode, + /* [in] */ DWORD aSessionDescriptor); + + END_INTERFACE + } ISessionCallbackVtbl; + + interface ISessionCallback + { + CONST_VTBL struct ISessionCallbackVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISessionCallback_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISessionCallback_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISessionCallback_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISessionCallback_invoke(This,aCallbackEventCode,aSessionDescriptor) \ + ( (This)->lpVtbl -> invoke(This,aCallbackEventCode,aSessionDescriptor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISessionCallback_INTERFACE_DEFINED__ */ + + +#ifndef __ICaptureManagerControl_INTERFACE_DEFINED__ +#define __ICaptureManagerControl_INTERFACE_DEFINED__ + +/* interface ICaptureManagerControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ICaptureManagerControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D4F5F10A-8F70-43CF-8CF1-EC331DA2F829") + ICaptureManagerControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createControl( + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createMisc( + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrMisc) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICaptureManagerControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICaptureManagerControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICaptureManagerControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICaptureManagerControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ICaptureManagerControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ICaptureManagerControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ICaptureManagerControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ICaptureManagerControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createControl )( + ICaptureManagerControl * This, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrControl); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createMisc )( + ICaptureManagerControl * This, + /* [in] */ REFIID aREFIID, + /* [out] */ IUnknown **aPtrPtrMisc); + + END_INTERFACE + } ICaptureManagerControlVtbl; + + interface ICaptureManagerControl + { + CONST_VTBL struct ICaptureManagerControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICaptureManagerControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICaptureManagerControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICaptureManagerControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICaptureManagerControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ICaptureManagerControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ICaptureManagerControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ICaptureManagerControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ICaptureManagerControl_createControl(This,aREFIID,aPtrPtrControl) \ + ( (This)->lpVtbl -> createControl(This,aREFIID,aPtrPtrControl) ) + +#define ICaptureManagerControl_createMisc(This,aREFIID,aPtrPtrMisc) \ + ( (This)->lpVtbl -> createMisc(This,aREFIID,aPtrPtrMisc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICaptureManagerControl_INTERFACE_DEFINED__ */ + + +#ifndef __IVersionControl_INTERFACE_DEFINED__ +#define __IVersionControl_INTERFACE_DEFINED__ + +/* interface IVersionControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IVersionControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39DC3AEF-3B59-4C0D-A1B2-54BF2653C056") + IVersionControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getVersion( + /* [out] */ DWORD *aPtrMAJOR, + /* [out] */ DWORD *aPtrMINOR, + /* [out] */ DWORD *aPtrPATCH, + /* [out] */ BSTR *aPtrPtrAdditionalLabel) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getXMLStringVersion( + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE checkVersion( + /* [in] */ DWORD aMAJOR, + /* [in] */ DWORD aMINOR, + /* [in] */ DWORD aPATCH, + /* [out] */ boolean *aPtrResult) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IVersionControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVersionControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVersionControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVersionControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVersionControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVersionControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVersionControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVersionControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getVersion )( + IVersionControl * This, + /* [out] */ DWORD *aPtrMAJOR, + /* [out] */ DWORD *aPtrMINOR, + /* [out] */ DWORD *aPtrPATCH, + /* [out] */ BSTR *aPtrPtrAdditionalLabel); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getXMLStringVersion )( + IVersionControl * This, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *checkVersion )( + IVersionControl * This, + /* [in] */ DWORD aMAJOR, + /* [in] */ DWORD aMINOR, + /* [in] */ DWORD aPATCH, + /* [out] */ boolean *aPtrResult); + + END_INTERFACE + } IVersionControlVtbl; + + interface IVersionControl + { + CONST_VTBL struct IVersionControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVersionControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IVersionControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IVersionControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IVersionControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IVersionControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IVersionControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IVersionControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IVersionControl_getVersion(This,aPtrMAJOR,aPtrMINOR,aPtrPATCH,aPtrPtrAdditionalLabel) \ + ( (This)->lpVtbl -> getVersion(This,aPtrMAJOR,aPtrMINOR,aPtrPATCH,aPtrPtrAdditionalLabel) ) + +#define IVersionControl_getXMLStringVersion(This,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getXMLStringVersion(This,aPtrPtrXMLstring) ) + +#define IVersionControl_checkVersion(This,aMAJOR,aMINOR,aPATCH,aPtrResult) \ + ( (This)->lpVtbl -> checkVersion(This,aMAJOR,aMINOR,aPATCH,aPtrResult) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IVersionControl_INTERFACE_DEFINED__ */ + + +#ifndef __IEVRStreamControl_INTERFACE_DEFINED__ +#define __IEVRStreamControl_INTERFACE_DEFINED__ + +/* interface IEVRStreamControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IEVRStreamControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("47F9883C-77B1-4A0B-9233-B3EAFA8F387E") + IEVRStreamControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setPosition( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setZOrder( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aZOrder) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getPosition( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ FLOAT *aPtrLeft, + /* [out] */ FLOAT *aPtrRight, + /* [out] */ FLOAT *aPtrTop, + /* [out] */ FLOAT *aPtrBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getZOrder( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ DWORD *aPtrZOrder) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE flush( + /* [in] */ IUnknown *aPtrEVROutputNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setSrcPosition( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getSrcPosition( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ FLOAT *aPtrLeft, + /* [out] */ FLOAT *aPtrRight, + /* [out] */ FLOAT *aPtrTop, + /* [out] */ FLOAT *aPtrBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfFilters( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setFilterParametr( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue, + /* [in] */ BOOL aIsEnabled) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getCollectionOfOutputFeatures( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ BSTR *aPtrPtrXMLstring) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setOutputFeatureParametr( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IEVRStreamControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEVRStreamControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEVRStreamControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEVRStreamControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IEVRStreamControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IEVRStreamControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IEVRStreamControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IEVRStreamControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setPosition )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setZOrder )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aZOrder); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getPosition )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ FLOAT *aPtrLeft, + /* [out] */ FLOAT *aPtrRight, + /* [out] */ FLOAT *aPtrTop, + /* [out] */ FLOAT *aPtrBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getZOrder )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ DWORD *aPtrZOrder); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *flush )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setSrcPosition )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getSrcPosition )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ FLOAT *aPtrLeft, + /* [out] */ FLOAT *aPtrRight, + /* [out] */ FLOAT *aPtrTop, + /* [out] */ FLOAT *aPtrBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfFilters )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setFilterParametr )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue, + /* [in] */ BOOL aIsEnabled); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getCollectionOfOutputFeatures )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [out] */ BSTR *aPtrPtrXMLstring); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setOutputFeatureParametr )( + IEVRStreamControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ DWORD aParametrIndex, + /* [in] */ LONG aNewValue); + + END_INTERFACE + } IEVRStreamControlVtbl; + + interface IEVRStreamControl + { + CONST_VTBL struct IEVRStreamControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEVRStreamControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IEVRStreamControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IEVRStreamControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IEVRStreamControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IEVRStreamControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IEVRStreamControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IEVRStreamControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IEVRStreamControl_setPosition(This,aPtrEVROutputNode,aLeft,aRight,aTop,aBottom) \ + ( (This)->lpVtbl -> setPosition(This,aPtrEVROutputNode,aLeft,aRight,aTop,aBottom) ) + +#define IEVRStreamControl_setZOrder(This,aPtrEVROutputNode,aZOrder) \ + ( (This)->lpVtbl -> setZOrder(This,aPtrEVROutputNode,aZOrder) ) + +#define IEVRStreamControl_getPosition(This,aPtrEVROutputNode,aPtrLeft,aPtrRight,aPtrTop,aPtrBottom) \ + ( (This)->lpVtbl -> getPosition(This,aPtrEVROutputNode,aPtrLeft,aPtrRight,aPtrTop,aPtrBottom) ) + +#define IEVRStreamControl_getZOrder(This,aPtrEVROutputNode,aPtrZOrder) \ + ( (This)->lpVtbl -> getZOrder(This,aPtrEVROutputNode,aPtrZOrder) ) + +#define IEVRStreamControl_flush(This,aPtrEVROutputNode) \ + ( (This)->lpVtbl -> flush(This,aPtrEVROutputNode) ) + +#define IEVRStreamControl_setSrcPosition(This,aPtrEVROutputNode,aLeft,aRight,aTop,aBottom) \ + ( (This)->lpVtbl -> setSrcPosition(This,aPtrEVROutputNode,aLeft,aRight,aTop,aBottom) ) + +#define IEVRStreamControl_getSrcPosition(This,aPtrEVROutputNode,aPtrLeft,aPtrRight,aPtrTop,aPtrBottom) \ + ( (This)->lpVtbl -> getSrcPosition(This,aPtrEVROutputNode,aPtrLeft,aPtrRight,aPtrTop,aPtrBottom) ) + +#define IEVRStreamControl_getCollectionOfFilters(This,aPtrEVROutputNode,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfFilters(This,aPtrEVROutputNode,aPtrPtrXMLstring) ) + +#define IEVRStreamControl_setFilterParametr(This,aPtrEVROutputNode,aParametrIndex,aNewValue,aIsEnabled) \ + ( (This)->lpVtbl -> setFilterParametr(This,aPtrEVROutputNode,aParametrIndex,aNewValue,aIsEnabled) ) + +#define IEVRStreamControl_getCollectionOfOutputFeatures(This,aPtrEVROutputNode,aPtrPtrXMLstring) \ + ( (This)->lpVtbl -> getCollectionOfOutputFeatures(This,aPtrEVROutputNode,aPtrPtrXMLstring) ) + +#define IEVRStreamControl_setOutputFeatureParametr(This,aPtrEVROutputNode,aParametrIndex,aNewValue) \ + ( (This)->lpVtbl -> setOutputFeatureParametr(This,aPtrEVROutputNode,aParametrIndex,aNewValue) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IEVRStreamControl_INTERFACE_DEFINED__ */ + + +#ifndef __IInitilaizeCaptureSource_INTERFACE_DEFINED__ +#define __IInitilaizeCaptureSource_INTERFACE_DEFINED__ + +/* interface IInitilaizeCaptureSource */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IInitilaizeCaptureSource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("23B3BCE7-3003-48E6-9FA3-9F5F8439F3DC") + IInitilaizeCaptureSource : public IUnknown + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setPresentationDescriptor( + /* [in] */ BSTR aXMLPresentationDescriptor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IInitilaizeCaptureSourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IInitilaizeCaptureSource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IInitilaizeCaptureSource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IInitilaizeCaptureSource * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setPresentationDescriptor )( + IInitilaizeCaptureSource * This, + /* [in] */ BSTR aXMLPresentationDescriptor); + + END_INTERFACE + } IInitilaizeCaptureSourceVtbl; + + interface IInitilaizeCaptureSource + { + CONST_VTBL struct IInitilaizeCaptureSourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IInitilaizeCaptureSource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IInitilaizeCaptureSource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IInitilaizeCaptureSource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IInitilaizeCaptureSource_setPresentationDescriptor(This,aXMLPresentationDescriptor) \ + ( (This)->lpVtbl -> setPresentationDescriptor(This,aXMLPresentationDescriptor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IInitilaizeCaptureSource_INTERFACE_DEFINED__ */ + + +#ifndef __ICurrentMediaType_INTERFACE_DEFINED__ +#define __ICurrentMediaType_INTERFACE_DEFINED__ + +/* interface ICurrentMediaType */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ICurrentMediaType; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2835286D-C2AF-4A66-AEDA-3ABB8A244E86") + ICurrentMediaType : public IUnknown + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getMediaTypeIndex( + /* [out] */ DWORD *aPtrMediaTypeIndex) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getStreamIndex( + /* [out] */ DWORD *aPtrStreamIndex) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getMediaType( + /* [out] */ IUnknown **aPtrMediaType) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICurrentMediaTypeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICurrentMediaType * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICurrentMediaType * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICurrentMediaType * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getMediaTypeIndex )( + ICurrentMediaType * This, + /* [out] */ DWORD *aPtrMediaTypeIndex); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getStreamIndex )( + ICurrentMediaType * This, + /* [out] */ DWORD *aPtrStreamIndex); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getMediaType )( + ICurrentMediaType * This, + /* [out] */ IUnknown **aPtrMediaType); + + END_INTERFACE + } ICurrentMediaTypeVtbl; + + interface ICurrentMediaType + { + CONST_VTBL struct ICurrentMediaTypeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICurrentMediaType_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICurrentMediaType_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICurrentMediaType_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICurrentMediaType_getMediaTypeIndex(This,aPtrMediaTypeIndex) \ + ( (This)->lpVtbl -> getMediaTypeIndex(This,aPtrMediaTypeIndex) ) + +#define ICurrentMediaType_getStreamIndex(This,aPtrStreamIndex) \ + ( (This)->lpVtbl -> getStreamIndex(This,aPtrStreamIndex) ) + +#define ICurrentMediaType_getMediaType(This,aPtrMediaType) \ + ( (This)->lpVtbl -> getMediaType(This,aPtrMediaType) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICurrentMediaType_INTERFACE_DEFINED__ */ + + +#ifndef __ISourceRequestResult_INTERFACE_DEFINED__ +#define __ISourceRequestResult_INTERFACE_DEFINED__ + +/* interface ISourceRequestResult */ +/* [helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISourceRequestResult; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("80561D39-612C-42AF-B866-5E2B2E6F39C7") + ISourceRequestResult : public IUnknown + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setData( + /* [in] */ LPVOID aPtrData, + /* [in] */ DWORD aByteSize, + /* [in] */ BOOL aIsKeyFrame) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getStreamIndex( + /* [out] */ DWORD *aPtrStreamIndex) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISourceRequestResultVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISourceRequestResult * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISourceRequestResult * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISourceRequestResult * This); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setData )( + ISourceRequestResult * This, + /* [in] */ LPVOID aPtrData, + /* [in] */ DWORD aByteSize, + /* [in] */ BOOL aIsKeyFrame); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getStreamIndex )( + ISourceRequestResult * This, + /* [out] */ DWORD *aPtrStreamIndex); + + END_INTERFACE + } ISourceRequestResultVtbl; + + interface ISourceRequestResult + { + CONST_VTBL struct ISourceRequestResultVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISourceRequestResult_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISourceRequestResult_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISourceRequestResult_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISourceRequestResult_setData(This,aPtrData,aByteSize,aIsKeyFrame) \ + ( (This)->lpVtbl -> setData(This,aPtrData,aByteSize,aIsKeyFrame) ) + +#define ISourceRequestResult_getStreamIndex(This,aPtrStreamIndex) \ + ( (This)->lpVtbl -> getStreamIndex(This,aPtrStreamIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISourceRequestResult_INTERFACE_DEFINED__ */ + + +#ifndef __ICaptureProcessor_INTERFACE_DEFINED__ +#define __ICaptureProcessor_INTERFACE_DEFINED__ + +/* interface ICaptureProcessor */ +/* [helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ICaptureProcessor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F6591EF6-535E-4A83-BE0B-87135B173C78") + ICaptureProcessor : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE start( + /* [in] */ LONGLONG aStartPositionInHundredNanosecondUnits, + /* [in] */ REFGUID aGUIDTimeFormat) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE stop( void) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE pause( void) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE shutdown( void) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE initilaize( + /* [in] */ IUnknown *aPtrIInitilaizeCaptureSource) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE setCurrentMediaType( + /* [in] */ IUnknown *aPtrICurrentMediaType) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE sourceRequest( + /* [in] */ IUnknown *aPtrISourceRequestResult) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICaptureProcessorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICaptureProcessor * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICaptureProcessor * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICaptureProcessor * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *start )( + ICaptureProcessor * This, + /* [in] */ LONGLONG aStartPositionInHundredNanosecondUnits, + /* [in] */ REFGUID aGUIDTimeFormat); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *stop )( + ICaptureProcessor * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *pause )( + ICaptureProcessor * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *shutdown )( + ICaptureProcessor * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *initilaize )( + ICaptureProcessor * This, + /* [in] */ IUnknown *aPtrIInitilaizeCaptureSource); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *setCurrentMediaType )( + ICaptureProcessor * This, + /* [in] */ IUnknown *aPtrICurrentMediaType); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *sourceRequest )( + ICaptureProcessor * This, + /* [in] */ IUnknown *aPtrISourceRequestResult); + + END_INTERFACE + } ICaptureProcessorVtbl; + + interface ICaptureProcessor + { + CONST_VTBL struct ICaptureProcessorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICaptureProcessor_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICaptureProcessor_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICaptureProcessor_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICaptureProcessor_start(This,aStartPositionInHundredNanosecondUnits,aGUIDTimeFormat) \ + ( (This)->lpVtbl -> start(This,aStartPositionInHundredNanosecondUnits,aGUIDTimeFormat) ) + +#define ICaptureProcessor_stop(This) \ + ( (This)->lpVtbl -> stop(This) ) + +#define ICaptureProcessor_pause(This) \ + ( (This)->lpVtbl -> pause(This) ) + +#define ICaptureProcessor_shutdown(This) \ + ( (This)->lpVtbl -> shutdown(This) ) + +#define ICaptureProcessor_initilaize(This,aPtrIInitilaizeCaptureSource) \ + ( (This)->lpVtbl -> initilaize(This,aPtrIInitilaizeCaptureSource) ) + +#define ICaptureProcessor_setCurrentMediaType(This,aPtrICurrentMediaType) \ + ( (This)->lpVtbl -> setCurrentMediaType(This,aPtrICurrentMediaType) ) + +#define ICaptureProcessor_sourceRequest(This,aPtrISourceRequestResult) \ + ( (This)->lpVtbl -> sourceRequest(This,aPtrISourceRequestResult) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICaptureProcessor_INTERFACE_DEFINED__ */ + + +#ifndef __IRenderingControl_INTERFACE_DEFINED__ +#define __IRenderingControl_INTERFACE_DEFINED__ + +/* interface IRenderingControl */ +/* [helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IRenderingControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1CBCAF1C-1809-41DE-A728-23DBF86A6170") + IRenderingControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE enableInnerRendering( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ BOOL aIsInnerRendering) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE renderToTarget( + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ IUnknown *aPtrRenderTarget, + /* [in] */ BOOL aCopyMode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IRenderingControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IRenderingControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IRenderingControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IRenderingControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IRenderingControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IRenderingControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IRenderingControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IRenderingControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *enableInnerRendering )( + IRenderingControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ BOOL aIsInnerRendering); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *renderToTarget )( + IRenderingControl * This, + /* [in] */ IUnknown *aPtrEVROutputNode, + /* [in] */ IUnknown *aPtrRenderTarget, + /* [in] */ BOOL aCopyMode); + + END_INTERFACE + } IRenderingControlVtbl; + + interface IRenderingControl + { + CONST_VTBL struct IRenderingControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IRenderingControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IRenderingControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IRenderingControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IRenderingControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IRenderingControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IRenderingControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IRenderingControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IRenderingControl_enableInnerRendering(This,aPtrEVROutputNode,aIsInnerRendering) \ + ( (This)->lpVtbl -> enableInnerRendering(This,aPtrEVROutputNode,aIsInnerRendering) ) + +#define IRenderingControl_renderToTarget(This,aPtrEVROutputNode,aPtrRenderTarget,aCopyMode) \ + ( (This)->lpVtbl -> renderToTarget(This,aPtrEVROutputNode,aPtrRenderTarget,aCopyMode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IRenderingControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISwitcherControl_INTERFACE_DEFINED__ +#define __ISwitcherControl_INTERFACE_DEFINED__ + +/* interface ISwitcherControl */ +/* [helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISwitcherControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9D9FEEFB-0905-4829-866E-22AD28320183") + ISwitcherControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE pauseSwitchers( + /* [in] */ DWORD aSessionDescriptor) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE resumeSwitchers( + /* [in] */ DWORD aSessionDescriptor) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE pauseSwitcher( + /* [in] */ IUnknown *aPtrSwitcherNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE resumeSwitcher( + /* [in] */ IUnknown *aPtrSwitcherNode) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE detachSwitchers( + /* [in] */ DWORD aSessionDescriptor) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE attachSwitcher( + /* [in] */ IUnknown *aPtrSwitcherNode, + /* [in] */ IUnknown *aPtrDownStreamNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISwitcherControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISwitcherControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISwitcherControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISwitcherControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISwitcherControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISwitcherControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISwitcherControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISwitcherControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *pauseSwitchers )( + ISwitcherControl * This, + /* [in] */ DWORD aSessionDescriptor); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *resumeSwitchers )( + ISwitcherControl * This, + /* [in] */ DWORD aSessionDescriptor); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *pauseSwitcher )( + ISwitcherControl * This, + /* [in] */ IUnknown *aPtrSwitcherNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *resumeSwitcher )( + ISwitcherControl * This, + /* [in] */ IUnknown *aPtrSwitcherNode); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *detachSwitchers )( + ISwitcherControl * This, + /* [in] */ DWORD aSessionDescriptor); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *attachSwitcher )( + ISwitcherControl * This, + /* [in] */ IUnknown *aPtrSwitcherNode, + /* [in] */ IUnknown *aPtrDownStreamNode); + + END_INTERFACE + } ISwitcherControlVtbl; + + interface ISwitcherControl + { + CONST_VTBL struct ISwitcherControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISwitcherControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISwitcherControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISwitcherControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISwitcherControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISwitcherControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISwitcherControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISwitcherControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISwitcherControl_pauseSwitchers(This,aSessionDescriptor) \ + ( (This)->lpVtbl -> pauseSwitchers(This,aSessionDescriptor) ) + +#define ISwitcherControl_resumeSwitchers(This,aSessionDescriptor) \ + ( (This)->lpVtbl -> resumeSwitchers(This,aSessionDescriptor) ) + +#define ISwitcherControl_pauseSwitcher(This,aPtrSwitcherNode) \ + ( (This)->lpVtbl -> pauseSwitcher(This,aPtrSwitcherNode) ) + +#define ISwitcherControl_resumeSwitcher(This,aPtrSwitcherNode) \ + ( (This)->lpVtbl -> resumeSwitcher(This,aPtrSwitcherNode) ) + +#define ISwitcherControl_detachSwitchers(This,aSessionDescriptor) \ + ( (This)->lpVtbl -> detachSwitchers(This,aSessionDescriptor) ) + +#define ISwitcherControl_attachSwitcher(This,aPtrSwitcherNode,aPtrDownStreamNode) \ + ( (This)->lpVtbl -> attachSwitcher(This,aPtrSwitcherNode,aPtrDownStreamNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISwitcherControl_INTERFACE_DEFINED__ */ + + +#ifndef __IVideoMixerControl_INTERFACE_DEFINED__ +#define __IVideoMixerControl_INTERFACE_DEFINED__ + +/* interface IVideoMixerControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IVideoMixerControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6BFFE928-3CB4-4BE2-9107-A0FA504EF623") + IVideoMixerControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setPosition( + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setSrcPosition( + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setZOrder( + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ DWORD aZOrder) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setOpacity( + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aOpacity) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE flush( + /* [in] */ IUnknown *aPtrVideoMixerNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IVideoMixerControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVideoMixerControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVideoMixerControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVideoMixerControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVideoMixerControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVideoMixerControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVideoMixerControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVideoMixerControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setPosition )( + IVideoMixerControl * This, + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setSrcPosition )( + IVideoMixerControl * This, + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aLeft, + /* [in] */ FLOAT aRight, + /* [in] */ FLOAT aTop, + /* [in] */ FLOAT aBottom); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setZOrder )( + IVideoMixerControl * This, + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ DWORD aZOrder); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setOpacity )( + IVideoMixerControl * This, + /* [in] */ IUnknown *aPtrVideoMixerNode, + /* [in] */ FLOAT aOpacity); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *flush )( + IVideoMixerControl * This, + /* [in] */ IUnknown *aPtrVideoMixerNode); + + END_INTERFACE + } IVideoMixerControlVtbl; + + interface IVideoMixerControl + { + CONST_VTBL struct IVideoMixerControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVideoMixerControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IVideoMixerControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IVideoMixerControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IVideoMixerControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IVideoMixerControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IVideoMixerControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IVideoMixerControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IVideoMixerControl_setPosition(This,aPtrVideoMixerNode,aLeft,aRight,aTop,aBottom) \ + ( (This)->lpVtbl -> setPosition(This,aPtrVideoMixerNode,aLeft,aRight,aTop,aBottom) ) + +#define IVideoMixerControl_setSrcPosition(This,aPtrVideoMixerNode,aLeft,aRight,aTop,aBottom) \ + ( (This)->lpVtbl -> setSrcPosition(This,aPtrVideoMixerNode,aLeft,aRight,aTop,aBottom) ) + +#define IVideoMixerControl_setZOrder(This,aPtrVideoMixerNode,aZOrder) \ + ( (This)->lpVtbl -> setZOrder(This,aPtrVideoMixerNode,aZOrder) ) + +#define IVideoMixerControl_setOpacity(This,aPtrVideoMixerNode,aOpacity) \ + ( (This)->lpVtbl -> setOpacity(This,aPtrVideoMixerNode,aOpacity) ) + +#define IVideoMixerControl_flush(This,aPtrVideoMixerNode) \ + ( (This)->lpVtbl -> flush(This,aPtrVideoMixerNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IVideoMixerControl_INTERFACE_DEFINED__ */ + + +#ifndef __IAudioMixerControl_INTERFACE_DEFINED__ +#define __IAudioMixerControl_INTERFACE_DEFINED__ + +/* interface IAudioMixerControl */ +/* [dual][helpstring][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_IAudioMixerControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BD1C6DB2-E10B-4233-808D-68C4B03C15A4") + IAudioMixerControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setRelativeVolume( + /* [in] */ IUnknown *aPtrAudioMixerNode, + /* [in] */ FLOAT aRelativeVolume) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IAudioMixerControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAudioMixerControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAudioMixerControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAudioMixerControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IAudioMixerControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IAudioMixerControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IAudioMixerControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IAudioMixerControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setRelativeVolume )( + IAudioMixerControl * This, + /* [in] */ IUnknown *aPtrAudioMixerNode, + /* [in] */ FLOAT aRelativeVolume); + + END_INTERFACE + } IAudioMixerControlVtbl; + + interface IAudioMixerControl + { + CONST_VTBL struct IAudioMixerControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAudioMixerControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IAudioMixerControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IAudioMixerControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IAudioMixerControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IAudioMixerControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IAudioMixerControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IAudioMixerControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IAudioMixerControl_setRelativeVolume(This,aPtrAudioMixerNode,aRelativeVolume) \ + ( (This)->lpVtbl -> setRelativeVolume(This,aPtrAudioMixerNode,aRelativeVolume) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IAudioMixerControl_INTERFACE_DEFINED__ */ + + +#ifndef __ISARSinkFactory_INTERFACE_DEFINED__ +#define __ISARSinkFactory_INTERFACE_DEFINED__ + +/* interface ISARSinkFactory */ +/* [dual][helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISARSinkFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("62F99475-1754-4B2B-BFA5-277BDCE03C4F") + ISARSinkFactory : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE createOutputNode( + /* [out] */ IUnknown **aPtrPtrTopologyNode) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISARSinkFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISARSinkFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISARSinkFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISARSinkFactory * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISARSinkFactory * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISARSinkFactory * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISARSinkFactory * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISARSinkFactory * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *createOutputNode )( + ISARSinkFactory * This, + /* [out] */ IUnknown **aPtrPtrTopologyNode); + + END_INTERFACE + } ISARSinkFactoryVtbl; + + interface ISARSinkFactory + { + CONST_VTBL struct ISARSinkFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISARSinkFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISARSinkFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISARSinkFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISARSinkFactory_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISARSinkFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISARSinkFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISARSinkFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISARSinkFactory_createOutputNode(This,aPtrPtrTopologyNode) \ + ( (This)->lpVtbl -> createOutputNode(This,aPtrPtrTopologyNode) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISARSinkFactory_INTERFACE_DEFINED__ */ + + +#ifndef __ISARVolumeControl_INTERFACE_DEFINED__ +#define __ISARVolumeControl_INTERFACE_DEFINED__ + +/* interface ISARVolumeControl */ +/* [dual][helpstring][local][oleautomation][uuid][object] */ + + +EXTERN_C const IID IID_ISARVolumeControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9A0E43CA-D5D0-4774-8548-E31A9DDE36FB") + ISARVolumeControl : public IDispatch + { + public: + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getChannelCount( + /* [in] */ IUnknown *aPtrSARNode, + /* [out] */ UINT32 *aPtrCount) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE setChannelVolume( + /* [in] */ IUnknown *aPtrSARNode, + /* [in] */ UINT32 aIndex, + /* [in] */ const float aLevel) = 0; + + virtual /* [id][helpstring] */ HRESULT STDMETHODCALLTYPE getChannelVolume( + /* [in] */ IUnknown *aPtrSARNode, + /* [in] */ UINT32 aIndex, + /* [out] */ float *aPtrLevel) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISARVolumeControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISARVolumeControl * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISARVolumeControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISARVolumeControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISARVolumeControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISARVolumeControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISARVolumeControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISARVolumeControl * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getChannelCount )( + ISARVolumeControl * This, + /* [in] */ IUnknown *aPtrSARNode, + /* [out] */ UINT32 *aPtrCount); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *setChannelVolume )( + ISARVolumeControl * This, + /* [in] */ IUnknown *aPtrSARNode, + /* [in] */ UINT32 aIndex, + /* [in] */ const float aLevel); + + /* [id][helpstring] */ HRESULT ( STDMETHODCALLTYPE *getChannelVolume )( + ISARVolumeControl * This, + /* [in] */ IUnknown *aPtrSARNode, + /* [in] */ UINT32 aIndex, + /* [out] */ float *aPtrLevel); + + END_INTERFACE + } ISARVolumeControlVtbl; + + interface ISARVolumeControl + { + CONST_VTBL struct ISARVolumeControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISARVolumeControl_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISARVolumeControl_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISARVolumeControl_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISARVolumeControl_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISARVolumeControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISARVolumeControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISARVolumeControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISARVolumeControl_getChannelCount(This,aPtrSARNode,aPtrCount) \ + ( (This)->lpVtbl -> getChannelCount(This,aPtrSARNode,aPtrCount) ) + +#define ISARVolumeControl_setChannelVolume(This,aPtrSARNode,aIndex,aLevel) \ + ( (This)->lpVtbl -> setChannelVolume(This,aPtrSARNode,aIndex,aLevel) ) + +#define ISARVolumeControl_getChannelVolume(This,aPtrSARNode,aIndex,aPtrLevel) \ + ( (This)->lpVtbl -> getChannelVolume(This,aPtrSARNode,aIndex,aPtrLevel) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISARVolumeControl_INTERFACE_DEFINED__ */ + + + +#ifndef __CaptureManagerLibrary_LIBRARY_DEFINED__ +#define __CaptureManagerLibrary_LIBRARY_DEFINED__ + +/* library CaptureManagerLibrary */ +/* [helpstring][version][uuid] */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EXTERN_C const IID LIBID_CaptureManagerLibrary; + +EXTERN_C const CLSID CLSID_CoLogPrintOut; + +#ifdef __cplusplus + +class DECLSPEC_UUID("4563EE3E-DA1E-4911-9F40-88A284E2DD69") +CoLogPrintOut; +#endif + +EXTERN_C const CLSID CLSID_CoCaptureManager; + +#ifdef __cplusplus + +class DECLSPEC_UUID("D5F07FB8-CE60-4017-B215-95C8A0DDF42A") +CoCaptureManager; +#endif +#endif /* __CaptureManagerLibrary_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +unsigned long __RPC_USER BSTR_UserSize64( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal64( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal64(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree64( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize64( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal64( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal64(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree64( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/natives/capturemanager/CaptureManagerNativeProxy/ComPtrCustom.h b/natives/capturemanager/CaptureManagerNativeProxy/ComPtrCustom.h new file mode 100644 index 0000000..6eea326 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/ComPtrCustom.h @@ -0,0 +1,263 @@ +#pragma once + +template +class CComPtrCustom +{ +public: + + CComPtrCustom(T *aPtrElement) + :element(aPtrElement) + { + } + + CComPtrCustom() + :element(nullptr) + { + } + + virtual ~CComPtrCustom() + { + Release(); + } + + T* Detach() + { + auto lOutPtr = element; + + element = nullptr; + + return lOutPtr; + } + + T* detach() + { + return Detach(); + } + + void Release() + { + if (element == nullptr) + return; + + auto k = element->Release(); + + element = nullptr; + } + + CComPtrCustom& operator = (T *pElement) + { + Release(); + + if (pElement == nullptr) + return *this; + + auto k = pElement->AddRef(); + + element = pElement; + + return *this; + } + + void Swap(CComPtrCustom& other) + { + T* pTemp = element; + element = other.element; + other.element = pTemp; + } + + T* operator->() + { + return element; + } + + operator T*() + { + return element; + } + + operator T*() const + { + return element; + } + + + T* get() + { + return element; + } + + T* get() const + { + return element; + } + + T** operator &() + { + return &element; + } + + bool operator !()const + { + return element == nullptr; + } + + operator bool()const + { + return element != nullptr; + } + + bool operator == (const T *pElement)const + { + return element == pElement; + } + + + CComPtrCustom(const CComPtrCustom& aCComPtrCustom) + { + if (aCComPtrCustom.operator!()) + { + element = nullptr; + + return; + } + + element = aCComPtrCustom; + + auto h = element->AddRef(); + + h++; + } + + CComPtrCustom& operator = (const CComPtrCustom& aCComPtrCustom) + { + Release(); + + element = aCComPtrCustom; + + auto k = element->AddRef(); + + return *this; + } + + _Check_return_ HRESULT CopyTo(T** ppT) throw() + { + if (ppT == NULL) + return E_POINTER; + + *ppT = element; + + if (element) + element->AddRef(); + + return S_OK; + } + + HRESULT CoCreateInstance(const CLSID aCLSID) + { + T* lPtrTemp; + + auto lresult = ::CoCreateInstance(aCLSID, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&lPtrTemp)); + + if (SUCCEEDED(lresult)) + { + if (lPtrTemp != nullptr) + { + Release(); + + element = lPtrTemp; + } + + } + + return lresult; + } + +protected: + + T* element; +}; + +template +class CComQIPtrCustom : + public CComPtrCustom +{ +public: + CComQIPtrCustom() throw() + { + } + CComQIPtrCustom(decltype(__nullptr)) throw() + { + } + CComQIPtrCustom(_Inout_opt_ T* lp) throw() : + CComPtrCustom(lp) + { + } + + CComQIPtrCustom(_Inout_opt_ IUnknown* lp) throw() + { + if (lp != NULL) + { + if (FAILED(lp->QueryInterface(*piid, (void **)&element))) + element = NULL; + } + } + T* operator=(decltype(__nullptr)) throw() + { + CComQIPtrCustom(nullptr).Swap(*this); + return nullptr; + } + T* operator=(_Inout_opt_ T* lp) throw() + { + if (*this != lp) + { + CComQIPtrCustom(lp).Swap(*this); + } + return *this; + } + + T* operator=(_Inout_opt_ IUnknown* lp) throw() + { + if (*this != lp) + { + if (FAILED(lp->QueryInterface(*piid, (void **)&element))) + element = NULL; + else + return element; + } + return *this; + } +}; + +template<> +class CComQIPtrCustom : +public CComPtrCustom +{ +public: + CComQIPtrCustom() throw() + { + } + CComQIPtrCustom(_Inout_opt_ IUnknown* lp) throw() + { + if (lp != NULL) + { + if (FAILED(lp->QueryInterface(__uuidof(IUnknown), (void **)&element))) + element = NULL; + } + } + CComQIPtrCustom(_Inout_ const CComQIPtrCustom& lp) throw() + { + this->element = lp.get(); + } + + IUnknown* operator=(_Inout_ const CComQIPtrCustom& lp) throw() + { + if (this->get() != lp.get()) + { + this->element = lp.get(); + + } + return *this; + } +}; + +typedef CComQIPtrCustom CComDispatchDriver; diff --git a/natives/capturemanager/CaptureManagerNativeProxy/EVRSinkFactoryNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/EVRSinkFactoryNative.cpp new file mode 100644 index 0000000..0d498aa --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/EVRSinkFactoryNative.cpp @@ -0,0 +1,91 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + +#include "jawt_md.h" +#include "JNI\capturemanager_classes_EVRSinkFactoryNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_EVRSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/awt/Component;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_EVRSinkFactoryNative_createOutputNode + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jobject aGraphicComponent) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aGraphicComponent == nullptr) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + JAWT lJAWT; + + JAWT_DrawingSurface* lPtrJAWT_DrawingSurface; + + JAWT_DrawingSurfaceInfo* lPtrJAWT_DrawingSurfaceInfo; + + JAWT_Win32DrawingSurfaceInfo* lPtrJAWT_Win32DrawingSurfaceInfo; + + jboolean result; + + jint lock; + + + lJAWT.version = JAWT_VERSION_1_3; + + if (JAWT_GetAWT(aPtrEnv, &lJAWT) == JNI_FALSE) + break; + + lPtrJAWT_DrawingSurface = lJAWT.GetDrawingSurface(aPtrEnv, aGraphicComponent); + + lock = lPtrJAWT_DrawingSurface->Lock(lPtrJAWT_DrawingSurface); + + lPtrJAWT_DrawingSurfaceInfo = lPtrJAWT_DrawingSurface->GetDrawingSurfaceInfo(lPtrJAWT_DrawingSurface); + + lPtrJAWT_Win32DrawingSurfaceInfo = (JAWT_Win32DrawingSurfaceInfo*)lPtrJAWT_DrawingSurfaceInfo->platformInfo; + + HWND lHWND = lPtrJAWT_Win32DrawingSurfaceInfo->hwnd; + + CComPtrCustom lEVRTopologyNode; + + lhr = lObject->createOutputNode(lHWND, &lEVRTopologyNode); + + lPtrJAWT_DrawingSurface->Unlock(lPtrJAWT_DrawingSurface); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lEVRTopologyNode.detach(); + + } while (false); + + return lresult; + + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/EncoderControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/EncoderControlNative.cpp new file mode 100644 index 0000000..3e5747b --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/EncoderControlNative.cpp @@ -0,0 +1,192 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_EncoderControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_EncoderControlNative + * Method: createSinkFactory + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderControlNative_createEncoderNodeFactory + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aStringContainerTypeGUID, jstring aStringIID) + + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringContainerTypeGUID = aPtrEnv->GetStringChars(aStringContainerTypeGUID, nullptr); + + CLSID lContainerTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringContainerTypeGUID, &lContainerTypeGUID); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lInterfaceID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lInterfaceID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lIUnknown; + + lhr = lObject->createEncoderNodeFactory( + lContainerTypeGUID, + lInterfaceID, + &lIUnknown); + + if (FAILED(lhr)) + break; + + if (!lIUnknown) + break; + + lresult = (jlong)lIUnknown.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_EncoderControlNative + * Method: getCollectionOfSinks + * Signature: (J)Ljava/lang/String; + */ + JNIEXPORT jstring JNICALL Java_capturemanager_classes_EncoderControlNative_getCollectionOfEncoders + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jstring lresult = nullptr; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + BSTR lXMLstring = nullptr; + + lhr = lObject->getCollectionOfEncoders(&lXMLstring); + + if (FAILED(lhr)) + break; + + auto lLength = SysStringLen(lXMLstring); + + lresult = aPtrEnv->NewString((jchar*)lXMLstring, lLength); + + SysFreeString(lXMLstring); + + } while (false); + + return lresult; + } + + + /* + * Class: capturemanager_classes_EncoderControlNative + * Method: getMediaTypeCollectionOfEncoder + * Signature: (JJLjava/lang/String;)Ljava/lang/String; + */ + JNIEXPORT jstring JNICALL Java_capturemanager_classes_EncoderControlNative_getMediaTypeCollectionOfEncoder + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jlong aIndex, jstring aStringEncoderCLSID) + { + jstring lresult = nullptr; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aStringEncoderCLSID == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + + const jchar *lPtrStringEncoderCLSID = aPtrEnv->GetStringChars(aStringEncoderCLSID, nullptr); + + CLSID lEncoderCLSID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringEncoderCLSID, &lEncoderCLSID); + + if (FAILED(lhr)) + break; + + + lPtrIUnknown = (IUnknown*)aIndex; + + BSTR lXMLstring = nullptr; + + lhr = lObject->getMediaTypeCollectionOfEncoder( + lPtrIUnknown, + lEncoderCLSID, + &lXMLstring); + + if (FAILED(lhr)) + break; + + auto lLength = SysStringLen(lXMLstring); + + lresult = aPtrEnv->NewString((jchar*)lXMLstring, lLength); + + SysFreeString(lXMLstring); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/EncoderNodeFactoryNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/EncoderNodeFactoryNative.cpp new file mode 100644 index 0000000..640554a --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/EncoderNodeFactoryNative.cpp @@ -0,0 +1,161 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_EncoderNodeFactoryNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + /* + * Class: capturemanager_classes_EncoderNodeFactoryNative + * Method: createCompressedMediaType + * Signature: (JJLjava/lang/String;II)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderNodeFactoryNative_createCompressedMediaType + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jlong aPtrUncompressedMediaType, + jstring aStringEncodingModeGUID, jint aEncoderModeValue, jint aCompressedMediaTypeIndex) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aPtrUncompressedMediaType == 0) + break; + + if (aStringEncodingModeGUID == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringEncodingModeGUID = aPtrEnv->GetStringChars(aStringEncodingModeGUID, nullptr); + + CLSID lEncodingModeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringEncodingModeGUID, &lEncodingModeGUID); + + if (FAILED(lhr)) + break; + + lPtrIUnknown = (IUnknown*)aPtrUncompressedMediaType; + + + CComPtrCustom l_CompressedMediaType; + + lhr = lObject->createCompressedMediaType( + lPtrIUnknown, + lEncodingModeGUID, + aEncoderModeValue, + aCompressedMediaTypeIndex, + &l_CompressedMediaType); + + if (FAILED(lhr)) + break; + + if (!l_CompressedMediaType) + break; + + lresult = (jlong)l_CompressedMediaType.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_EncoderNodeFactoryNative + * Method: createEncoderNode + * Signature: (JJLjava/lang/String;IIJ)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderNodeFactoryNative_createEncoderNode + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jlong aPtrUncompressedMediaType, + jstring aStringEncodingModeGUID, jint aEncodingModeValue, jint aIndexCompressedMediaType, + jlong aPtrDownStreamNode) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aPtrUncompressedMediaType == 0) + break; + + if (aStringEncodingModeGUID == nullptr) + break; + + if (aPtrDownStreamNode == 0) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringEncodingModeGUID = aPtrEnv->GetStringChars(aStringEncodingModeGUID, nullptr); + + CLSID lEncodingModeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringEncodingModeGUID, &lEncodingModeGUID); + + if (FAILED(lhr)) + break; + + lPtrIUnknown = (IUnknown*)aPtrUncompressedMediaType; + + IUnknown* lPtrIUnknownDownStreamNode = (IUnknown*)aPtrDownStreamNode; + + + CComPtrCustom l_Unknown; + + lhr = lObject->createEncoderNode( + lPtrIUnknown, + lEncodingModeGUID, + aEncodingModeValue, + aIndexCompressedMediaType, + lPtrIUnknownDownStreamNode, + &l_Unknown); + + if (FAILED(lhr)) + break; + + if (!l_Unknown) + break; + + lresult = (jlong)l_Unknown.detach(); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/FileSinkFactoryNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/FileSinkFactoryNative.cpp new file mode 100644 index 0000000..0aa6fe1 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/FileSinkFactoryNative.cpp @@ -0,0 +1,196 @@ +#define WIN32_LEAN_AND_MEAN + + +#include +#include +#include + + +#include "jawt_md.h" +#include "JNI\capturemanager_classes_FileSinkFactoryNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* + * Class: capturemanager_classes_FileSinkFactoryNative + * Method: createOutputNodes + * Signature: (J[JLjava/lang/String;)[J + */ + JNIEXPORT jlongArray JNICALL Java_capturemanager_classes_FileSinkFactoryNative_createOutputNodes + (JNIEnv * aPtrEnv, + jobject aClass, + jlong aPtr, + jlongArray aArrayPtrCompressedMediaTypes, + jstring aPtrFileName) + { + jlongArray lresult = nullptr; + + do + { + if (aPtr == 0) + break; + + if (aArrayPtrCompressedMediaTypes == nullptr) + break; + + if (aPtrEnv == nullptr) + break; + + if (aPtrFileName == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + + + const jchar *lPtrFileName = aPtrEnv->GetStringChars(aPtrFileName, nullptr); + + + + + auto lPtrSourceNodesOfTopologys = aPtrEnv->GetLongArrayElements(aArrayPtrCompressedMediaTypes, nullptr); + + if (lPtrSourceNodesOfTopologys == nullptr) + break; + + auto lArrayLength = aPtrEnv->GetArrayLength(aArrayPtrCompressedMediaTypes); + + SAFEARRAY* pSA = NULL; + SAFEARRAYBOUND bound[1]; + bound[0].lLbound = 0; + bound[0].cElements = lArrayLength; + pSA = SafeArrayCreate(VT_VARIANT, 1, bound); + + for (long i = 0; i < lArrayLength; i++) + { + jlong lPtr = lPtrSourceNodesOfTopologys[i]; + + if (lPtr == 0) + continue; + + IUnknown* lPtrIUnknown = (IUnknown*)lPtr; + + VARIANT lVar; + + VariantInit(&lVar); + + lVar.vt = VT_UNKNOWN; + + lVar.punkVal = lPtrIUnknown; + + lhr = SafeArrayPutElement(pSA, &i, &lVar); + + if (FAILED(lhr)) + break; + + } + + if (FAILED(lhr)) + break; + + + + VARIANT theArray; + + VariantInit(&theArray); + + theArray.vt = VT_SAFEARRAY | VT_UNKNOWN; + + theArray.parray = pSA; + + + + + VARIANT theOutputNodes; + + VariantInit(&theOutputNodes); + + + + CComPtrCustom lSession; + + lhr = lObject->createOutputNodes( + theArray, + (wchar_t*)lPtrFileName, + &theOutputNodes); + + SafeArrayDestroy(pSA); + + VariantClear(&theArray); + + std::vector lCompressedMediaTypes; + + if (theOutputNodes.vt == VT_SAFEARRAY | VT_UNKNOWN && theOutputNodes.parray != nullptr) + { + LONG lBoundMediaTypes(0); + + LONG uBoundMediaTypes(0); + + SafeArrayGetUBound( theOutputNodes.parray, 1, &uBoundMediaTypes); + + SafeArrayGetLBound( theOutputNodes.parray, 1, &lBoundMediaTypes); + + for (LONG lIndex = lBoundMediaTypes; lIndex <= uBoundMediaTypes; lIndex++) + { + VARIANT lVar; + + auto lr = SafeArrayGetElement(theOutputNodes.parray, &lIndex, &lVar); + + if (SUCCEEDED(lr) && lVar.vt == VT_UNKNOWN && lVar.punkVal != nullptr) + { + lCompressedMediaTypes.push_back(lVar.punkVal); + } + + //VariantClear(&lVar); + } + + SafeArrayDestroy(theOutputNodes.parray); + + theOutputNodes.parray = nullptr; + } + + + VariantClear(&theOutputNodes); + + if (FAILED(lhr)) + break; + + + lresult = aPtrEnv->NewLongArray(lCompressedMediaTypes.size()); + + if (lresult == nullptr) + break; + + jlong* l_longs = new jlong[lCompressedMediaTypes.size()]; + + int l_index = 0; + + for (auto& l_item : lCompressedMediaTypes) + { + l_longs[l_index++] = (jlong)l_item; + } + + aPtrEnv->SetLongArrayRegion(lresult, 0, lCompressedMediaTypes.size(), l_longs); + + delete[] l_longs; + + } while (false); + + return lresult; + + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt.h b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt.h new file mode 100644 index 0000000..f06e807 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt.h @@ -0,0 +1,299 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +#ifndef _JAVASOFT_JAWT_H_ +#define _JAVASOFT_JAWT_H_ + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * AWT native interface (new in JDK 1.3) + * + * The AWT native interface allows a native C or C++ application a means + * by which to access native structures in AWT. This is to facilitate moving + * legacy C and C++ applications to Java and to target the needs of the + * community who, at present, wish to do their own native rendering to canvases + * for performance reasons. Standard extensions such as Java3D also require a + * means to access the underlying native data structures of AWT. + * + * There may be future extensions to this API depending on demand. + * + * A VM does not have to implement this API in order to pass the JCK. + * It is recommended, however, that this API is implemented on VMs that support + * standard extensions, such as Java3D. + * + * Since this is a native API, any program which uses it cannot be considered + * 100% pure java. + */ + +/* + * AWT Native Drawing Surface (JAWT_DrawingSurface). + * + * For each platform, there is a native drawing surface structure. This + * platform-specific structure can be found in jawt_md.h. It is recommended + * that additional platforms follow the same model. It is also recommended + * that VMs on Win32 and Solaris support the existing structures in jawt_md.h. + * + ******************* + * EXAMPLE OF USAGE: + ******************* + * + * In Win32, a programmer wishes to access the HWND of a canvas to perform + * native rendering into it. The programmer has declared the paint() method + * for their canvas subclass to be native: + * + * + * MyCanvas.java: + * + * import java.awt.*; + * + * public class MyCanvas extends Canvas { + * + * static { + * System.loadLibrary("mylib"); + * } + * + * public native void paint(Graphics g); + * } + * + * + * myfile.c: + * + * #include "jawt_md.h" + * #include + * + * JNIEXPORT void JNICALL + * Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics) + * { + * JAWT awt; + * JAWT_DrawingSurface* ds; + * JAWT_DrawingSurfaceInfo* dsi; + * JAWT_Win32DrawingSurfaceInfo* dsi_win; + * jboolean result; + * jint lock; + * + * // Get the AWT + * awt.version = JAWT_VERSION_1_3; + * result = JAWT_GetAWT(env, &awt); + * assert(result != JNI_FALSE); + * + * // Get the drawing surface + * ds = awt.GetDrawingSurface(env, canvas); + * assert(ds != NULL); + * + * // Lock the drawing surface + * lock = ds->Lock(ds); + * assert((lock & JAWT_LOCK_ERROR) == 0); + * + * // Get the drawing surface info + * dsi = ds->GetDrawingSurfaceInfo(ds); + * + * // Get the platform-specific drawing info + * dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo; + * + * ////////////////////////////// + * // !!! DO PAINTING HERE !!! // + * ////////////////////////////// + * + * // Free the drawing surface info + * ds->FreeDrawingSurfaceInfo(dsi); + * + * // Unlock the drawing surface + * ds->Unlock(ds); + * + * // Free the drawing surface + * awt.FreeDrawingSurface(ds); + * } + * + */ + +/* + * JAWT_Rectangle + * Structure for a native rectangle. + */ +typedef struct jawt_Rectangle { + jint x; + jint y; + jint width; + jint height; +} JAWT_Rectangle; + +struct jawt_DrawingSurface; + +/* + * JAWT_DrawingSurfaceInfo + * Structure for containing the underlying drawing information of a component. + */ +typedef struct jawt_DrawingSurfaceInfo { + /* + * Pointer to the platform-specific information. This can be safely + * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a + * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X this is a + * pointer to a NSObject that conforms to the JAWT_SurfaceLayers + * protocol. See jawt_md.h for details. + */ + void* platformInfo; + /* Cached pointer to the underlying drawing surface */ + struct jawt_DrawingSurface* ds; + /* Bounding rectangle of the drawing surface */ + JAWT_Rectangle bounds; + /* Number of rectangles in the clip */ + jint clipSize; + /* Clip rectangle array */ + JAWT_Rectangle* clip; +} JAWT_DrawingSurfaceInfo; + +#define JAWT_LOCK_ERROR 0x00000001 +#define JAWT_LOCK_CLIP_CHANGED 0x00000002 +#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004 +#define JAWT_LOCK_SURFACE_CHANGED 0x00000008 + +/* + * JAWT_DrawingSurface + * Structure for containing the underlying drawing information of a component. + * All operations on a JAWT_DrawingSurface MUST be performed from the same + * thread as the call to GetDrawingSurface. + */ +typedef struct jawt_DrawingSurface { + /* + * Cached reference to the Java environment of the calling thread. + * If Lock(), Unlock(), GetDrawingSurfaceInfo() or + * FreeDrawingSurfaceInfo() are called from a different thread, + * this data member should be set before calling those functions. + */ + JNIEnv* env; + /* Cached reference to the target object */ + jobject target; + /* + * Lock the surface of the target component for native rendering. + * When finished drawing, the surface must be unlocked with + * Unlock(). This function returns a bitmask with one or more of the + * following values: + * + * JAWT_LOCK_ERROR - When an error has occurred and the surface could not + * be locked. + * + * JAWT_LOCK_CLIP_CHANGED - When the clip region has changed. + * + * JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed. + * + * JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed + */ + jint (JNICALL *Lock) + (struct jawt_DrawingSurface* ds); + /* + * Get the drawing surface info. + * The value returned may be cached, but the values may change if + * additional calls to Lock() or Unlock() are made. + * Lock() must be called before this can return a valid value. + * Returns NULL if an error has occurred. + * When finished with the returned value, FreeDrawingSurfaceInfo must be + * called. + */ + JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo) + (struct jawt_DrawingSurface* ds); + /* + * Free the drawing surface info. + */ + void (JNICALL *FreeDrawingSurfaceInfo) + (JAWT_DrawingSurfaceInfo* dsi); + /* + * Unlock the drawing surface of the target component for native rendering. + */ + void (JNICALL *Unlock) + (struct jawt_DrawingSurface* ds); +} JAWT_DrawingSurface; + +/* + * JAWT + * Structure for containing native AWT functions. + */ +typedef struct jawt { + /* + * Version of this structure. This must always be set before + * calling JAWT_GetAWT() + */ + jint version; + /* + * Return a drawing surface from a target jobject. This value + * may be cached. + * Returns NULL if an error has occurred. + * Target must be a java.awt.Component (should be a Canvas + * or Window for native rendering). + * FreeDrawingSurface() must be called when finished with the + * returned JAWT_DrawingSurface. + */ + JAWT_DrawingSurface* (JNICALL *GetDrawingSurface) + (JNIEnv* env, jobject target); + /* + * Free the drawing surface allocated in GetDrawingSurface. + */ + void (JNICALL *FreeDrawingSurface) + (JAWT_DrawingSurface* ds); + /* + * Since 1.4 + * Locks the entire AWT for synchronization purposes + */ + void (JNICALL *Lock)(JNIEnv* env); + /* + * Since 1.4 + * Unlocks the entire AWT for synchronization purposes + */ + void (JNICALL *Unlock)(JNIEnv* env); + /* + * Since 1.4 + * Returns a reference to a java.awt.Component from a native + * platform handle. On Windows, this corresponds to an HWND; + * on Solaris and Linux, this is a Drawable. For other platforms, + * see the appropriate machine-dependent header file for a description. + * The reference returned by this function is a local + * reference that is only valid in this environment. + * This function returns a NULL reference if no component could be + * found with matching platform information. + */ + jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo); + +} JAWT; + +/* + * Get the AWT native structure. This function returns JNI_FALSE if + * an error occurs. + */ +_JNI_IMPORT_OR_EXPORT_ +jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt); + +#define JAWT_VERSION_1_3 0x00010003 +#define JAWT_VERSION_1_4 0x00010004 +#define JAWT_VERSION_1_7 0x00010007 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !_JAVASOFT_JAWT_H_ */ diff --git a/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt_md.h b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt_md.h new file mode 100644 index 0000000..66e7256 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jawt_md.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +#ifndef _JAVASOFT_JAWT_MD_H_ +#define _JAVASOFT_JAWT_MD_H_ + +#include +#include "jawt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Win32-specific declarations for AWT native interface. + * See notes in jawt.h for an example of use. + */ +typedef struct jawt_Win32DrawingSurfaceInfo { + /* Native window, DDB, or DIB handle */ + union { + HWND hwnd; + HBITMAP hbitmap; + void* pbits; + }; + /* + * This HDC should always be used instead of the HDC returned from + * BeginPaint() or any calls to GetDC(). + */ + HDC hdc; + HPALETTE hpalette; +} JAWT_Win32DrawingSurfaceInfo; + +#ifdef __cplusplus +} +#endif + +#endif /* !_JAVASOFT_JAWT_MD_H_ */ diff --git a/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni.h b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni.h new file mode 100644 index 0000000..0ffe244 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni.h @@ -0,0 +1,1960 @@ +/* + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/* + * We used part of Netscape's Java Runtime Interface (JRI) as the starting + * point of our design and implementation. + */ + +/****************************************************************************** + * Java Runtime Interface + * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. + *****************************************************************************/ + +#ifndef _JAVASOFT_JNI_H_ +#define _JAVASOFT_JNI_H_ + +#include +#include + +/* jni_md.h contains the machine-dependent typedefs for jbyte, jint + and jlong */ + +#include "jni_md.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * JNI Types + */ + +#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +#ifdef __cplusplus + +class _jobject {}; +class _jclass : public _jobject {}; +class _jthrowable : public _jobject {}; +class _jstring : public _jobject {}; +class _jarray : public _jobject {}; +class _jbooleanArray : public _jarray {}; +class _jbyteArray : public _jarray {}; +class _jcharArray : public _jarray {}; +class _jshortArray : public _jarray {}; +class _jintArray : public _jarray {}; +class _jlongArray : public _jarray {}; +class _jfloatArray : public _jarray {}; +class _jdoubleArray : public _jarray {}; +class _jobjectArray : public _jarray {}; + +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef _jthrowable *jthrowable; +typedef _jstring *jstring; +typedef _jarray *jarray; +typedef _jbooleanArray *jbooleanArray; +typedef _jbyteArray *jbyteArray; +typedef _jcharArray *jcharArray; +typedef _jshortArray *jshortArray; +typedef _jintArray *jintArray; +typedef _jlongArray *jlongArray; +typedef _jfloatArray *jfloatArray; +typedef _jdoubleArray *jdoubleArray; +typedef _jobjectArray *jobjectArray; + +#else + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; + +#endif + +typedef jobject jweak; + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* Return values from jobjectRefType */ +typedef enum _jobjectType { + JNIInvalidRefType = 0, + JNILocalRefType = 1, + JNIGlobalRefType = 2, + JNIWeakGlobalRefType = 3 +} jobjectRefType; + + +#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 + +/* + * used in RegisterNatives to describe native method name, signature, + * and function pointer. + */ + +typedef struct { + char *name; + char *signature; + void *fnPtr; +} JNINativeMethod; + +/* + * JNI Native Method Interface. + */ + +struct JNINativeInterface_; + +struct JNIEnv_; + +#ifdef __cplusplus +typedef JNIEnv_ JNIEnv; +#else +typedef const struct JNINativeInterface_ *JNIEnv; +#endif + +/* + * JNI Invocation Interface. + */ + +struct JNIInvokeInterface_; + +struct JavaVM_; + +#ifdef __cplusplus +typedef JavaVM_ JavaVM; +#else +typedef const struct JNIInvokeInterface_ *JavaVM; +#endif + +struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + void *reserved3; + jint (JNICALL *GetVersion)(JNIEnv *env); + + jclass (JNICALL *DefineClass) + (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, + jsize len); + jclass (JNICALL *FindClass) + (JNIEnv *env, const char *name); + + jmethodID (JNICALL *FromReflectedMethod) + (JNIEnv *env, jobject method); + jfieldID (JNICALL *FromReflectedField) + (JNIEnv *env, jobject field); + + jobject (JNICALL *ToReflectedMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (JNICALL *GetSuperclass) + (JNIEnv *env, jclass sub); + jboolean (JNICALL *IsAssignableFrom) + (JNIEnv *env, jclass sub, jclass sup); + + jobject (JNICALL *ToReflectedField) + (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (JNICALL *Throw) + (JNIEnv *env, jthrowable obj); + jint (JNICALL *ThrowNew) + (JNIEnv *env, jclass clazz, const char *msg); + jthrowable (JNICALL *ExceptionOccurred) + (JNIEnv *env); + void (JNICALL *ExceptionDescribe) + (JNIEnv *env); + void (JNICALL *ExceptionClear) + (JNIEnv *env); + void (JNICALL *FatalError) + (JNIEnv *env, const char *msg); + + jint (JNICALL *PushLocalFrame) + (JNIEnv *env, jint capacity); + jobject (JNICALL *PopLocalFrame) + (JNIEnv *env, jobject result); + + jobject (JNICALL *NewGlobalRef) + (JNIEnv *env, jobject lobj); + void (JNICALL *DeleteGlobalRef) + (JNIEnv *env, jobject gref); + void (JNICALL *DeleteLocalRef) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsSameObject) + (JNIEnv *env, jobject obj1, jobject obj2); + jobject (JNICALL *NewLocalRef) + (JNIEnv *env, jobject ref); + jint (JNICALL *EnsureLocalCapacity) + (JNIEnv *env, jint capacity); + + jobject (JNICALL *AllocObject) + (JNIEnv *env, jclass clazz); + jobject (JNICALL *NewObject) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *NewObjectV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *NewObjectA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jclass (JNICALL *GetObjectClass) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsInstanceOf) + (JNIEnv *env, jobject obj, jclass clazz); + + jmethodID (JNICALL *GetMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallObjectMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jobject (JNICALL *CallObjectMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jobject (JNICALL *CallObjectMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jboolean (JNICALL *CallBooleanMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jboolean (JNICALL *CallBooleanMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jboolean (JNICALL *CallBooleanMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jbyte (JNICALL *CallByteMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jbyte (JNICALL *CallByteMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jbyte (JNICALL *CallByteMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallCharMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jchar (JNICALL *CallCharMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jchar (JNICALL *CallCharMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallShortMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jshort (JNICALL *CallShortMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jshort (JNICALL *CallShortMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallIntMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jint (JNICALL *CallIntMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jint (JNICALL *CallIntMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallLongMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jlong (JNICALL *CallLongMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jlong (JNICALL *CallLongMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallFloatMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jfloat (JNICALL *CallFloatMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jfloat (JNICALL *CallFloatMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallDoubleMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jdouble (JNICALL *CallDoubleMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jdouble (JNICALL *CallDoubleMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallVoidMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + void (JNICALL *CallVoidMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + void (JNICALL *CallVoidMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jobject (JNICALL *CallNonvirtualObjectMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallNonvirtualObjectMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jobject (JNICALL *CallNonvirtualObjectMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jboolean (JNICALL *CallNonvirtualBooleanMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallNonvirtualBooleanMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jboolean (JNICALL *CallNonvirtualBooleanMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jbyte (JNICALL *CallNonvirtualByteMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallNonvirtualByteMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jbyte (JNICALL *CallNonvirtualByteMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jchar (JNICALL *CallNonvirtualCharMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallNonvirtualCharMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jchar (JNICALL *CallNonvirtualCharMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jshort (JNICALL *CallNonvirtualShortMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallNonvirtualShortMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jshort (JNICALL *CallNonvirtualShortMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jint (JNICALL *CallNonvirtualIntMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallNonvirtualIntMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jint (JNICALL *CallNonvirtualIntMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jlong (JNICALL *CallNonvirtualLongMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallNonvirtualLongMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jlong (JNICALL *CallNonvirtualLongMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jfloat (JNICALL *CallNonvirtualFloatMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallNonvirtualFloatMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jfloat (JNICALL *CallNonvirtualFloatMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jdouble (JNICALL *CallNonvirtualDoubleMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallNonvirtualDoubleMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jdouble (JNICALL *CallNonvirtualDoubleMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + void (JNICALL *CallNonvirtualVoidMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (JNICALL *CallNonvirtualVoidMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + void (JNICALL *CallNonvirtualVoidMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jfieldID (JNICALL *GetFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *GetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jboolean (JNICALL *GetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jbyte (JNICALL *GetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jchar (JNICALL *GetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jshort (JNICALL *GetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jint (JNICALL *GetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jlong (JNICALL *GetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jfloat (JNICALL *GetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jdouble (JNICALL *GetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + + void (JNICALL *SetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); + void (JNICALL *SetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); + void (JNICALL *SetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); + void (JNICALL *SetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); + void (JNICALL *SetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); + void (JNICALL *SetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); + void (JNICALL *SetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); + void (JNICALL *SetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); + void (JNICALL *SetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (JNICALL *GetStaticMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallStaticObjectMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallStaticObjectMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *CallStaticObjectMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jboolean (JNICALL *CallStaticBooleanMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallStaticBooleanMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jboolean (JNICALL *CallStaticBooleanMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jbyte (JNICALL *CallStaticByteMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallStaticByteMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jbyte (JNICALL *CallStaticByteMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallStaticCharMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallStaticCharMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jchar (JNICALL *CallStaticCharMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallStaticShortMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallStaticShortMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jshort (JNICALL *CallStaticShortMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallStaticIntMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallStaticIntMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jint (JNICALL *CallStaticIntMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallStaticLongMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallStaticLongMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jlong (JNICALL *CallStaticLongMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallStaticFloatMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallStaticFloatMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jfloat (JNICALL *CallStaticFloatMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallStaticDoubleMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallStaticDoubleMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jdouble (JNICALL *CallStaticDoubleMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallStaticVoidMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, ...); + void (JNICALL *CallStaticVoidMethodV) + (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); + void (JNICALL *CallStaticVoidMethodA) + (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); + + jfieldID (JNICALL *GetStaticFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + jobject (JNICALL *GetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jboolean (JNICALL *GetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jbyte (JNICALL *GetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jchar (JNICALL *GetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jshort (JNICALL *GetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jint (JNICALL *GetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jlong (JNICALL *GetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jfloat (JNICALL *GetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jdouble (JNICALL *GetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + + void (JNICALL *SetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); + void (JNICALL *SetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); + void (JNICALL *SetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); + void (JNICALL *SetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); + void (JNICALL *SetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); + void (JNICALL *SetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); + void (JNICALL *SetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); + void (JNICALL *SetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); + void (JNICALL *SetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (JNICALL *NewString) + (JNIEnv *env, const jchar *unicode, jsize len); + jsize (JNICALL *GetStringLength) + (JNIEnv *env, jstring str); + const jchar *(JNICALL *GetStringChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringChars) + (JNIEnv *env, jstring str, const jchar *chars); + + jstring (JNICALL *NewStringUTF) + (JNIEnv *env, const char *utf); + jsize (JNICALL *GetStringUTFLength) + (JNIEnv *env, jstring str); + const char* (JNICALL *GetStringUTFChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringUTFChars) + (JNIEnv *env, jstring str, const char* chars); + + + jsize (JNICALL *GetArrayLength) + (JNIEnv *env, jarray array); + + jobjectArray (JNICALL *NewObjectArray) + (JNIEnv *env, jsize len, jclass clazz, jobject init); + jobject (JNICALL *GetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index); + void (JNICALL *SetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (JNICALL *NewBooleanArray) + (JNIEnv *env, jsize len); + jbyteArray (JNICALL *NewByteArray) + (JNIEnv *env, jsize len); + jcharArray (JNICALL *NewCharArray) + (JNIEnv *env, jsize len); + jshortArray (JNICALL *NewShortArray) + (JNIEnv *env, jsize len); + jintArray (JNICALL *NewIntArray) + (JNIEnv *env, jsize len); + jlongArray (JNICALL *NewLongArray) + (JNIEnv *env, jsize len); + jfloatArray (JNICALL *NewFloatArray) + (JNIEnv *env, jsize len); + jdoubleArray (JNICALL *NewDoubleArray) + (JNIEnv *env, jsize len); + + jboolean * (JNICALL *GetBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *isCopy); + jbyte * (JNICALL *GetByteArrayElements) + (JNIEnv *env, jbyteArray array, jboolean *isCopy); + jchar * (JNICALL *GetCharArrayElements) + (JNIEnv *env, jcharArray array, jboolean *isCopy); + jshort * (JNICALL *GetShortArrayElements) + (JNIEnv *env, jshortArray array, jboolean *isCopy); + jint * (JNICALL *GetIntArrayElements) + (JNIEnv *env, jintArray array, jboolean *isCopy); + jlong * (JNICALL *GetLongArrayElements) + (JNIEnv *env, jlongArray array, jboolean *isCopy); + jfloat * (JNICALL *GetFloatArrayElements) + (JNIEnv *env, jfloatArray array, jboolean *isCopy); + jdouble * (JNICALL *GetDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jboolean *isCopy); + + void (JNICALL *ReleaseBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); + void (JNICALL *ReleaseByteArrayElements) + (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); + void (JNICALL *ReleaseCharArrayElements) + (JNIEnv *env, jcharArray array, jchar *elems, jint mode); + void (JNICALL *ReleaseShortArrayElements) + (JNIEnv *env, jshortArray array, jshort *elems, jint mode); + void (JNICALL *ReleaseIntArrayElements) + (JNIEnv *env, jintArray array, jint *elems, jint mode); + void (JNICALL *ReleaseLongArrayElements) + (JNIEnv *env, jlongArray array, jlong *elems, jint mode); + void (JNICALL *ReleaseFloatArrayElements) + (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); + void (JNICALL *ReleaseDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); + + void (JNICALL *GetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); + void (JNICALL *GetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); + void (JNICALL *GetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); + void (JNICALL *GetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); + void (JNICALL *GetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); + void (JNICALL *GetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); + void (JNICALL *GetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); + void (JNICALL *GetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); + + void (JNICALL *SetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); + void (JNICALL *SetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); + void (JNICALL *SetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); + void (JNICALL *SetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); + void (JNICALL *SetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); + void (JNICALL *SetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); + void (JNICALL *SetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); + void (JNICALL *SetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); + + jint (JNICALL *RegisterNatives) + (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, + jint nMethods); + jint (JNICALL *UnregisterNatives) + (JNIEnv *env, jclass clazz); + + jint (JNICALL *MonitorEnter) + (JNIEnv *env, jobject obj); + jint (JNICALL *MonitorExit) + (JNIEnv *env, jobject obj); + + jint (JNICALL *GetJavaVM) + (JNIEnv *env, JavaVM **vm); + + void (JNICALL *GetStringRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); + void (JNICALL *GetStringUTFRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); + + void * (JNICALL *GetPrimitiveArrayCritical) + (JNIEnv *env, jarray array, jboolean *isCopy); + void (JNICALL *ReleasePrimitiveArrayCritical) + (JNIEnv *env, jarray array, void *carray, jint mode); + + const jchar * (JNICALL *GetStringCritical) + (JNIEnv *env, jstring string, jboolean *isCopy); + void (JNICALL *ReleaseStringCritical) + (JNIEnv *env, jstring string, const jchar *cstring); + + jweak (JNICALL *NewWeakGlobalRef) + (JNIEnv *env, jobject obj); + void (JNICALL *DeleteWeakGlobalRef) + (JNIEnv *env, jweak ref); + + jboolean (JNICALL *ExceptionCheck) + (JNIEnv *env); + + jobject (JNICALL *NewDirectByteBuffer) + (JNIEnv* env, void* address, jlong capacity); + void* (JNICALL *GetDirectBufferAddress) + (JNIEnv* env, jobject buf); + jlong (JNICALL *GetDirectBufferCapacity) + (JNIEnv* env, jobject buf); + + /* New JNI 1.6 Features */ + + jobjectRefType (JNICALL *GetObjectRefType) + (JNIEnv* env, jobject obj); +}; + +/* + * We use inlined functions for C++ so that programmers can write: + * + * env->FindClass("java/lang/String") + * + * in C++ rather than: + * + * (*env)->FindClass(env, "java/lang/String") + * + * in C. + */ + +struct JNIEnv_ { + const struct JNINativeInterface_ *functions; +#ifdef __cplusplus + + jint GetVersion() { + return functions->GetVersion(this); + } + jclass DefineClass(const char *name, jobject loader, const jbyte *buf, + jsize len) { + return functions->DefineClass(this, name, loader, buf, len); + } + jclass FindClass(const char *name) { + return functions->FindClass(this, name); + } + jmethodID FromReflectedMethod(jobject method) { + return functions->FromReflectedMethod(this,method); + } + jfieldID FromReflectedField(jobject field) { + return functions->FromReflectedField(this,field); + } + + jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { + return functions->ToReflectedMethod(this, cls, methodID, isStatic); + } + + jclass GetSuperclass(jclass sub) { + return functions->GetSuperclass(this, sub); + } + jboolean IsAssignableFrom(jclass sub, jclass sup) { + return functions->IsAssignableFrom(this, sub, sup); + } + + jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { + return functions->ToReflectedField(this,cls,fieldID,isStatic); + } + + jint Throw(jthrowable obj) { + return functions->Throw(this, obj); + } + jint ThrowNew(jclass clazz, const char *msg) { + return functions->ThrowNew(this, clazz, msg); + } + jthrowable ExceptionOccurred() { + return functions->ExceptionOccurred(this); + } + void ExceptionDescribe() { + functions->ExceptionDescribe(this); + } + void ExceptionClear() { + functions->ExceptionClear(this); + } + void FatalError(const char *msg) { + functions->FatalError(this, msg); + } + + jint PushLocalFrame(jint capacity) { + return functions->PushLocalFrame(this,capacity); + } + jobject PopLocalFrame(jobject result) { + return functions->PopLocalFrame(this,result); + } + + jobject NewGlobalRef(jobject lobj) { + return functions->NewGlobalRef(this,lobj); + } + void DeleteGlobalRef(jobject gref) { + functions->DeleteGlobalRef(this,gref); + } + void DeleteLocalRef(jobject obj) { + functions->DeleteLocalRef(this, obj); + } + + jboolean IsSameObject(jobject obj1, jobject obj2) { + return functions->IsSameObject(this,obj1,obj2); + } + + jobject NewLocalRef(jobject ref) { + return functions->NewLocalRef(this,ref); + } + jint EnsureLocalCapacity(jint capacity) { + return functions->EnsureLocalCapacity(this,capacity); + } + + jobject AllocObject(jclass clazz) { + return functions->AllocObject(this,clazz); + } + jobject NewObject(jclass clazz, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args, methodID); + result = functions->NewObjectV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject NewObjectV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->NewObjectV(this,clazz,methodID,args); + } + jobject NewObjectA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->NewObjectA(this,clazz,methodID,args); + } + + jclass GetObjectClass(jobject obj) { + return functions->GetObjectClass(this,obj); + } + jboolean IsInstanceOf(jobject obj, jclass clazz) { + return functions->IsInstanceOf(this,obj,clazz); + } + + jmethodID GetMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetMethodID(this,clazz,name,sig); + } + + jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallObjectMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jobject CallObjectMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallObjectMethodV(this,obj,methodID,args); + } + jobject CallObjectMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallObjectMethodA(this,obj,methodID,args); + } + + jboolean CallBooleanMethod(jobject obj, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallBooleanMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallBooleanMethodV(this,obj,methodID,args); + } + jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallBooleanMethodA(this,obj,methodID, args); + } + + jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallByteMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jbyte CallByteMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallByteMethodV(this,obj,methodID,args); + } + jbyte CallByteMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallByteMethodA(this,obj,methodID,args); + } + + jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallCharMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jchar CallCharMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallCharMethodV(this,obj,methodID,args); + } + jchar CallCharMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallCharMethodA(this,obj,methodID,args); + } + + jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallShortMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jshort CallShortMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallShortMethodV(this,obj,methodID,args); + } + jshort CallShortMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallShortMethodA(this,obj,methodID,args); + } + + jint CallIntMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallIntMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jint CallIntMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallIntMethodV(this,obj,methodID,args); + } + jint CallIntMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallIntMethodA(this,obj,methodID,args); + } + + jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallLongMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jlong CallLongMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallLongMethodV(this,obj,methodID,args); + } + jlong CallLongMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallLongMethodA(this,obj,methodID,args); + } + + jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallFloatMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jfloat CallFloatMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallFloatMethodV(this,obj,methodID,args); + } + jfloat CallFloatMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallFloatMethodA(this,obj,methodID,args); + } + + jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallDoubleMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallDoubleMethodV(this,obj,methodID,args); + } + jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallDoubleMethodA(this,obj,methodID,args); + } + + void CallVoidMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallVoidMethodV(this,obj,methodID,args); + va_end(args); + } + void CallVoidMethodV(jobject obj, jmethodID methodID, + va_list args) { + functions->CallVoidMethodV(this,obj,methodID,args); + } + void CallVoidMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + functions->CallVoidMethodA(this,obj,methodID,args); + } + + jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + } + jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualObjectMethodA(this,obj,clazz, + methodID,args); + } + + jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + } + jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, + methodID, args); + } + + jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + } + jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualByteMethodA(this,obj,clazz, + methodID,args); + } + + jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + } + jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualCharMethodA(this,obj,clazz, + methodID,args); + } + + jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + } + jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualShortMethodA(this,obj,clazz, + methodID,args); + } + + jint CallNonvirtualIntMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + } + jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualIntMethodA(this,obj,clazz, + methodID,args); + } + + jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + } + jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualLongMethodA(this,obj,clazz, + methodID,args); + } + + jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + } + jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualFloatMethodA(this,obj,clazz, + methodID,args); + } + + jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + } + jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, + methodID,args); + } + + void CallNonvirtualVoidMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + va_end(args); + } + void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + } + void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); + } + + jfieldID GetFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetFieldID(this,clazz,name,sig); + } + + jobject GetObjectField(jobject obj, jfieldID fieldID) { + return functions->GetObjectField(this,obj,fieldID); + } + jboolean GetBooleanField(jobject obj, jfieldID fieldID) { + return functions->GetBooleanField(this,obj,fieldID); + } + jbyte GetByteField(jobject obj, jfieldID fieldID) { + return functions->GetByteField(this,obj,fieldID); + } + jchar GetCharField(jobject obj, jfieldID fieldID) { + return functions->GetCharField(this,obj,fieldID); + } + jshort GetShortField(jobject obj, jfieldID fieldID) { + return functions->GetShortField(this,obj,fieldID); + } + jint GetIntField(jobject obj, jfieldID fieldID) { + return functions->GetIntField(this,obj,fieldID); + } + jlong GetLongField(jobject obj, jfieldID fieldID) { + return functions->GetLongField(this,obj,fieldID); + } + jfloat GetFloatField(jobject obj, jfieldID fieldID) { + return functions->GetFloatField(this,obj,fieldID); + } + jdouble GetDoubleField(jobject obj, jfieldID fieldID) { + return functions->GetDoubleField(this,obj,fieldID); + } + + void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { + functions->SetObjectField(this,obj,fieldID,val); + } + void SetBooleanField(jobject obj, jfieldID fieldID, + jboolean val) { + functions->SetBooleanField(this,obj,fieldID,val); + } + void SetByteField(jobject obj, jfieldID fieldID, + jbyte val) { + functions->SetByteField(this,obj,fieldID,val); + } + void SetCharField(jobject obj, jfieldID fieldID, + jchar val) { + functions->SetCharField(this,obj,fieldID,val); + } + void SetShortField(jobject obj, jfieldID fieldID, + jshort val) { + functions->SetShortField(this,obj,fieldID,val); + } + void SetIntField(jobject obj, jfieldID fieldID, + jint val) { + functions->SetIntField(this,obj,fieldID,val); + } + void SetLongField(jobject obj, jfieldID fieldID, + jlong val) { + functions->SetLongField(this,obj,fieldID,val); + } + void SetFloatField(jobject obj, jfieldID fieldID, + jfloat val) { + functions->SetFloatField(this,obj,fieldID,val); + } + void SetDoubleField(jobject obj, jfieldID fieldID, + jdouble val) { + functions->SetDoubleField(this,obj,fieldID,val); + } + + jmethodID GetStaticMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticMethodID(this,clazz,name,sig); + } + + jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, + ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->CallStaticObjectMethodV(this,clazz,methodID,args); + } + jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->CallStaticObjectMethodA(this,clazz,methodID,args); + } + + jboolean CallStaticBooleanMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jboolean CallStaticBooleanMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + } + jboolean CallStaticBooleanMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); + } + + jbyte CallStaticByteMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallStaticByteMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jbyte CallStaticByteMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticByteMethodV(this,clazz,methodID,args); + } + jbyte CallStaticByteMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticByteMethodA(this,clazz,methodID,args); + } + + jchar CallStaticCharMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallStaticCharMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jchar CallStaticCharMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticCharMethodV(this,clazz,methodID,args); + } + jchar CallStaticCharMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticCharMethodA(this,clazz,methodID,args); + } + + jshort CallStaticShortMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallStaticShortMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jshort CallStaticShortMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticShortMethodV(this,clazz,methodID,args); + } + jshort CallStaticShortMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticShortMethodA(this,clazz,methodID,args); + } + + jint CallStaticIntMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallStaticIntMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jint CallStaticIntMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticIntMethodV(this,clazz,methodID,args); + } + jint CallStaticIntMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticIntMethodA(this,clazz,methodID,args); + } + + jlong CallStaticLongMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallStaticLongMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jlong CallStaticLongMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticLongMethodV(this,clazz,methodID,args); + } + jlong CallStaticLongMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticLongMethodA(this,clazz,methodID,args); + } + + jfloat CallStaticFloatMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jfloat CallStaticFloatMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticFloatMethodV(this,clazz,methodID,args); + } + jfloat CallStaticFloatMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticFloatMethodA(this,clazz,methodID,args); + } + + jdouble CallStaticDoubleMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jdouble CallStaticDoubleMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + } + jdouble CallStaticDoubleMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); + } + + void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallStaticVoidMethodV(this,cls,methodID,args); + va_end(args); + } + void CallStaticVoidMethodV(jclass cls, jmethodID methodID, + va_list args) { + functions->CallStaticVoidMethodV(this,cls,methodID,args); + } + void CallStaticVoidMethodA(jclass cls, jmethodID methodID, + const jvalue * args) { + functions->CallStaticVoidMethodA(this,cls,methodID,args); + } + + jfieldID GetStaticFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticFieldID(this,clazz,name,sig); + } + jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticObjectField(this,clazz,fieldID); + } + jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticBooleanField(this,clazz,fieldID); + } + jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticByteField(this,clazz,fieldID); + } + jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticCharField(this,clazz,fieldID); + } + jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticShortField(this,clazz,fieldID); + } + jint GetStaticIntField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticIntField(this,clazz,fieldID); + } + jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticLongField(this,clazz,fieldID); + } + jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticFloatField(this,clazz,fieldID); + } + jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticDoubleField(this,clazz,fieldID); + } + + void SetStaticObjectField(jclass clazz, jfieldID fieldID, + jobject value) { + functions->SetStaticObjectField(this,clazz,fieldID,value); + } + void SetStaticBooleanField(jclass clazz, jfieldID fieldID, + jboolean value) { + functions->SetStaticBooleanField(this,clazz,fieldID,value); + } + void SetStaticByteField(jclass clazz, jfieldID fieldID, + jbyte value) { + functions->SetStaticByteField(this,clazz,fieldID,value); + } + void SetStaticCharField(jclass clazz, jfieldID fieldID, + jchar value) { + functions->SetStaticCharField(this,clazz,fieldID,value); + } + void SetStaticShortField(jclass clazz, jfieldID fieldID, + jshort value) { + functions->SetStaticShortField(this,clazz,fieldID,value); + } + void SetStaticIntField(jclass clazz, jfieldID fieldID, + jint value) { + functions->SetStaticIntField(this,clazz,fieldID,value); + } + void SetStaticLongField(jclass clazz, jfieldID fieldID, + jlong value) { + functions->SetStaticLongField(this,clazz,fieldID,value); + } + void SetStaticFloatField(jclass clazz, jfieldID fieldID, + jfloat value) { + functions->SetStaticFloatField(this,clazz,fieldID,value); + } + void SetStaticDoubleField(jclass clazz, jfieldID fieldID, + jdouble value) { + functions->SetStaticDoubleField(this,clazz,fieldID,value); + } + + jstring NewString(const jchar *unicode, jsize len) { + return functions->NewString(this,unicode,len); + } + jsize GetStringLength(jstring str) { + return functions->GetStringLength(this,str); + } + const jchar *GetStringChars(jstring str, jboolean *isCopy) { + return functions->GetStringChars(this,str,isCopy); + } + void ReleaseStringChars(jstring str, const jchar *chars) { + functions->ReleaseStringChars(this,str,chars); + } + + jstring NewStringUTF(const char *utf) { + return functions->NewStringUTF(this,utf); + } + jsize GetStringUTFLength(jstring str) { + return functions->GetStringUTFLength(this,str); + } + const char* GetStringUTFChars(jstring str, jboolean *isCopy) { + return functions->GetStringUTFChars(this,str,isCopy); + } + void ReleaseStringUTFChars(jstring str, const char* chars) { + functions->ReleaseStringUTFChars(this,str,chars); + } + + jsize GetArrayLength(jarray array) { + return functions->GetArrayLength(this,array); + } + + jobjectArray NewObjectArray(jsize len, jclass clazz, + jobject init) { + return functions->NewObjectArray(this,len,clazz,init); + } + jobject GetObjectArrayElement(jobjectArray array, jsize index) { + return functions->GetObjectArrayElement(this,array,index); + } + void SetObjectArrayElement(jobjectArray array, jsize index, + jobject val) { + functions->SetObjectArrayElement(this,array,index,val); + } + + jbooleanArray NewBooleanArray(jsize len) { + return functions->NewBooleanArray(this,len); + } + jbyteArray NewByteArray(jsize len) { + return functions->NewByteArray(this,len); + } + jcharArray NewCharArray(jsize len) { + return functions->NewCharArray(this,len); + } + jshortArray NewShortArray(jsize len) { + return functions->NewShortArray(this,len); + } + jintArray NewIntArray(jsize len) { + return functions->NewIntArray(this,len); + } + jlongArray NewLongArray(jsize len) { + return functions->NewLongArray(this,len); + } + jfloatArray NewFloatArray(jsize len) { + return functions->NewFloatArray(this,len); + } + jdoubleArray NewDoubleArray(jsize len) { + return functions->NewDoubleArray(this,len); + } + + jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { + return functions->GetBooleanArrayElements(this,array,isCopy); + } + jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { + return functions->GetByteArrayElements(this,array,isCopy); + } + jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { + return functions->GetCharArrayElements(this,array,isCopy); + } + jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { + return functions->GetShortArrayElements(this,array,isCopy); + } + jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { + return functions->GetIntArrayElements(this,array,isCopy); + } + jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { + return functions->GetLongArrayElements(this,array,isCopy); + } + jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { + return functions->GetFloatArrayElements(this,array,isCopy); + } + jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { + return functions->GetDoubleArrayElements(this,array,isCopy); + } + + void ReleaseBooleanArrayElements(jbooleanArray array, + jboolean *elems, + jint mode) { + functions->ReleaseBooleanArrayElements(this,array,elems,mode); + } + void ReleaseByteArrayElements(jbyteArray array, + jbyte *elems, + jint mode) { + functions->ReleaseByteArrayElements(this,array,elems,mode); + } + void ReleaseCharArrayElements(jcharArray array, + jchar *elems, + jint mode) { + functions->ReleaseCharArrayElements(this,array,elems,mode); + } + void ReleaseShortArrayElements(jshortArray array, + jshort *elems, + jint mode) { + functions->ReleaseShortArrayElements(this,array,elems,mode); + } + void ReleaseIntArrayElements(jintArray array, + jint *elems, + jint mode) { + functions->ReleaseIntArrayElements(this,array,elems,mode); + } + void ReleaseLongArrayElements(jlongArray array, + jlong *elems, + jint mode) { + functions->ReleaseLongArrayElements(this,array,elems,mode); + } + void ReleaseFloatArrayElements(jfloatArray array, + jfloat *elems, + jint mode) { + functions->ReleaseFloatArrayElements(this,array,elems,mode); + } + void ReleaseDoubleArrayElements(jdoubleArray array, + jdouble *elems, + jint mode) { + functions->ReleaseDoubleArrayElements(this,array,elems,mode); + } + + void GetBooleanArrayRegion(jbooleanArray array, + jsize start, jsize len, jboolean *buf) { + functions->GetBooleanArrayRegion(this,array,start,len,buf); + } + void GetByteArrayRegion(jbyteArray array, + jsize start, jsize len, jbyte *buf) { + functions->GetByteArrayRegion(this,array,start,len,buf); + } + void GetCharArrayRegion(jcharArray array, + jsize start, jsize len, jchar *buf) { + functions->GetCharArrayRegion(this,array,start,len,buf); + } + void GetShortArrayRegion(jshortArray array, + jsize start, jsize len, jshort *buf) { + functions->GetShortArrayRegion(this,array,start,len,buf); + } + void GetIntArrayRegion(jintArray array, + jsize start, jsize len, jint *buf) { + functions->GetIntArrayRegion(this,array,start,len,buf); + } + void GetLongArrayRegion(jlongArray array, + jsize start, jsize len, jlong *buf) { + functions->GetLongArrayRegion(this,array,start,len,buf); + } + void GetFloatArrayRegion(jfloatArray array, + jsize start, jsize len, jfloat *buf) { + functions->GetFloatArrayRegion(this,array,start,len,buf); + } + void GetDoubleArrayRegion(jdoubleArray array, + jsize start, jsize len, jdouble *buf) { + functions->GetDoubleArrayRegion(this,array,start,len,buf); + } + + void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, + const jboolean *buf) { + functions->SetBooleanArrayRegion(this,array,start,len,buf); + } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, + const jbyte *buf) { + functions->SetByteArrayRegion(this,array,start,len,buf); + } + void SetCharArrayRegion(jcharArray array, jsize start, jsize len, + const jchar *buf) { + functions->SetCharArrayRegion(this,array,start,len,buf); + } + void SetShortArrayRegion(jshortArray array, jsize start, jsize len, + const jshort *buf) { + functions->SetShortArrayRegion(this,array,start,len,buf); + } + void SetIntArrayRegion(jintArray array, jsize start, jsize len, + const jint *buf) { + functions->SetIntArrayRegion(this,array,start,len,buf); + } + void SetLongArrayRegion(jlongArray array, jsize start, jsize len, + const jlong *buf) { + functions->SetLongArrayRegion(this,array,start,len,buf); + } + void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, + const jfloat *buf) { + functions->SetFloatArrayRegion(this,array,start,len,buf); + } + void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, + const jdouble *buf) { + functions->SetDoubleArrayRegion(this,array,start,len,buf); + } + + jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, + jint nMethods) { + return functions->RegisterNatives(this,clazz,methods,nMethods); + } + jint UnregisterNatives(jclass clazz) { + return functions->UnregisterNatives(this,clazz); + } + + jint MonitorEnter(jobject obj) { + return functions->MonitorEnter(this,obj); + } + jint MonitorExit(jobject obj) { + return functions->MonitorExit(this,obj); + } + + jint GetJavaVM(JavaVM **vm) { + return functions->GetJavaVM(this,vm); + } + + void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { + functions->GetStringRegion(this,str,start,len,buf); + } + void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { + functions->GetStringUTFRegion(this,str,start,len,buf); + } + + void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { + return functions->GetPrimitiveArrayCritical(this,array,isCopy); + } + void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { + functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); + } + + const jchar * GetStringCritical(jstring string, jboolean *isCopy) { + return functions->GetStringCritical(this,string,isCopy); + } + void ReleaseStringCritical(jstring string, const jchar *cstring) { + functions->ReleaseStringCritical(this,string,cstring); + } + + jweak NewWeakGlobalRef(jobject obj) { + return functions->NewWeakGlobalRef(this,obj); + } + void DeleteWeakGlobalRef(jweak ref) { + functions->DeleteWeakGlobalRef(this,ref); + } + + jboolean ExceptionCheck() { + return functions->ExceptionCheck(this); + } + + jobject NewDirectByteBuffer(void* address, jlong capacity) { + return functions->NewDirectByteBuffer(this, address, capacity); + } + void* GetDirectBufferAddress(jobject buf) { + return functions->GetDirectBufferAddress(this, buf); + } + jlong GetDirectBufferCapacity(jobject buf) { + return functions->GetDirectBufferCapacity(this, buf); + } + jobjectRefType GetObjectRefType(jobject obj) { + return functions->GetObjectRefType(this, obj); + } + +#endif /* __cplusplus */ +}; + +typedef struct JavaVMOption { + char *optionString; + void *extraInfo; +} JavaVMOption; + +typedef struct JavaVMInitArgs { + jint version; + + jint nOptions; + JavaVMOption *options; + jboolean ignoreUnrecognized; +} JavaVMInitArgs; + +typedef struct JavaVMAttachArgs { + jint version; + + char *name; + jobject group; +} JavaVMAttachArgs; + +/* These will be VM-specific. */ + +#define JDK1_2 +#define JDK1_4 + +/* End VM-specific. */ + +struct JNIInvokeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM)(JavaVM *vm); + + jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); + + jint (JNICALL *DetachCurrentThread)(JavaVM *vm); + + jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); + + jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); +}; + +struct JavaVM_ { + const struct JNIInvokeInterface_ *functions; +#ifdef __cplusplus + + jint DestroyJavaVM() { + return functions->DestroyJavaVM(this); + } + jint AttachCurrentThread(void **penv, void *args) { + return functions->AttachCurrentThread(this, penv, args); + } + jint DetachCurrentThread() { + return functions->DetachCurrentThread(this); + } + + jint GetEnv(void **penv, jint version) { + return functions->GetEnv(this, penv, version); + } + jint AttachCurrentThreadAsDaemon(void **penv, void *args) { + return functions->AttachCurrentThreadAsDaemon(this, penv, args); + } +#endif +}; + +#ifdef _JNI_IMPLEMENTATION_ +#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT +#else +#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT +#endif +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetDefaultJavaVMInitArgs(void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + +/* Defined by native libraries. */ +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved); + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved); + +#define JNI_VERSION_1_1 0x00010001 +#define JNI_VERSION_1_2 0x00010002 +#define JNI_VERSION_1_4 0x00010004 +#define JNI_VERSION_1_6 0x00010006 +#define JNI_VERSION_1_8 0x00010008 + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_JAVASOFT_JNI_H_ */ diff --git a/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni_md.h b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni_md.h new file mode 100644 index 0000000..3808001 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/Includes/jni_md.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT __declspec(dllexport) +#define JNIIMPORT __declspec(dllimport) +#define JNICALL __stdcall + +typedef long jint; +typedef __int64 jlong; +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerControlNative.h new file mode 100644 index 0000000..226831c --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerControlNative.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_CaptureManagerControlNative */ + +#ifndef _Included_capturemanager_classes_CaptureManagerControlNative +#define _Included_capturemanager_classes_CaptureManagerControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_CaptureManagerControlNative + * Method: createControl + * Signature: (JLjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerControlNative_createControl + (JNIEnv *, jobject, jlong, jstring); + +/* + * Class: capturemanager_classes_CaptureManagerControlNative + * Method: createMisc + * Signature: (JLjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerControlNative_createMisc + (JNIEnv *, jobject, jlong, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerNativeProxy.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerNativeProxy.h new file mode 100644 index 0000000..326def2 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_CaptureManagerNativeProxy.h @@ -0,0 +1,37 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_CaptureManagerNativeProxy */ + +#ifndef _Included_capturemanager_classes_CaptureManagerNativeProxy +#define _Included_capturemanager_classes_CaptureManagerNativeProxy +#ifdef __cplusplus +extern "C" { +#endif +/* +* Class: capturemanager_classes_CaptureManagerNativeProxy +* Method: explicitGetPtrClass +* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J +*/ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_explicitGetPtrClass + (JNIEnv *, jobject, jstring, jstring, jstring); + +/* + * Class: capturemanager_classes_CaptureManagerNativeProxy + * Method: getPtrClass + * Signature: (Ljava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT void JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_freeLibrary +(JNIEnv *, jobject, jstring); + +/* + * Class: capturemanager_classes_CaptureManagerNativeProxy + * Method: Release + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_capturemanager_classes_CaptureManagerNativeProxy_Release + (JNIEnv *, jobject, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EVRSinkFactoryNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EVRSinkFactoryNative.h new file mode 100644 index 0000000..b9c1ea9 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EVRSinkFactoryNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_EVRSinkFactoryNative */ + +#ifndef _Included_capturemanager_classes_EVRSinkFactoryNative +#define _Included_capturemanager_classes_EVRSinkFactoryNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_EVRSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/awt/Component;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_EVRSinkFactoryNative_createOutputNode + (JNIEnv *, jobject, jlong, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderControlNative.h new file mode 100644 index 0000000..83cb015 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderControlNative.h @@ -0,0 +1,37 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_EncoderControlNative */ + +#ifndef _Included_capturemanager_classes_EncoderControlNative +#define _Included_capturemanager_classes_EncoderControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_EncoderControlNative + * Method: createEncoderNodeFactory + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderControlNative_createEncoderNodeFactory + (JNIEnv *, jobject, jlong, jstring, jstring); + +/* + * Class: capturemanager_classes_EncoderControlNative + * Method: getCollectionOfEncoders + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_capturemanager_classes_EncoderControlNative_getCollectionOfEncoders + (JNIEnv *, jobject, jlong); + +/* + * Class: capturemanager_classes_EncoderControlNative + * Method: getMediaTypeCollectionOfEncoder + * Signature: (JJLjava/lang/String;)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_capturemanager_classes_EncoderControlNative_getMediaTypeCollectionOfEncoder + (JNIEnv *, jobject, jlong, jlong, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderNodeFactoryNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderNodeFactoryNative.h new file mode 100644 index 0000000..0efd2f0 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_EncoderNodeFactoryNative.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_EncoderNodeFactoryNative */ + +#ifndef _Included_capturemanager_classes_EncoderNodeFactoryNative +#define _Included_capturemanager_classes_EncoderNodeFactoryNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_EncoderNodeFactoryNative + * Method: createCompressedMediaType + * Signature: (JJLjava/lang/String;II)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderNodeFactoryNative_createCompressedMediaType + (JNIEnv *, jobject, jlong, jlong, jstring, jint, jint); + +/* + * Class: capturemanager_classes_EncoderNodeFactoryNative + * Method: createEncoderNode + * Signature: (JJLjava/lang/String;IIJ)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_EncoderNodeFactoryNative_createEncoderNode + (JNIEnv *, jobject, jlong, jlong, jstring, jint, jint, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_FileSinkFactoryNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_FileSinkFactoryNative.h new file mode 100644 index 0000000..2a2ed86 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_FileSinkFactoryNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_FileSinkFactoryNative */ + +#ifndef _Included_capturemanager_classes_FileSinkFactoryNative +#define _Included_capturemanager_classes_FileSinkFactoryNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_FileSinkFactoryNative + * Method: createOutputNodes + * Signature: (J[JLjava/lang/String;)[J + */ +JNIEXPORT jlongArray JNICALL Java_capturemanager_classes_FileSinkFactoryNative_createOutputNodes + (JNIEnv *, jobject, jlong, jlongArray, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_LogPrintOutControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_LogPrintOutControlNative.h new file mode 100644 index 0000000..e8ce09a --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_LogPrintOutControlNative.h @@ -0,0 +1,37 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_LogPrintOutControlNative */ + +#ifndef _Included_capturemanager_classes_LogPrintOutControlNative +#define _Included_capturemanager_classes_LogPrintOutControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: addPrintOutDestinationNative + * Signature: (JILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_addPrintOutDestinationNative + (JNIEnv *, jobject, jlong, jint, jstring); + +/* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: removePrintOutDestinationNative + * Signature: (JILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_removePrintOutDestinationNative + (JNIEnv *, jobject, jlong, jint, jstring); + +/* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: setVerboseNative + * Signature: (JILjava/lang/String;Ljava/lang/Boolean;)V + */ +JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_setVerboseNative + (JNIEnv *, jobject, jlong, jint, jstring, jboolean); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallNative.h new file mode 100644 index 0000000..cadbfa4 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallNative.h @@ -0,0 +1,24 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SampleGrabberCallNative */ + +#ifndef _Included_capturemanager_classes_SampleGrabberCallNative +#define _Included_capturemanager_classes_SampleGrabberCallNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SampleGrabberCallNative + * Method: readData + * Signature: (J[B)I + */ +JNIEXPORT jint JNICALL Java_capturemanager_classes_SampleGrabberCallNative_readData + (JNIEnv *, jobject, jlong, jobject); + +JNIEXPORT void JNICALL Java_capturemanager_classes_SampleGrabberCallNative_RGB32ToARGB +(JNIEnv*, jobject, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallSinkFactoryNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallSinkFactoryNative.h new file mode 100644 index 0000000..4630c5b --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallSinkFactoryNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SampleGrabberCallSinkFactoryNative */ + +#ifndef _Included_capturemanager_classes_SampleGrabberCallSinkFactoryNative +#define _Included_capturemanager_classes_SampleGrabberCallSinkFactoryNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SampleGrabberCallSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/lang/String;Ljava/lang/String;ILjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SampleGrabberCallSinkFactoryNative_createOutputNode + (JNIEnv *, jobject, jlong, jstring, jstring, jint, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallbackSinkFactoryNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallbackSinkFactoryNative.h new file mode 100644 index 0000000..32962be --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SampleGrabberCallbackSinkFactoryNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SampleGrabberCallbackSinkFactoryNative */ + +#ifndef _Included_capturemanager_classes_SampleGrabberCallbackSinkFactoryNative +#define _Included_capturemanager_classes_SampleGrabberCallbackSinkFactoryNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SampleGrabberCallbackSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/Object;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SampleGrabberCallbackSinkFactoryNative_createOutputNode + (JNIEnv *, jobject, jlong, jstring, jstring, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionControlNative.h new file mode 100644 index 0000000..e0d5056 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionControlNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SessionControlNative */ + +#ifndef _Included_capturemanager_classes_SessionControlNative +#define _Included_capturemanager_classes_SessionControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SessionControlNative + * Method: createSession + * Signature: (J[JLjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SessionControlNative_createSession + (JNIEnv *, jobject, jlong, jlongArray, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionNative.h new file mode 100644 index 0000000..ab53520 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SessionNative.h @@ -0,0 +1,61 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SessionNative */ + +#ifndef _Included_capturemanager_classes_SessionNative +#define _Included_capturemanager_classes_SessionNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SessionNative + * Method: closeSession + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_closeSession + (JNIEnv *, jobject, jlong); + +/* + * Class: capturemanager_classes_SessionNative + * Method: addIUpdateStateListener + * Signature: (JLjava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_addIUpdateStateListener + (JNIEnv *, jobject, jlong, jobject); + +/* + * Class: capturemanager_classes_SessionNative + * Method: getSessionDescriptor + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_capturemanager_classes_SessionNative_getSessionDescriptor + (JNIEnv *, jobject, jlong); + +/* + * Class: capturemanager_classes_SessionNative + * Method: pauseSession + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_pauseSession + (JNIEnv *, jobject, jlong); + +/* + * Class: capturemanager_classes_SessionNative + * Method: startSession + * Signature: (JJLjava/lang/String;)Z + */ +JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_startSession + (JNIEnv *, jobject, jlong, jlong, jstring); + +/* + * Class: capturemanager_classes_SessionNative + * Method: stopSession + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_stopSession + (JNIEnv *, jobject, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SinkControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SinkControlNative.h new file mode 100644 index 0000000..0432af7 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SinkControlNative.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SinkControlNative */ + +#ifndef _Included_capturemanager_classes_SinkControlNative +#define _Included_capturemanager_classes_SinkControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SinkControlNative + * Method: createSinkFactory + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SinkControlNative_createSinkFactory + (JNIEnv *, jobject, jlong, jstring, jstring); + +/* + * Class: capturemanager_classes_SinkControlNative + * Method: getCollectionOfSinks + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_capturemanager_classes_SinkControlNative_getCollectionOfSinks + (JNIEnv *, jobject, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SourceControlNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SourceControlNative.h new file mode 100644 index 0000000..3ad6bc7 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_SourceControlNative.h @@ -0,0 +1,53 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_SourceControlNative */ + +#ifndef _Included_capturemanager_classes_SourceControlNative +#define _Included_capturemanager_classes_SourceControlNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceControl + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceControl + (JNIEnv *, jobject, jlong, jstring, jstring); + +/* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceNode + * Signature: (JLjava/lang/String;II)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceNode + (JNIEnv *, jobject, jlong, jstring, jint, jint); + +/* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceNodeWithDownStreamConnection + * Signature: (JLjava/lang/String;IIJ)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceNodeWithDownStreamConnection + (JNIEnv *, jobject, jlong, jstring, jint, jint, jlong); + +/* + * Class: capturemanager_classes_SourceControlNative + * Method: getCollectionOfSources + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_capturemanager_classes_SourceControlNative_getCollectionOfSources + (JNIEnv *, jobject, jlong); + +/* + * Class: capturemanager_classes_SourceControlNative + * Method: getSourceOutputMediaType + * Signature: (JLjava/lang/String;II)J + */ +JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_getSourceOutputMediaType + (JNIEnv *, jobject, jlong, jstring, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_StrideForBitmapNative.h b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_StrideForBitmapNative.h new file mode 100644 index 0000000..0525d8a --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/JNI/capturemanager_classes_StrideForBitmapNative.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class capturemanager_classes_StrideForBitmapNative */ + +#ifndef _Included_capturemanager_classes_StrideForBitmapNative +#define _Included_capturemanager_classes_StrideForBitmapNative +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: capturemanager_classes_StrideForBitmapNative + * Method: getStrideForBitmap + * Signature: (JLjava/lang/String;I)I + */ +JNIEXPORT jint JNICALL Java_capturemanager_classes_StrideForBitmapNative_getStrideForBitmap + (JNIEnv *, jobject, jlong, jstring, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/natives/capturemanager/CaptureManagerNativeProxy/LogPrintOutControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/LogPrintOutControlNative.cpp new file mode 100644 index 0000000..fc7ae96 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/LogPrintOutControlNative.cpp @@ -0,0 +1,102 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_LogPrintOutControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: addPrintOutDestinationNative + * Signature: (JILjava/lang/String;)V + */ + JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_addPrintOutDestinationNative + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jint aLevel, jstring aFilePath) + { + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + ILogPrintOutControl* lPtrILogPrintOutControl = (ILogPrintOutControl*)aPtr; + + const jchar *lPtrFilePath = aPtrEnv->GetStringChars(aFilePath, nullptr); + + HRESULT lres = lPtrILogPrintOutControl->addPrintOutDestination( + aLevel, + (BSTR)lPtrFilePath); + + if (FAILED(lres)) + { + lres = E_FAIL; + } + + } while (false); + } + /* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: removePrintOutDestinationNative + * Signature: (JILjava/lang/String;)V + */ + JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_removePrintOutDestinationNative + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jint aLevel, jstring aFilePath) + { + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + ILogPrintOutControl* lPtrILogPrintOutControl = (ILogPrintOutControl*)aPtr; + + const jchar *lPtrFilePath = aPtrEnv->GetStringChars(aFilePath, nullptr); + + lPtrILogPrintOutControl->removePrintOutDestination( + aLevel, + (BSTR)lPtrFilePath); + + } while (false); + } + + /* + * Class: capturemanager_classes_LogPrintOutControlNative + * Method: setVerboseNative + * Signature: (JILjava/lang/String;Ljava/lang/Boolean;)V + */ + JNIEXPORT void JNICALL Java_capturemanager_classes_LogPrintOutControlNative_setVerboseNative + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jint aLevel, jstring aFilePath, jboolean aState) + { + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + ILogPrintOutControl* lPtrILogPrintOutControl = (ILogPrintOutControl*)aPtr; + + const jchar *lPtrFilePath = aPtrEnv->GetStringChars(aFilePath, nullptr); + + lPtrILogPrintOutControl->setVerbose( + aLevel, + (BSTR)lPtrFilePath, + aState); + + } while (false); + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallNative.cpp new file mode 100644 index 0000000..3b89301 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallNative.cpp @@ -0,0 +1,83 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_SampleGrabberCallNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SampleGrabberCallNative + * Method: readData + * Signature: (J[B)I + */ + JNIEXPORT jint JNICALL Java_capturemanager_classes_SampleGrabberCallNative_readData + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jobject byteBuffer) + { + jint lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (byteBuffer == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + void* bufferAddress = aPtrEnv->GetDirectBufferAddress(byteBuffer); + + if (bufferAddress == nullptr) + break; + + DWORD lReadSize; + + lhr = lObject->readData( + bufferAddress, + &lReadSize); + + if (FAILED(lhr)) + break; + + lresult = (jint) lReadSize; + + } while (false); + + return lresult; + } + + JNIEXPORT void JNICALL Java_capturemanager_classes_SampleGrabberCallNative_RGB32ToBGRA + (JNIEnv* aPtrEnv, jobject aClass, jobject byteBuffer) + { + jbyte* bufferAddress = (jbyte*) aPtrEnv->GetDirectBufferAddress(byteBuffer); + + if (bufferAddress == nullptr) + return; + + jlong capacity = aPtrEnv->GetDirectBufferCapacity(byteBuffer); + + //We just actually need to fill the alpha, all other values are in place for Java's BGRA. RGB32 does not set alpha (is 0). + for (jlong i = 0; i < capacity; i += 4) { + bufferAddress[i + 3] = 0xFF;//Alpha = 1.0 + } + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallSinkFactoryNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallSinkFactoryNative.cpp new file mode 100644 index 0000000..9d83cb9 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallSinkFactoryNative.cpp @@ -0,0 +1,98 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_SampleGrabberCallSinkFactoryNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SampleGrabberCallSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/lang/String;Ljava/lang/String;ILjava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SampleGrabberCallSinkFactoryNative_createOutputNode + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aStringMajorType, jstring aStringSubType, jint aSampleByteSize, jstring aStringIID) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aStringMajorType == nullptr) + break; + + if (aStringSubType == nullptr) + break; + + if (aStringIID == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringMajorType = aPtrEnv->GetStringChars(aStringMajorType, nullptr); + + CLSID lMajorTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringMajorType, &lMajorTypeGUID); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringSubType = aPtrEnv->GetStringChars(aStringSubType, nullptr); + + CLSID lSubTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringSubType, &lSubTypeGUID); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lIID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lIID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lOutputNode; + + lhr = lObject->createOutputNode( + lMajorTypeGUID, + lSubTypeGUID, + aSampleByteSize, + lIID, + &lOutputNode); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lOutputNode.detach(); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallbackSinkFactoryNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallbackSinkFactoryNative.cpp new file mode 100644 index 0000000..87ac4f0 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SampleGrabberCallbackSinkFactoryNative.cpp @@ -0,0 +1,283 @@ +#define WIN32_LEAN_AND_MEAN + + +#include +#include + + +#include "JNI\capturemanager_classes_SampleGrabberCallbackSinkFactoryNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + + +class SampleGrabberCallback : public ISampleGrabberCallback +{ +private: + + JavaVM * mPtrJavaVM = nullptr; + + jobject mIUpdateStateListener = nullptr; + +public: + + SampleGrabberCallback( + JavaVM * aPtrJavaVM, + jobject aIUpdateStateListener) : + mRefCount(1), + mPtrJavaVM(aPtrJavaVM), + mIUpdateStateListener(aIUpdateStateListener) + {} + + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE invoke( + /* [in] */ REFGUID aGUIDMajorMediaType, + /* [in] */ DWORD aSampleFlags, + /* [in] */ LONGLONG aSampleTime, + /* [in] */ LONGLONG aSampleDuration, + /* [in] */ LPVOID aPtrSampleBuffer, + /* [in] */ DWORD aSampleSize) + { + do + { + if (mPtrJavaVM == nullptr) + break; + + JNIEnv * lPtrEnv; + + // double check it's all ok + int getEnvStat = mPtrJavaVM->GetEnv((void **)&lPtrEnv, JNI_VERSION_1_6); + + if (getEnvStat == JNI_EDETACHED) { + + if (mPtrJavaVM->AttachCurrentThread((void **)&lPtrEnv, NULL) != 0) + { + + } + } + else if (getEnvStat == JNI_OK) { + // + } + else if (getEnvStat == JNI_EVERSION) { + //std::cout << "GetEnv: version not supported" << std::endl; + } + + + + + + if (mIUpdateStateListener == nullptr) + break; + + jclass thisClass = lPtrEnv->GetObjectClass(mIUpdateStateListener); + + if (thisClass == nullptr) + break; + + jmethodID linvoke = lPtrEnv->GetMethodID(thisClass, + "invoke", "([BI)V"); + + if (linvoke == nullptr) + break; + + jbyteArray lByteArray = lPtrEnv->NewByteArray(aSampleSize); + + //jdouble average = lPtrEnv->CallIntMethod( + // mIUpdateStateListener, linvoke, aCallbackEventCode, aSessionDescriptor); + + mPtrJavaVM->DetachCurrentThread(); + + } while (false); + + + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject) + { + HRESULT lhresult = E_NOINTERFACE; + + do + { + if (ppvObject == NULL) + { + lhresult = E_POINTER; + + break; + } + + lhresult = S_OK; + + if (riid == IID_IUnknown) + { + *ppvObject = static_cast(this); + + break; + } + else if (riid == + __uuidof(ISessionCallback)) + { + *ppvObject = static_cast(this); + + break; + } + + *ppvObject = NULL; + + lhresult = E_NOINTERFACE; + + } while (false); + + if (SUCCEEDED(lhresult)) + AddRef(); + + return lhresult; + } + + virtual ULONG STDMETHODCALLTYPE AddRef(void) + { + return ++mRefCount; + } + + virtual ULONG STDMETHODCALLTYPE Release(void) + { + ULONG lCount = --mRefCount; + + if (lCount == 0) + { + delete this; + } + return lCount; + } + +private: + + std::atomic mRefCount; + + virtual ~SampleGrabberCallback() + { + if (mPtrJavaVM == nullptr) + return; + + JNIEnv * lPtrEnv; + + int getEnvStat = mPtrJavaVM->GetEnv((void **)&lPtrEnv, JNI_VERSION_1_6); + + if (getEnvStat == JNI_EDETACHED) { + + if (mPtrJavaVM->AttachCurrentThread((void **)&lPtrEnv, NULL) != 0) + { + + } + } + else if (getEnvStat == JNI_OK) { + // + } + else if (getEnvStat == JNI_EVERSION) { + + return; + } + + if (lPtrEnv) + lPtrEnv->DeleteGlobalRef(mIUpdateStateListener); + + mPtrJavaVM->DetachCurrentThread(); + + } +}; + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SampleGrabberCallbackSinkFactoryNative + * Method: createOutputNode + * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/Object;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SampleGrabberCallbackSinkFactoryNative_createOutputNode + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aStringMajorType, jstring aStringSubType, jobject aPtrISampleGrabberCallback) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aStringMajorType == nullptr) + break; + + if (aStringSubType == nullptr) + break; + + if (aPtrISampleGrabberCallback == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringMajorType = aPtrEnv->GetStringChars(aStringMajorType, nullptr); + + CLSID lMajorTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringMajorType, &lMajorTypeGUID); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringSubType = aPtrEnv->GetStringChars(aStringSubType, nullptr); + + CLSID lSubTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringSubType, &lSubTypeGUID); + + if (FAILED(lhr)) + break; + + + + auto lGlobalISampleGrabberCallback = aPtrEnv->NewGlobalRef(aPtrISampleGrabberCallback); + + JavaVM * lPtrJavaVM; + + auto EnvStat = aPtrEnv->GetJavaVM(&lPtrJavaVM); + + if (EnvStat != JNI_OK) + break; + + //JNI_VERSION_1_8 + + CComPtrCustom lSampleGrabberCallback = new SampleGrabberCallback( + lPtrJavaVM, + lGlobalISampleGrabberCallback); + + + CComPtrCustom lOutputNode; + + lhr = lObject->createOutputNode( + lMajorTypeGUID, + lSubTypeGUID, + lSampleGrabberCallback, + &lOutputNode); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lOutputNode.detach(); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SessionControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SessionControlNative.cpp new file mode 100644 index 0000000..9dc2da7 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SessionControlNative.cpp @@ -0,0 +1,138 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + +#include "jawt_md.h" +#include "JNI\capturemanager_classes_SessionControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SessionControlNative + * Method: createSession + * Signature: (J[JLjava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SessionControlNative_createSession + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jlongArray aPtrSourceNodesOfTopologys, jstring aStringIID) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aClass == nullptr) + break; + + if (aPtrEnv == nullptr) + break; + + if (aPtrSourceNodesOfTopologys == nullptr) + break; + + if (aStringIID == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lInterfaceID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lInterfaceID); + + if (FAILED(lhr)) + break; + + + auto lPtrSourceNodesOfTopologys = aPtrEnv->GetLongArrayElements(aPtrSourceNodesOfTopologys, nullptr); + + if (lPtrSourceNodesOfTopologys == nullptr) + break; + + auto lArrayLength = aPtrEnv->GetArrayLength(aPtrSourceNodesOfTopologys); + + SAFEARRAY* pSA = NULL; + SAFEARRAYBOUND bound[1]; + bound[0].lLbound = 0; + bound[0].cElements = lArrayLength; + pSA = SafeArrayCreate(VT_VARIANT, 1, bound); + + for (long i = 0; i < lArrayLength; i++) + { + jlong lPtr = lPtrSourceNodesOfTopologys[i]; + + if (lPtr == 0) + continue; + + IUnknown* lPtrIUnknown = (IUnknown*)lPtr; + + VARIANT lVar; + + VariantInit(&lVar); + + lVar.vt = VT_UNKNOWN; + + lVar.punkVal = lPtrIUnknown; + + lhr = SafeArrayPutElement(pSA, &i, &lVar); + + if (FAILED(lhr)) + break; + + } + + if (FAILED(lhr)) + break; + + + + VARIANT theArray; + + VariantInit(&theArray); + + theArray.vt = VT_SAFEARRAY | VT_UNKNOWN; + + theArray.parray = pSA; + + + + CComPtrCustom lSession; + + lhr = lObject->createSession( + theArray, + lInterfaceID, + &lSession); + + SafeArrayDestroy(pSA); + + VariantClear(&theArray); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lSession.detach(); + + } while (false); + + return lresult; + + }; + + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SessionNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SessionNative.cpp new file mode 100644 index 0000000..2d0fe1c --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SessionNative.cpp @@ -0,0 +1,475 @@ +#define WIN32_LEAN_AND_MEAN + + +#include +#include + + +#include "JNI\capturemanager_classes_SessionNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#define IID_PPV_ARGSIUnknown(ppType) __uuidof(**(ppType)), (IUnknown**)(ppType) + + + +class SessionCallback : public ISessionCallback +{ +private: + + JavaVM * mPtrJavaVM = nullptr; + + jobject mIUpdateStateListener = nullptr; + +public: + + SessionCallback( + JavaVM * aPtrJavaVM, + jobject aIUpdateStateListener) : + mRefCount(1), + mPtrJavaVM(aPtrJavaVM), + mIUpdateStateListener(aIUpdateStateListener) + {} + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE invoke( + /* [in] */ DWORD aCallbackEventCode, + /* [in] */ DWORD aSessionDescriptor) + { + do + { + if (mPtrJavaVM == nullptr) + break; + + JNIEnv * lPtrEnv; + + // double check it's all ok + int getEnvStat = mPtrJavaVM->GetEnv((void **)&lPtrEnv, JNI_VERSION_1_6); + + if (getEnvStat == JNI_EDETACHED) { + + if (mPtrJavaVM->AttachCurrentThread((void **)&lPtrEnv, NULL) != 0) + { + + } + } + else if (getEnvStat == JNI_OK) { + // + } + else if (getEnvStat == JNI_EVERSION) { + //std::cout << "GetEnv: version not supported" << std::endl; + } + + + + + + if (mIUpdateStateListener == nullptr) + break; + + jclass thisClass = lPtrEnv->GetObjectClass(mIUpdateStateListener); + + if (thisClass == nullptr) + break; + + jmethodID linvoke = lPtrEnv->GetMethodID(thisClass, + "invoke", "(II)V"); + + if (linvoke == nullptr) + break; + + jdouble average = lPtrEnv->CallIntMethod( + mIUpdateStateListener, linvoke, aCallbackEventCode, aSessionDescriptor); + + mPtrJavaVM->DetachCurrentThread(); + + } while (false); + + + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject) + { + HRESULT lhresult = E_NOINTERFACE; + + do + { + if (ppvObject == NULL) + { + lhresult = E_POINTER; + + break; + } + + lhresult = S_OK; + + if (riid == IID_IUnknown) + { + *ppvObject = static_cast(this); + + break; + } + else if (riid == + __uuidof(ISessionCallback)) + { + *ppvObject = static_cast(this); + + break; + } + + *ppvObject = NULL; + + lhresult = E_NOINTERFACE; + + } while (false); + + if (SUCCEEDED(lhresult)) + AddRef(); + + return lhresult; + } + + virtual ULONG STDMETHODCALLTYPE AddRef(void) + { + return ++mRefCount; + } + + virtual ULONG STDMETHODCALLTYPE Release(void) + { + ULONG lCount = --mRefCount; + + if (lCount == 0) + { + delete this; + } + return lCount; + } + +private: + + std::atomic mRefCount; + + virtual ~SessionCallback() + { + if (mPtrJavaVM == nullptr) + return; + + JNIEnv * lPtrEnv; + + int getEnvStat = mPtrJavaVM->GetEnv((void **)&lPtrEnv, JNI_VERSION_1_6); + + if (getEnvStat == JNI_EDETACHED) { + + if (mPtrJavaVM->AttachCurrentThread((void **)&lPtrEnv, NULL) != 0) + { + + } + } + else if (getEnvStat == JNI_OK) { + // + } + else if (getEnvStat == JNI_EVERSION) { + + return; + } + + if (lPtrEnv) + lPtrEnv->DeleteGlobalRef(mIUpdateStateListener); + + mPtrJavaVM->DetachCurrentThread(); + + } +}; + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SessionNative + * Method: closeSession + * Signature: (J)Z + */ + JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_closeSession + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jboolean lresult = JNI_FALSE; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + lhr = lObject->closeSession(); + + if (FAILED(lhr)) + break; + + lresult = JNI_TRUE; + + } while (false); + + return lresult; + } + + + /* + * Class: capturemanager_classes_SessionNative + * Method: addIUpdateStateListener + * Signature: (JLjava/lang/Object;)Z + */ + JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_addIUpdateStateListener + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jobject aIUpdateStateListener) + { + jboolean lresult = JNI_FALSE; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + + CComPtrCustom IConnectionPointContainer; + + lhr = lObject->getIConnectionPointContainer( + IID_PPV_ARGSIUnknown(&IConnectionPointContainer)); + + if (FAILED(lhr)) + break; + + CComPtrCustom lConnectionPoint; + + lhr = IConnectionPointContainer->FindConnectionPoint( + __uuidof(ISessionCallback), + &lConnectionPoint); + + if (FAILED(lhr)) + break; + + + + auto lGlobalIUpdateStateListener = aPtrEnv->NewGlobalRef(aIUpdateStateListener); + + JavaVM * lPtrJavaVM; + + auto EnvStat = aPtrEnv->GetJavaVM(&lPtrJavaVM); + + if (EnvStat != JNI_OK) + break; + + //JNI_VERSION_1_8 + + CComPtrCustom lSessionCallback = new SessionCallback( + lPtrJavaVM, + lGlobalIUpdateStateListener); + + DWORD lStreamID; + + lhr = lConnectionPoint->Advise( + lSessionCallback, + &lStreamID); + + if (FAILED(lhr)) + break; + + lresult = JNI_TRUE; + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SessionNative + * Method: getSessionDescriptor + * Signature: (J)I + */ + JNIEXPORT jint JNICALL Java_capturemanager_classes_SessionNative_getSessionDescriptor + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jint lresult = -1; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + DWORD lSessionDescriptor = 0; + + lhr = lObject->getSessionDescriptor(&lSessionDescriptor); + + if (FAILED(lhr)) + break; + + lresult = lSessionDescriptor; + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SessionNative + * Method: pauseSession + * Signature: (J)Z + */ + JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_pauseSession + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jboolean lresult = JNI_FALSE; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + lhr = lObject->pauseSession(); + + if (FAILED(lhr)) + break; + + lresult = JNI_TRUE; + + } while (false); + + return lresult; + } + /* + * Class: capturemanager_classes_SessionNative + * Method: startSession + * Signature: (JJLjava/lang/String;)Z + */ + JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_startSession + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jlong aStartTime, jstring aStringGUIDTimeType) + { + jboolean lresult = JNI_FALSE; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringGUIDTimeType, nullptr); + + CLSID lGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lGUID); + + if (FAILED(lhr)) + break; + + lhr = lObject->startSession( + aStartTime, + lGUID); + + if (FAILED(lhr)) + break; + + lresult = JNI_TRUE; + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SessionNative + * Method: stopSession + * Signature: (J)Z + */ + JNIEXPORT jboolean JNICALL Java_capturemanager_classes_SessionNative_stopSession + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jboolean lresult = JNI_FALSE; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + lhr = lObject->stopSession(); + + if (FAILED(lhr)) + break; + + lresult = JNI_TRUE; + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SinkControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SinkControlNative.cpp new file mode 100644 index 0000000..4ad0930 --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SinkControlNative.cpp @@ -0,0 +1,127 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_SinkControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SinkControlNative + * Method: createSinkFactory + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SinkControlNative_createSinkFactory + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aStringContainerTypeGUID, jstring aStringIID) + + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringContainerTypeGUID = aPtrEnv->GetStringChars(aStringContainerTypeGUID, nullptr); + + CLSID lContainerTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringContainerTypeGUID, &lContainerTypeGUID); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lInterfaceID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lInterfaceID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lIUnknown; + + lhr = lObject->createSinkFactory( + lContainerTypeGUID, + lInterfaceID, + &lIUnknown); + + if (FAILED(lhr)) + break; + + if (!lIUnknown) + break; + + lresult = (jlong)lIUnknown.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SinkControlNative + * Method: getCollectionOfSinks + * Signature: (J)Ljava/lang/String; + */ + JNIEXPORT jstring JNICALL Java_capturemanager_classes_SinkControlNative_getCollectionOfSinks + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jstring lresult = nullptr; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + BSTR lXMLstring = nullptr; + + lhr = lObject->getCollectionOfSinks(&lXMLstring); + + if (FAILED(lhr)) + break; + + auto lLength = SysStringLen(lXMLstring); + + lresult = aPtrEnv->NewString((jchar*)lXMLstring, lLength); + + SysFreeString(lXMLstring); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/SourceControlNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/SourceControlNative.cpp new file mode 100644 index 0000000..d1376ba --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/SourceControlNative.cpp @@ -0,0 +1,273 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_SourceControlNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceControl + * Signature: (JLjava/lang/String;Ljava/lang/String;)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceControl + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aSymbolicLink, jstring aStringIID) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aSymbolicLink == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + + const jchar *lPtrStringIID = aPtrEnv->GetStringChars(aStringIID, nullptr); + + CLSID lIID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringIID, &lIID); + + if (FAILED(lhr)) + break; + + CComPtrCustom lControl; + + const jchar *lPtrSymbolicLink = aPtrEnv->GetStringChars(aSymbolicLink, nullptr); + + lhr = lObject->createSourceControl( + (wchar_t*)lPtrSymbolicLink, + lIID, + &lControl); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lControl.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceNode + * Signature: (JLjava/lang/String;II)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceNode + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aSymbolicLink, jint aStreamIndex, jint aMediaTypeIndex) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aSymbolicLink == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + CComPtrCustom lSourceNode; + + const jchar *lPtrSymbolicLink = aPtrEnv->GetStringChars(aSymbolicLink, nullptr); + + lhr = lObject->createSourceNode( + (wchar_t*)lPtrSymbolicLink, + aStreamIndex, + aMediaTypeIndex, + &lSourceNode); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lSourceNode.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SourceControlNative + * Method: createSourceNodeWithDownStreamConnection + * Signature: (JLjava/lang/String;IIJ)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_createSourceNodeWithDownStreamConnection + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aSymbolicLink, jint aStreamIndex, jint aMediaTypeIndex, jlong aDownStreamPtr) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aDownStreamPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + IUnknown* lPtrDownStream = (IUnknown*)aDownStreamPtr; + + CComPtrCustom lSourceNode; + + const jchar *lPtrSymbolicLink = aPtrEnv->GetStringChars(aSymbolicLink, nullptr); + + lhr = lObject->createSourceNodeWithDownStreamConnection( + (wchar_t*)lPtrSymbolicLink, + aStreamIndex, + aMediaTypeIndex, + lPtrDownStream, + &lSourceNode); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lSourceNode.detach(); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SourceControlNative + * Method: getCollectionOfSources + * Signature: (J)Ljava/lang/String; + */ + JNIEXPORT jstring JNICALL Java_capturemanager_classes_SourceControlNative_getCollectionOfSources + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr) + { + jstring lresult = nullptr; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + BSTR lXMLstring = nullptr; + + lhr = lObject->getCollectionOfSources(&lXMLstring); + + if (FAILED(lhr)) + break; + + auto lLength = SysStringLen(lXMLstring); + + lresult = aPtrEnv->NewString((jchar*)lXMLstring, lLength); + + SysFreeString(lXMLstring); + + } while (false); + + return lresult; + } + + /* + * Class: capturemanager_classes_SourceControlNative + * Method: getSourceOutputMediaType + * Signature: (JLjava/lang/String;II)J + */ + JNIEXPORT jlong JNICALL Java_capturemanager_classes_SourceControlNative_getSourceOutputMediaType + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aSymbolicLink, jint aStreamIndex, jint aMediaTypeIndex) + { + jlong lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aSymbolicLink == 0) + break; + + if (aPtrEnv == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + CComPtrCustom lMediaType; + + const jchar *lPtrSymbolicLink = aPtrEnv->GetStringChars(aSymbolicLink, nullptr); + + lhr = lObject->getSourceOutputMediaType( + (wchar_t*)lPtrSymbolicLink, + aStreamIndex, + aMediaTypeIndex, + &lMediaType); + + if (FAILED(lhr)) + break; + + lresult = (jlong)lMediaType.detach(); + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/CaptureManagerNativeProxy/StrideForBitmapNative.cpp b/natives/capturemanager/CaptureManagerNativeProxy/StrideForBitmapNative.cpp new file mode 100644 index 0000000..5f29dba --- /dev/null +++ b/natives/capturemanager/CaptureManagerNativeProxy/StrideForBitmapNative.cpp @@ -0,0 +1,72 @@ +#define WIN32_LEAN_AND_MEAN + + +#include + + +#include "JNI\capturemanager_classes_StrideForBitmapNative.h" +#include "CaptureManagerTypeInfo.h" +#include "ComPtrCustom.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* + * Class: capturemanager_classes_StrideForBitmapNative + * Method: getStrideForBitmap + * Signature: (JLjava/lang/String;I)I + */ + JNIEXPORT jint JNICALL Java_capturemanager_classes_StrideForBitmapNative_getStrideForBitmap + (JNIEnv * aPtrEnv, jobject aClass, jlong aPtr, jstring aStringMediaType, jint aWidthInPixels) + { + jint lresult = 0; + + do + { + if (aPtr == 0) + break; + + if (aPtrEnv == nullptr) + break; + + if (aStringMediaType == nullptr) + break; + + IUnknown* lPtrIUnknown = (IUnknown*)aPtr; + + CComPtrCustom lObject; + + HRESULT lhr = lPtrIUnknown->QueryInterface(IID_PPV_ARGS(&lObject)); + + if (FAILED(lhr)) + break; + + const jchar *lPtrStringContainerTypeGUID = aPtrEnv->GetStringChars(aStringMediaType, nullptr); + + CLSID lMediaTypeGUID; + + lhr = CLSIDFromString((wchar_t*)lPtrStringContainerTypeGUID, &lMediaTypeGUID); + + if (FAILED(lhr)) + break; + + LONG lStride = 0; + + lhr = lObject->getStrideForBitmap( + lMediaTypeGUID, + aWidthInPixels, + &lStride); + + if (FAILED(lhr)) + break; + + lresult = (jint)lStride; + + } while (false); + + return lresult; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/natives/capturemanager/README.md b/natives/capturemanager/README.md new file mode 100644 index 0000000..3bf1563 --- /dev/null +++ b/natives/capturemanager/README.md @@ -0,0 +1,9 @@ +# Introduction + +This is the code for the proxy DLL that the Java JNI code in this repository uses to communicate with the real CaptureManagerSDK DLL. + +I have not coded this, it's just a copy of `CaptureManagerToJavaProxy.zip` downloaded from https://www.codeproject.com/Articles/1017223/CaptureManager-SDK-Capturing-Recording-and-Streami with a very simple modification in method `Java_capturemanager_classes_SampleGrabberCallNative_readData` of file `SampleGrabberCallNative.cpp` to avoid very high memory usage due to copying. This method received an array argument where data was copied. With my modified version it receives a direct Java ByteBuffer instance. + +The already-built DLLs can be found in the natives directory of this same repository. The code is here for reference and bulding a custom DLL. + +Note: Only `SampleGrabberCallNative` mode is used in the Java driver. I was not able to make Callback mode work correctly. Fortunately reading directly from the buffer into JavaFX images is possible, avoiding the conversion to a `BufferedImage` every frame. \ No newline at end of file diff --git a/natives/x64/CaptureManager.dll b/natives/x64/CaptureManager.dll new file mode 100644 index 0000000..f14a6fb Binary files /dev/null and b/natives/x64/CaptureManager.dll differ diff --git a/natives/x64/CaptureManagerNativeProxy.dll b/natives/x64/CaptureManagerNativeProxy.dll new file mode 100644 index 0000000..8a348cc Binary files /dev/null and b/natives/x64/CaptureManagerNativeProxy.dll differ diff --git a/natives/x86/CaptureManager.dll b/natives/x86/CaptureManager.dll new file mode 100644 index 0000000..fa2e9bd Binary files /dev/null and b/natives/x86/CaptureManager.dll differ diff --git a/natives/x86/CaptureManagerNativeProxy.dll b/natives/x86/CaptureManagerNativeProxy.dll new file mode 100644 index 0000000..8478fc7 Binary files /dev/null and b/natives/x86/CaptureManagerNativeProxy.dll differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..fe06e42 --- /dev/null +++ b/pom.xml @@ -0,0 +1,346 @@ + + + com.github.eduramiba + webcam-capture-driver-native + 1.0.0-SNAPSHOT + 4.0.0 + jar + + Webcam Capture Driver Native + Native driver for Webcam-capture project + 2021 + + + 11 + UTF-8 + UTF-8 + + + 1.7.30 + + 0.3.13-SNAPSHOT + 1.3.0 + 3.12.0 + + 16 + + + 3.8.1 + 3.3.0 + 3.1.0 + 2.8.2 + 2.5.2 + 3.2.0 + 3.2.0 + 3.2.0 + 1.0.1 + 3.9.1 + 3.2.0 + 2.22.2 + 2.22.2 + 3.0.0 + 2.2.0 + 2.8.1 + 3.2.0 + 3.0.0-M2 + 1.3 + 2.7.1 + + + + + + com.github.sarxos + webcam-capture + ${driver.webcam-capture.version} + + + + com.fasterxml + aalto-xml + ${driver.aalto-xml.version} + + + + org.openjfx + javafx-graphics + ${driver.javafx.version} + + + + + org.slf4j + slf4j-api + ${driver.slf4j.version} + + + + + + + com.github.sarxos + webcam-capture + + + + com.fasterxml + aalto-xml + + + + org.openjfx + javafx-graphics + provided + + + + + org.slf4j + slf4j-api + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${driver.maven-compiler-plugin.version} + + ${java.version} + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-assembly-plugin + ${driver.maven-assembly-plugin.version} + + + org.apache.maven.plugins + maven-clean-plugin + ${driver.maven-clean-plugin.version} + + + org.apache.maven.plugins + maven-deploy-plugin + ${driver.maven-deploy-plugin.version} + + + org.apache.maven.plugins + maven-install-plugin + ${driver.maven-install-plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${driver.maven-jar-plugin.version} + + + org.apache.maven.plugins + maven-dependency-plugin + ${driver.maven-dependency-plugin.version} + + + org.apache.maven.plugins + maven-resources-plugin + ${driver.maven-resources-plugin.version} + + + com.coderplus.maven.plugins + copy-rename-maven-plugin + ${driver.copy-rename-maven-plugin.version} + + + org.apache.maven.plugins + maven-site-plugin + ${driver.maven-site-plugin.version} + + + org.codehaus.mojo + build-helper-maven-plugin + ${driver.build-helper-maven-plugin.version} + + + org.apache.maven.plugins + maven-surefire-plugin + ${driver.maven-surefire-plugin.version} + + false + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${driver.maven-failsafe-plugin.version} + + false + + + + org.codehaus.mojo + exec-maven-plugin + ${driver.maven-exec-plugin.version} + + + org.gaul + modernizer-maven-plugin + ${driver.modernizer-plugin.version} + + + org.apache.maven.plugins + maven-enforcer-plugin + ${driver.maven-enforcer-plugin.version} + + + + org.codehaus.mojo + versions-maven-plugin + ${driver.versions-maven-plugin.version} + + + file:///${session.executionRootDirectory}/maven-version-rules.xml + + + + org.apache.maven.plugins + maven-help-plugin + ${driver.help-maven-plugin.version} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${driver.maven-enforcer-plugin.version} + + + maven-enforcer-check + + enforce + + + + + [3.6.0,) + Maven 3.6.0 or newer required + + + ${java.version} + + module-info + + test + + + + true + true + + + No Snapshots Allowed For Release Versions + true + + + + The reactor is not valid + true + + + true + true + + + + + + org.codehaus.mojo + extra-enforcer-rules + ${driver.maven-enforcer-plugin.extra-rules.version} + + + + + + org.gaul + modernizer-maven-plugin + + ${java.version} + true + org.driver.os.rest.security.html + + + + modernizer + verify + + modernizer + + + + + + + + + + check-error-prone + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${driver.maven-compiler-plugin.version} + + ${java.version} + ${java.version} + ${java.version} + + -XDcompilePolicy=simple + -Xplugin:ErrorProne + + + + com.google.errorprone + error_prone_core + ${driver.errorprone-plugin.version} + + + + + + + + + deployment + + + + + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + + + + diff --git a/src/main/java/capturemanager/classes/CaptureManager.java b/src/main/java/capturemanager/classes/CaptureManager.java new file mode 100644 index 0000000..f7b16c6 --- /dev/null +++ b/src/main/java/capturemanager/classes/CaptureManager.java @@ -0,0 +1,145 @@ +package capturemanager.classes; + +import capturemanager.interfaces.*; + +public class CaptureManager { + + private static CaptureManager mInstance = null; + + private ICaptureManagerNativeProxy mCaptureManagerNativeProxy = null; + + private ICaptureManagerControl mICaptureManagerControl = null; + + private ILogPrintOutControl mILogPrintOutControl = null; + + private static Object mlockObject = new Object(); + + public static CaptureManager getInstance() { + synchronized (mlockObject) { + if (mInstance != null) + return mInstance; + + boolean lstate = false; + + try { + if (mInstance == null) { + mInstance = new CaptureManager(); + + mInstance.mCaptureManagerNativeProxy = CaptureManagerNativeProxy.getInstance(); + + lstate = true; + } + + } finally { + + if (mInstance != null && lstate == false) + mInstance.mCaptureManagerNativeProxy = null; + } + } + + return mInstance; + } + + private CaptureManager() { + } + + private boolean checkFailNative() { + return mCaptureManagerNativeProxy == null; + } + + public void freeLibrary() { + do { + if (checkFailNative()) + break; + + try { + if (mICaptureManagerControl != null) + mICaptureManagerControl.release(); + + if (mILogPrintOutControl != null) + mILogPrintOutControl.release(); + + mCaptureManagerNativeProxy.freeLibrary( + CaptureManagerNativeProxy.CaptureManagerFileName + ); + + mCaptureManagerNativeProxy = null; + + CaptureManagerNativeProxy.freeInstance(); + + CaptureManagerNativeProxy.release(); + + } finally { + + } + + } + while (false); + } + + public ILogPrintOutControl getILogPrintOutControl() { + ILogPrintOutControl lresult = null; + + do { + if (checkFailNative()) + break; + + try { + + long aPtr = mCaptureManagerNativeProxy.explicitGetPtrClass( + CaptureManagerNativeProxy.CaptureManagerFileName, + LogPrintOutControl.CLSID_CoLogPrintOut, + LogPrintOutControl.IID_ILogPrintOutControl); + + if (aPtr == 0) + break; + + lresult = new LogPrintOutControl(aPtr); + + mILogPrintOutControl = lresult; + } finally { + + } + + } + while (false); + + return mILogPrintOutControl; + } + + public ICaptureManagerControl getICaptureManagerControl() { + ICaptureManagerControl lresult = new CaptureManagerControl(0); + + do { + if (checkFailNative()) + break; + + try { + if (mICaptureManagerControl != null) { + lresult = mICaptureManagerControl; + + break; + } + + long aPtr = mCaptureManagerNativeProxy.explicitGetPtrClass( + CaptureManagerNativeProxy.CaptureManagerFileName, + CaptureManagerControl.CLSID_CoCaptureManager, + CaptureManagerControl.IID_ICaptureManagerControl); + + if (aPtr == 0) + break; + + lresult = new CaptureManagerControl(aPtr); + + mICaptureManagerControl = lresult; + } finally { + + } + + } + while (false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/CaptureManagerControl.java b/src/main/java/capturemanager/classes/CaptureManagerControl.java new file mode 100644 index 0000000..df5bae8 --- /dev/null +++ b/src/main/java/capturemanager/classes/CaptureManagerControl.java @@ -0,0 +1,235 @@ +package capturemanager.classes; + +import capturemanager.interfaces.*; + +final class CaptureManagerControl extends CaptureManagerControlNative implements ICaptureManagerControl { + + protected static final String CLSID_CoCaptureManager = "{D5F07FB8-CE60-4017-B215-95C8A0DDF42A}"; + + protected static final String IID_ICaptureManagerControl = "{D4F5F10A-8F70-43CF-8CF1-EC331DA2F829}"; + + CaptureManagerControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + public void release() { + if (mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public String getCollectionOfSources() { + String lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + SourceControl.IID); + + if (lPtr == 0) + break; + + ISourceControl lISourceControl = new SourceControl(lPtr); + + lresult = lISourceControl.getCollectionOfSources(); + } + while (false); + + return lresult; + } + + @Override + public String getCollectionOfSinks() { + String lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + SinkControl.IID); + + if (lPtr == 0) + break; + + ISinkControl lISinkControl = new SinkControl(lPtr); + + lresult = lISinkControl.getCollectionOfSinks(); + } + while (false); + + return lresult; + } + + @Override + public ISourceControl createSourceControl() { + ISourceControl lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + SourceControl.IID); + + if (lPtr == 0) + break; + + lresult = new SourceControl(lPtr); + + } while (false); + + return lresult; + } + + @Override + public ISessionControl createSessionControl() { + ISessionControl lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + SessionControl.IID); + + if (lPtr == 0) + break; + + lresult = new SessionControl(lPtr); + + } while (false); + + return lresult; + } + + @Override + public ISinkControl createSinkControl() { + ISinkControl lresult = null; + + do { + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + SinkControl.IID); + + if (lPtr == 0) + break; + + lresult = new SinkControl(lPtr); + } + while (false); + + } while (false); + + return lresult; + } + + @Override + public IStreamControl createStreamControl() { + IStreamControl lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + StreamControl.IID); + + if (lPtr == 0) + break; + + lresult = new StreamControl(lPtr); + + } while (false); + + return lresult; + } + + @Override + public IEncoderControl createEncoderControl() { + IEncoderControl lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createControl( + mPtr, + EncoderControl.IID); + + if (lPtr == 0) + break; + + lresult = new EncoderControl(lPtr); + + } while (false); + + return lresult; + } + + @Override + public int getStrideForBitmapInfoHeader( + String aStringMFVideoFormat, + int aWidthInPixels) { + + int lresult = 0; + + do { + if (mPtr == 0) + break; + + long lPtr = createMisc( + mPtr, + StrideForBitmap.IID); + + if (lPtr == 0) + break; + + IStrideForBitmap lStrideForBitmap = new StrideForBitmap(lPtr); + + lresult = lStrideForBitmap.getStrideForBitmap(aStringMFVideoFormat, aWidthInPixels); + + } while (false); + + return lresult; + } + + @Override + public IVersionControl getVersionControl() { + + IVersionControl lresult = null; + + do { + if (mPtr == 0) + break; + + long lPtr = createMisc( + mPtr, + VersionControl.IID); + + if (lPtr == 0) + break; + + lresult = new VersionControl(lPtr); + + } while (false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/CaptureManagerControlNative.java b/src/main/java/capturemanager/classes/CaptureManagerControlNative.java new file mode 100644 index 0000000..f625389 --- /dev/null +++ b/src/main/java/capturemanager/classes/CaptureManagerControlNative.java @@ -0,0 +1,12 @@ +package capturemanager.classes; + +abstract class CaptureManagerControlNative { + + native protected long createControl( + long aPtr, + String aStringIID); + + native protected long createMisc( + long aPtr, + String aStringIID); +} diff --git a/src/main/java/capturemanager/classes/CaptureManagerNativeProxy.java b/src/main/java/capturemanager/classes/CaptureManagerNativeProxy.java new file mode 100644 index 0000000..2369888 --- /dev/null +++ b/src/main/java/capturemanager/classes/CaptureManagerNativeProxy.java @@ -0,0 +1,68 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ICaptureManagerNativeProxy; +import capturemanager.utils.NativeUtils; +import java.io.File; +import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +final class CaptureManagerNativeProxy implements ICaptureManagerNativeProxy { + private static final Logger LOG = LoggerFactory.getLogger(CaptureManagerNativeProxy.class); + + private static final String NativeProxyFile = "CaptureManagerNativeProxy.dll"; + + private static final String CaptureManagerFile = "CaptureManager.dll"; + + public static String CaptureManagerFileName = ""; + + public static String NativeProxyFileName = ""; + + private static File CaptureManagerFileRef = null; + + private static File NativeProxyFilePath = null; + + static { + + try { + CaptureManagerFileRef = NativeUtils.loadLibrary(CaptureManagerFile); + + CaptureManagerFileName = CaptureManagerFileRef.getName(); + + NativeProxyFilePath = NativeUtils.loadLibrary(NativeProxyFile); + + NativeProxyFileName = NativeProxyFilePath.getName(); + + } catch (IOException ex) { + LOG.error("Unexpected error loading CaptureManager libraries", ex); + } + } + + private static ICaptureManagerNativeProxy mInstance = null; + + private CaptureManagerNativeProxy() { + } + + protected static ICaptureManagerNativeProxy getInstance() { + if (mInstance == null) { + mInstance = new CaptureManagerNativeProxy(); + } + + return mInstance; + } + + protected static void freeInstance() { + mInstance = null; + } + + static public void release() { + //NOOP + //This used to delete the dll file. Not nice idea + } + + public native long explicitGetPtrClass(String aStringFilePath, String aStringCLSID, String aStringGUID); + + public native void freeLibrary(String aFileName); + + public native void Release(long aPtr); +} diff --git a/src/main/java/capturemanager/classes/CustomClassLoader.java b/src/main/java/capturemanager/classes/CustomClassLoader.java new file mode 100644 index 0000000..18a4fce --- /dev/null +++ b/src/main/java/capturemanager/classes/CustomClassLoader.java @@ -0,0 +1,74 @@ +package capturemanager.classes; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * + * Simple custom class loader implementation + * + */ +public class CustomClassLoader extends ClassLoader { + + /** + * The HashMap where the classes will be cached + */ + private Map> classes = new HashMap>(); + + @Override + public String toString() { + return CustomClassLoader.class.getName(); + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + + if (classes.containsKey(name)) { + return classes.get(name); + } + + byte[] classData; + + try { + classData = loadClassData(name); + } catch (IOException e) { + throw new ClassNotFoundException("Class [" + name + + "] could not be found", e); + } + + Class c = defineClass(name, classData, 0, classData.length); + resolveClass(c); + classes.put(name, c); + + return c; + } + + /** + * Load the class file into byte array + * + * @param name + * The name of the class e.g. com.codeslices.test.TestClass} + * @return The class file as byte array + * @throws IOException + */ + private byte[] loadClassData(String name) throws IOException { + BufferedInputStream in = new BufferedInputStream( + ClassLoader.getSystemResourceAsStream(name.replace(".", "/") + + ".class")); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int i; + + while ((i = in.read()) != -1) { + out.write(i); + } + + in.close(); + byte[] classData = out.toByteArray(); + out.close(); + + return classData; + } +} diff --git a/src/main/java/capturemanager/classes/EVRSinkFactory.java b/src/main/java/capturemanager/classes/EVRSinkFactory.java new file mode 100644 index 0000000..9f42dfe --- /dev/null +++ b/src/main/java/capturemanager/classes/EVRSinkFactory.java @@ -0,0 +1,50 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IEVRSinkFactory; +import capturemanager.interfaces.IStreamNode; +import java.awt.Component; + +final class EVRSinkFactory extends EVRSinkFactoryNative implements IEVRSinkFactory { + + + EVRSinkFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public IStreamNode createOutputNode(Component aGraphicComponent) { + + IStreamNode lresult = null; + + do + { + long lPtr = createOutputNode( + mPtr, + aGraphicComponent); + + if(lPtr == 0) + break; + + lresult = new StreamNode(lPtr); + } + while(false); + + return lresult; + } + + + +} diff --git a/src/main/java/capturemanager/classes/EVRSinkFactoryNative.java b/src/main/java/capturemanager/classes/EVRSinkFactoryNative.java new file mode 100644 index 0000000..8184344 --- /dev/null +++ b/src/main/java/capturemanager/classes/EVRSinkFactoryNative.java @@ -0,0 +1,10 @@ +package capturemanager.classes; + +import java.awt.Component; + +abstract class EVRSinkFactoryNative { + + native protected long createOutputNode( + long aPtr, + Component aGraphicComponent); +} diff --git a/src/main/java/capturemanager/classes/EncoderControl.java b/src/main/java/capturemanager/classes/EncoderControl.java new file mode 100644 index 0000000..6fd050b --- /dev/null +++ b/src/main/java/capturemanager/classes/EncoderControl.java @@ -0,0 +1,88 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IEncoderControl; +import capturemanager.interfaces.IEncoderNodeFactory; +import capturemanager.interfaces.IMediaType; + +class EncoderControl extends EncoderControlNative implements IEncoderControl { + + protected static final String IID = "{96223507-D8FF-4EC1-B125-71AA7F9726A4}"; + + EncoderControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public IEncoderNodeFactory createEncoderNodeFactory(String aEncoderCLSID) { + + IEncoderNodeFactory lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createEncoderNodeFactory( + mPtr, + aEncoderCLSID, + "{A56E11D8-D602-4792-8570-38C283FC0AA3}"); + + if(lPtr == 0) + break; + + lresult = new EncoderNodeFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public String getCollectionOfEncoders() { + return super.getCollectionOfEncoders( + mPtr); + } + + @Override + public String getMediaTypeCollectionOfEncoder( + IMediaType aPtrUncompressedMediaType, + String aEncoderCLSID) { + + + String lresult = null; + + do + { + if(mPtr == 0) + break; + + MediaType lMediaType = (MediaType)aPtrUncompressedMediaType; + + if(lMediaType == null) + break; + + lresult = super.getMediaTypeCollectionOfEncoder( + mPtr, + lMediaType.mPtr, + aEncoderCLSID); + } + while(false); + + return lresult; + + } + +} diff --git a/src/main/java/capturemanager/classes/EncoderControlNative.java b/src/main/java/capturemanager/classes/EncoderControlNative.java new file mode 100644 index 0000000..8f0d1b0 --- /dev/null +++ b/src/main/java/capturemanager/classes/EncoderControlNative.java @@ -0,0 +1,17 @@ +package capturemanager.classes; + +abstract class EncoderControlNative { + + native protected long createEncoderNodeFactory( + long aPtr, + String aStringEncoderCLSID, + String aStringIID); + + native protected String getCollectionOfEncoders( + long aPtr); + + native protected String getMediaTypeCollectionOfEncoder( + long aPtr, + long aPtrUncompressedMediaType, + String aStringEncoderCLSID); +} diff --git a/src/main/java/capturemanager/classes/EncoderNodeFactory.java b/src/main/java/capturemanager/classes/EncoderNodeFactory.java new file mode 100644 index 0000000..ac83676 --- /dev/null +++ b/src/main/java/capturemanager/classes/EncoderNodeFactory.java @@ -0,0 +1,106 @@ +package capturemanager.classes; + +import capturemanager.interfaces.*; + +final class EncoderNodeFactory extends EncoderNodeFactoryNative implements IEncoderNodeFactory { + + EncoderNodeFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public IMediaType createCompressedMediaType( + IMediaType aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType) { + + + + IMediaType lresult = null; + + do + { + if(mPtr == 0) + break; + + MediaType lMediaType = (MediaType)aPtrUncompressedMediaType; + + if(lMediaType == null) + break; + + long lPtr = super.createCompressedMediaType( + mPtr, + lMediaType.mPtr, + aStringEncodingModeGUID, + aEncodingModeValue, + aIndexCompressedMediaType); + if(lPtr == 0) + break; + + lresult = new MediaType(lPtr); + } + while(false); + + return lresult; + + } + + @Override + public IStreamNode createEncoderNode( + IMediaType aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType, + IStreamNode aPtrDownStreamNode) { + + + IStreamNode lresult = null; + + do + { + if(mPtr == 0) + break; + + MediaType lMediaType = (MediaType)aPtrUncompressedMediaType; + + if(lMediaType == null) + break; + + StreamNode lStreamNode = (StreamNode)aPtrDownStreamNode; + + if(lStreamNode == null) + break; + + long lPtr = super.createEncoderNode( + mPtr, + lMediaType.mPtr, + aStringEncodingModeGUID, + aEncodingModeValue, + aIndexCompressedMediaType, + lStreamNode.mPtr); + + if(lPtr == 0) + break; + + lresult = new StreamNode(lPtr); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/EncoderNodeFactoryNative.java b/src/main/java/capturemanager/classes/EncoderNodeFactoryNative.java new file mode 100644 index 0000000..25d8825 --- /dev/null +++ b/src/main/java/capturemanager/classes/EncoderNodeFactoryNative.java @@ -0,0 +1,20 @@ +package capturemanager.classes; + +abstract class EncoderNodeFactoryNative { + + native protected long createCompressedMediaType( + long aPtr, + long aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType); + + native protected long createEncoderNode( + long aPtr, + long aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType, + long aPtrDownStreamNode); + +} diff --git a/src/main/java/capturemanager/classes/FileSinkFactory.java b/src/main/java/capturemanager/classes/FileSinkFactory.java new file mode 100644 index 0000000..8e64702 --- /dev/null +++ b/src/main/java/capturemanager/classes/FileSinkFactory.java @@ -0,0 +1,72 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IFileSinkFactory; +import capturemanager.interfaces.IMediaType; +import capturemanager.interfaces.IStreamNode; +import java.util.ArrayList; +import java.util.List; + +final class FileSinkFactory extends FileSinkFactoryNative implements IFileSinkFactory { + + FileSinkFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public List createOutputNodes( + List aArrayPtrCompressedMediaTypes, + String aPtrFileName) { + + List lresult = new ArrayList(); + + do + { + if(mPtr == 0) + break; + + if(aArrayPtrCompressedMediaTypes == null) + break; + + long[] PtrCompressedMediaTypes = new long[aArrayPtrCompressedMediaTypes.size()]; + + for(int lIndex = 0; lIndex < aArrayPtrCompressedMediaTypes.size(); lIndex++) + { + MediaType lMediaType = (MediaType)aArrayPtrCompressedMediaTypes.get(lIndex); + + if(lMediaType != null) + PtrCompressedMediaTypes[lIndex] = lMediaType.mPtr; + } + + long[] lPtrOutputNodes = super.createOutputNodes( + mPtr, + PtrCompressedMediaTypes, + aPtrFileName); + + if(lPtrOutputNodes == null) + break; + + for(int lIndex = 0; lIndex < lPtrOutputNodes.length; lIndex++) + { + lresult.add(new StreamNode(lPtrOutputNodes[lIndex])); + } + + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/FileSinkFactoryNative.java b/src/main/java/capturemanager/classes/FileSinkFactoryNative.java new file mode 100644 index 0000000..3cab317 --- /dev/null +++ b/src/main/java/capturemanager/classes/FileSinkFactoryNative.java @@ -0,0 +1,9 @@ +package capturemanager.classes; + +abstract class FileSinkFactoryNative { + + native protected long[] createOutputNodes( + long aPtr, + long[] aArrayPtrCompressedMediaTypes, + String aPtrFileName); +} diff --git a/src/main/java/capturemanager/classes/LogPrintOutControl.java b/src/main/java/capturemanager/classes/LogPrintOutControl.java new file mode 100644 index 0000000..67b3aa2 --- /dev/null +++ b/src/main/java/capturemanager/classes/LogPrintOutControl.java @@ -0,0 +1,59 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ILogPrintOutControl; + +class LogPrintOutControl extends LogPrintOutControlNative implements ILogPrintOutControl { + + protected static final String CLSID_CoLogPrintOut = "{4563EE3E-DA1E-4911-9F40-88A284E2DD69}"; + + protected static final String IID_ILogPrintOutControl = "{73B67834-E7BD-40B7-9730-8C13BF098B9F}"; + + LogPrintOutControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + public void release() + { + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public void addPrintOutDestination(int aLevelType, String aFilePath) { + + if(mPtr != 0) + addPrintOutDestinationNative( + mPtr, + aLevelType, + aFilePath); + + } + + @Override + public void removePrintOutDestination(int aLevelType, String aFilePath) { + + if(mPtr != 0) + removePrintOutDestinationNative( + mPtr, + aLevelType, + aFilePath); + + } + + @Override + public void setVerbose(int aLevelType, String aFilePath, Boolean aState) { + + if(mPtr != 0) + setVerboseNative( + mPtr, + aLevelType, + aFilePath, + aState); + } + + +} diff --git a/src/main/java/capturemanager/classes/LogPrintOutControlNative.java b/src/main/java/capturemanager/classes/LogPrintOutControlNative.java new file mode 100644 index 0000000..7dabae2 --- /dev/null +++ b/src/main/java/capturemanager/classes/LogPrintOutControlNative.java @@ -0,0 +1,21 @@ +package capturemanager.classes; + +abstract class LogPrintOutControlNative +{ + + native protected void addPrintOutDestinationNative( + long aPtr, + int aLevelType, + String aFilePath); + + native protected void removePrintOutDestinationNative( + long aPtr, + int aLevelType, + String aFilePath); + + native protected void setVerboseNative( + long aPtr, + int aLevelType, + String aFilePath, + boolean aState); +} diff --git a/src/main/java/capturemanager/classes/MediaType.java b/src/main/java/capturemanager/classes/MediaType.java new file mode 100644 index 0000000..df9f6f5 --- /dev/null +++ b/src/main/java/capturemanager/classes/MediaType.java @@ -0,0 +1,23 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IMediaType; + +final class MediaType implements IMediaType { + + MediaType(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCall.java b/src/main/java/capturemanager/classes/SampleGrabberCall.java new file mode 100644 index 0000000..1245e57 --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCall.java @@ -0,0 +1,34 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISampleGrabberCall; +import capturemanager.interfaces.IStreamNode; +import java.nio.ByteBuffer; + +final class SampleGrabberCall extends SampleGrabberCallNative implements ISampleGrabberCall { + + private StreamNode mStreamNode = null; + + SampleGrabberCall(long aPtr) { + mStreamNode = new StreamNode(aPtr); + } + + @Override + public int readData(ByteBuffer byteBuffer) { + if (!byteBuffer.isDirect()) { + throw new IllegalArgumentException("You must user a direct byte buffer"); + } + + return super.readData(mStreamNode.mPtr, byteBuffer); + } + + @Override + public void RGB32ToBGRA(ByteBuffer byteBuffer) { + super.RGB32ToBGRA(byteBuffer); + } + + @Override + public IStreamNode getStreamNode() { + return mStreamNode; + } + +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallNative.java b/src/main/java/capturemanager/classes/SampleGrabberCallNative.java new file mode 100644 index 0000000..ad77bea --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallNative.java @@ -0,0 +1,13 @@ +package capturemanager.classes; + +import java.nio.ByteBuffer; + +abstract class SampleGrabberCallNative { + + native protected int readData( + long aPtr, + ByteBuffer byteBuffer); + + native protected void RGB32ToBGRA( + ByteBuffer byteBuffer); +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactory.java b/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactory.java new file mode 100644 index 0000000..fd24125 --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactory.java @@ -0,0 +1,55 @@ +package capturemanager.classes; + +import capturemanager.interfaces.*; + + +final class SampleGrabberCallSinkFactory extends SampleGrabberCallSinkFactoryNative + implements ISampleGrabberCallSinkFactory { + + SampleGrabberCallSinkFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public ISampleGrabberCall createOutputNode( + String aStringMajorType, + String aStringSubType, + int aSampleByteSize) { + + ISampleGrabberCall lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createOutputNode( + mPtr, + aStringMajorType, + aStringSubType, + aSampleByteSize, + "{118AD3F7-D9A3-4146-AB35-F16421DC995E}"); + + SampleGrabberCall lSampleGrabberCall = new SampleGrabberCall(lPtr); + + lresult = lSampleGrabberCall; + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactoryNative.java b/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactoryNative.java new file mode 100644 index 0000000..d50da20 --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallSinkFactoryNative.java @@ -0,0 +1,10 @@ +package capturemanager.classes; + +abstract class SampleGrabberCallSinkFactoryNative { + native protected long createOutputNode( + long aPtr, + String aStringMajorType, + String aStringSubType, + int aSampleByteSize, + String aStringIID); +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallback.java b/src/main/java/capturemanager/classes/SampleGrabberCallback.java new file mode 100644 index 0000000..edc305c --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallback.java @@ -0,0 +1,44 @@ +package capturemanager.classes; + +import capturemanager.interfaces.*; +import java.util.*; + +final class SampleGrabberCallback extends SampleGrabberCallbackNative implements ISampleGrabberCallback { + + + private StreamNode mStreamNode = null; + + SampleGrabberCallback() { + } + + void setPtr(long aPtr) { + mStreamNode = new StreamNode(aPtr); + } + + void invoke(byte[] aSampleBuffer, int aSampleSize) + { + synchronized(listeners) + { + for(int lIndex=0; lIndex < listeners.size(); ++lIndex) + { + listeners.get(lIndex).invoke(aSampleBuffer, aSampleSize); + } + } + } + + private List listeners = new ArrayList(); + + @Override + public void addCallbackListener(ICallbackListener aICallbackListener) { + + synchronized(listeners) + { + listeners.add(aICallbackListener); + } + } + + @Override + public IStreamNode getStreamNode() { + return mStreamNode; + } +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallbackNative.java b/src/main/java/capturemanager/classes/SampleGrabberCallbackNative.java new file mode 100644 index 0000000..4515865 --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallbackNative.java @@ -0,0 +1,8 @@ +package capturemanager.classes; + +abstract class SampleGrabberCallbackNative { + + native protected int registerCallback( + long aPtr); + +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactory.java b/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactory.java new file mode 100644 index 0000000..88f802b --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactory.java @@ -0,0 +1,58 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISampleGrabberCallback; +import capturemanager.interfaces.ISampleGrabberCallbackSinkFactory; + +class SampleGrabberCallbackSinkFactory extends SampleGrabberCallbackSinkFactoryNative + implements ISampleGrabberCallbackSinkFactory { + + SampleGrabberCallbackSinkFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable { + super.finalize(); + + if (mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public ISampleGrabberCallback createOutputNode( + String aStringMajorType, + String aStringSubType) { + + ISampleGrabberCallback lresult = null; + + do { + if (mPtr == 0) + break; + + SampleGrabberCallback lSampleGrabberCallback = new SampleGrabberCallback(); + + long lPtr = createOutputNode( + mPtr, + aStringMajorType, + aStringSubType, + lSampleGrabberCallback + ); + + if (lPtr == 0) { + break; + } + + lSampleGrabberCallback.setPtr(lPtr); + + lresult = lSampleGrabberCallback; + } + while (false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactoryNative.java b/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactoryNative.java new file mode 100644 index 0000000..d4f1214 --- /dev/null +++ b/src/main/java/capturemanager/classes/SampleGrabberCallbackSinkFactoryNative.java @@ -0,0 +1,10 @@ +package capturemanager.classes; + +abstract class SampleGrabberCallbackSinkFactoryNative { + + native protected long createOutputNode( + long aPtr, + String aStringMajorType, + String aStringSubType, + Object aPtrISampleGrabberCallback); +} diff --git a/src/main/java/capturemanager/classes/Session.java b/src/main/java/capturemanager/classes/Session.java new file mode 100644 index 0000000..f7631cb --- /dev/null +++ b/src/main/java/capturemanager/classes/Session.java @@ -0,0 +1,131 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISession; +import capturemanager.interfaces.IUpdateStateListener; + +final class Session extends SessionNative implements ISession { + + + Session(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public boolean startSession( + long aStartPositionInHundredNanosecondUnits, + String aStringGUIDTimeFormat) { + boolean lresult = false; + + do + { + if(mPtr == 0) + break; + + lresult = startSession( + mPtr, + aStartPositionInHundredNanosecondUnits, + aStringGUIDTimeFormat); + } + while(false); + + return lresult; + } + + @Override + public boolean pauseSession() { + boolean lresult = false; + + do + { + if(mPtr == 0) + break; + + lresult = pauseSession( + mPtr); + } + while(false); + + return lresult; + } + + @Override + public boolean stopSession() { + boolean lresult = false; + + do + { + if(mPtr == 0) + break; + + lresult = stopSession( + mPtr); + } + while(false); + + return lresult; + } + + @Override + public boolean closeSession() { + boolean lresult = false; + + do + { + if(mPtr == 0) + break; + + lresult = closeSession( + mPtr); + } + while(false); + + return lresult; + } + + @Override + public int getSessionDescriptor() { + int lresult = -1; + + do + { + if(mPtr == 0) + break; + + lresult = getSessionDescriptor( + mPtr); + } + while(false); + + return lresult; + } + + @Override + public void addUpdateStateListener(IUpdateStateListener aIUpdateStateListener) { + + do + { + if(mPtr == 0) + break; + + addIUpdateStateListener( + mPtr, + aIUpdateStateListener); + } + while(false); + + } + +} diff --git a/src/main/java/capturemanager/classes/SessionControl.java b/src/main/java/capturemanager/classes/SessionControl.java new file mode 100644 index 0000000..0c184aa --- /dev/null +++ b/src/main/java/capturemanager/classes/SessionControl.java @@ -0,0 +1,68 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISession; +import capturemanager.interfaces.ISessionControl; +import capturemanager.interfaces.IStreamNode; +import java.util.List; + +final class SessionControl extends SessionControlNative implements ISessionControl { + + protected static final String IID = "{D0C58520-A941-4C0F-81B0-3ED8A4DE11ED}"; + + + SessionControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public ISession createSession( + List aArrayPtrSourceNodesOfTopology) { + + ISession lresult = null; + + do + { + if(mPtr == 0) + break; + + long[] lPtrSourceNodesOfTopologys = new long[aArrayPtrSourceNodesOfTopology.size()]; + + for(int lIndex = 0; lIndex < aArrayPtrSourceNodesOfTopology.size(); ++lIndex) + { + StreamNode lStreamNode = (StreamNode)aArrayPtrSourceNodesOfTopology.get(lIndex); + + if(lStreamNode == null) + continue; + + lPtrSourceNodesOfTopologys[lIndex] = lStreamNode.mPtr; + } + + long lPtr = createSession( + mPtr, + lPtrSourceNodesOfTopologys, + "{742AC001-D1E0-40A8-8EFE-BA1A550F8805}"); + + if(lPtr == 0) + break; + + lresult = new Session(lPtr); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SessionControlNative.java b/src/main/java/capturemanager/classes/SessionControlNative.java new file mode 100644 index 0000000..7a60998 --- /dev/null +++ b/src/main/java/capturemanager/classes/SessionControlNative.java @@ -0,0 +1,8 @@ +package capturemanager.classes; + +abstract class SessionControlNative { + native protected long createSession( + long aPtr, + long[] aArrayPtrSourceNodesOfTopology, + String aStringIID); +} diff --git a/src/main/java/capturemanager/classes/SessionNative.java b/src/main/java/capturemanager/classes/SessionNative.java new file mode 100644 index 0000000..69fc64c --- /dev/null +++ b/src/main/java/capturemanager/classes/SessionNative.java @@ -0,0 +1,21 @@ +package capturemanager.classes; + +abstract class SessionNative { + + native protected boolean closeSession(long aPtr); + + native protected boolean addIUpdateStateListener( + long aPtr, + Object aIUpdateStateListener); + + native protected int getSessionDescriptor(long aPtr); + + native protected boolean pauseSession(long aPtr); + + native protected boolean startSession( + long aPtr, + long aStartPositionInHundredNanosecondUnits, + String aStringGUIDTimeFormat); + + native protected boolean stopSession(long aPtr); +} diff --git a/src/main/java/capturemanager/classes/SinkControl.java b/src/main/java/capturemanager/classes/SinkControl.java new file mode 100644 index 0000000..9ea4e6a --- /dev/null +++ b/src/main/java/capturemanager/classes/SinkControl.java @@ -0,0 +1,146 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IEVRSinkFactory; +import capturemanager.interfaces.IFileSinkFactory; +import capturemanager.interfaces.ISampleGrabberCallSinkFactory; +import capturemanager.interfaces.ISampleGrabberCallbackSinkFactory; +import capturemanager.interfaces.ISinkControl; + +final class SinkControl extends SinkControlNative implements ISinkControl { + + protected static final String IID = "{C6BA3732-197E-438B-8E73-277759A7B58F}"; + + + SinkControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public IFileSinkFactory createFileSinkFactory(String aStringContainerTypeGUID) { + + IFileSinkFactory lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createSinkFactory( + mPtr, + aStringContainerTypeGUID, + "{D6E342E3-7DDD-4858-AB91-4253643864C2}"); + + if(lPtr == 0) + break; + + lresult = new FileSinkFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public ISampleGrabberCallSinkFactory createSampleGrabberCallSinkFactory(String aStringContainerTypeGUID) { + + ISampleGrabberCallSinkFactory lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createSinkFactory( + mPtr, + aStringContainerTypeGUID, + "{759D24FF-C5D6-4B65-8DDF-8A2B2BECDE39}"); + + if(lPtr == 0) + break; + + lresult = new SampleGrabberCallSinkFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public ISampleGrabberCallbackSinkFactory createSampleGrabberCallbackSinkFactory(String aStringContainerTypeGUID) { + + ISampleGrabberCallbackSinkFactory lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createSinkFactory( + mPtr, + aStringContainerTypeGUID, + "{3D64C48E-EDA4-4EE1-8436-58B64DD7CF13}"); + + if(lPtr == 0) + break; + + lresult = new SampleGrabberCallbackSinkFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public IEVRSinkFactory createEVRSinkFactory(String aStringContainerTypeGUID) { + + IEVRSinkFactory lresult = null; + + do + { + if(mPtr == 0) + break; + + long lPtr = createSinkFactory( + mPtr, + aStringContainerTypeGUID, + "{2F34AF87-D349-45AA-A5F1-E4104D5C458E}"); + + if(lPtr == 0) + break; + + lresult = new EVRSinkFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public String getCollectionOfSinks() { + String lresult = null; + + do + { + if(mPtr == 0) + break; + lresult = getCollectionOfSinks(mPtr); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SinkControlNative.java b/src/main/java/capturemanager/classes/SinkControlNative.java new file mode 100644 index 0000000..77a1b46 --- /dev/null +++ b/src/main/java/capturemanager/classes/SinkControlNative.java @@ -0,0 +1,12 @@ +package capturemanager.classes; + +abstract class SinkControlNative { + + native protected long createSinkFactory( + long aPtr, + String aStringContainerTypeGUID, + String aStringIID); + + native protected String getCollectionOfSinks( + long aPtr); +} diff --git a/src/main/java/capturemanager/classes/SourceControl.java b/src/main/java/capturemanager/classes/SourceControl.java new file mode 100644 index 0000000..a9f9e4c --- /dev/null +++ b/src/main/java/capturemanager/classes/SourceControl.java @@ -0,0 +1,144 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IMediaType; +import capturemanager.interfaces.ISourceControl; +import capturemanager.interfaces.IStreamNode; + +final class SourceControl extends SourceControlNative implements ISourceControl { + + protected static final String IID = "{1276CC17-BCA8-4200-87BB-7180EF562447}"; + + SourceControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable { + super.finalize(); + + if (mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + + @Override + public IStreamNode createSourceNode( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType, + IStreamNode aPtrDownStreamTopologyNode) { + + IStreamNode lresult = null; + + do { + + if (mPtr == 0) + break; + + if (aPtrDownStreamTopologyNode == null) + break; + + StreamNode lPtrDownStreamTopologyNode = (StreamNode) aPtrDownStreamTopologyNode; + + long lPtr = createSourceNodeWithDownStreamConnection( + mPtr, + aSymbolicLink, + aIndexStream, + aIndexMediaType, + lPtrDownStreamTopologyNode.mPtr); + + if (lPtr == 0) + break; + + lresult = new StreamNode(lPtr); + } + while (false); + + return lresult; + } + + @Override + public IStreamNode createSourceNode( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType) { + + IStreamNode lresult = null; + + do { + + if (mPtr == 0) + break; + + if (aSymbolicLink == null) + break; + + long lPtr = createSourceNode( + mPtr, + aSymbolicLink, + aIndexStream, + aIndexMediaType); + + if (lPtr == 0) + break; + + lresult = new StreamNode(lPtr); + } + while (false); + + return lresult; + } + + @Override + public String getCollectionOfSources() { + + String lresult = null; + + do { + + if (mPtr == 0) + break; + + lresult = getCollectionOfSources( + mPtr); + } + while (false); + + return lresult; + } + + + @Override + public IMediaType getSourceOutputMediaType( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType) { + + IMediaType lresult = null; + + do { + + if (mPtr == 0) + break; + + long lPtr = getSourceOutputMediaType( + mPtr, + aSymbolicLink, + aIndexStream, + aIndexMediaType); + + if (lPtr == 0) + break; + + lresult = new MediaType(lPtr); + } + while (false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SourceControlNative.java b/src/main/java/capturemanager/classes/SourceControlNative.java new file mode 100644 index 0000000..ed84fb8 --- /dev/null +++ b/src/main/java/capturemanager/classes/SourceControlNative.java @@ -0,0 +1,44 @@ +package capturemanager.classes; + +abstract class SourceControlNative { + +// native protected long createSource( +// String aSymbolicLink, +// out object aPtrPtrMediaSource); + + native protected long createSourceControl( + long aPtr, + String aSymbolicLink, + String aStringIID); + +// void createSourceFromCaptureProcessor(object aPtrCaptureProcessor, out object aPtrPtrMediaSource); + + native protected long createSourceNode( + long aPtr, + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType); + +// void createSourceNodeFromExternalSource(object aPtrMediaSource, uint aIndexStream, uint aIndexMediaType, out object aPtrPtrTopologyNode); + +// void createSourceNodeFromExternalSourceWithDownStreamConnection(object aPtrMediaSource, uint aIndexStream, uint aIndexMediaType, object aPtrDownStreamTopologyNode, out object aPtrPtrTopologyNode); + + native protected long createSourceNodeWithDownStreamConnection( + long aPtr, + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType, + long aPtrDownStreamTopologyNode); + + native protected String getCollectionOfSources( + long aPtr); + + native protected long getSourceOutputMediaType( + long aPtr, + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType); + +// void getSourceOutputMediaTypeFromMediaSource(object aPtrMediaSource, uint aIndexStream, uint aIndexMediaType, out object aPtrPtrOutputMediaType); + +} diff --git a/src/main/java/capturemanager/classes/SpreaderNodeFactory.java b/src/main/java/capturemanager/classes/SpreaderNodeFactory.java new file mode 100644 index 0000000..12fbb19 --- /dev/null +++ b/src/main/java/capturemanager/classes/SpreaderNodeFactory.java @@ -0,0 +1,63 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISpreaderNodeFactory; +import capturemanager.interfaces.IStreamNode; +import java.util.List; + +final class SpreaderNodeFactory extends SpreaderNodeFactoryNative implements ISpreaderNodeFactory { + + SpreaderNodeFactory(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public IStreamNode createSpreaderNode(List aDownStreamTopologyNodelist) { + IStreamNode lresult = null; + + do + { + if(mPtr == 0) + break; + + if(aDownStreamTopologyNodelist == null) + break; + + long[] lDownStreamTopologyNodelist = new long[aDownStreamTopologyNodelist.size()]; + + for(int lIndex = 0; lIndex < aDownStreamTopologyNodelist.size(); lIndex++) + { + + StreamNode lStreamNode = (StreamNode)aDownStreamTopologyNodelist.get(lIndex); + + if(lStreamNode != null) + lDownStreamTopologyNodelist[lIndex] = lStreamNode.mPtr; + } + + long lPtr = createSpreaderNode( + mPtr, + lDownStreamTopologyNodelist); + + if(lPtr == 0) + break; + + lresult = new StreamNode(lPtr); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/SpreaderNodeFactoryNative.java b/src/main/java/capturemanager/classes/SpreaderNodeFactoryNative.java new file mode 100644 index 0000000..a562ee5 --- /dev/null +++ b/src/main/java/capturemanager/classes/SpreaderNodeFactoryNative.java @@ -0,0 +1,7 @@ +package capturemanager.classes; + +abstract class SpreaderNodeFactoryNative { + native protected long createSpreaderNode( + long aPtr, + long[] aArrayPtrDownStreamTopologyNodes); +} diff --git a/src/main/java/capturemanager/classes/StreamControl.java b/src/main/java/capturemanager/classes/StreamControl.java new file mode 100644 index 0000000..75346a3 --- /dev/null +++ b/src/main/java/capturemanager/classes/StreamControl.java @@ -0,0 +1,93 @@ +package capturemanager.classes; + +import capturemanager.interfaces.ISpreaderNodeFactory; +import capturemanager.interfaces.IStreamControl; + +final class StreamControl extends StreamControlNative implements IStreamControl { + + protected static final String IID = "{E8F25B4A-8C71-4C9E-BD8C-82260DC4C21B}"; + + StreamControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public String getCollectionOfStreamControlNodeFactories() { + String lresult = ""; + + do + { + + if(mPtr != 0) + break; + + lresult = getCollectionOfStreamControlNodeFactories(mPtr); + + } + while(false); + + return lresult; + } + + @Override + public ISpreaderNodeFactory createStreamControlNodeFactory() { + ISpreaderNodeFactory lresult = null; + + do + { + + if(mPtr != 0) + break; + + long lPtr = createStreamControlNodeFactory( + mPtr, + "{85DFAAA1-4CC0-4A88-AE28-8F492E552CCA}"); + + if(lPtr != 0) + break; + + lresult = new SpreaderNodeFactory(lPtr); + } + while(false); + + return lresult; + } + + @Override + public ISpreaderNodeFactory createStreamControlNodeFactory(String aStringIID) { + ISpreaderNodeFactory lresult = null; + + do + { + + if(mPtr != 0) + break; + + long lPtr = createStreamControlNodeFactory( + mPtr, + aStringIID); + + if(lPtr != 0) + break; + + lresult = new SpreaderNodeFactory(lPtr); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/StreamControlNative.java b/src/main/java/capturemanager/classes/StreamControlNative.java new file mode 100644 index 0000000..ac84faa --- /dev/null +++ b/src/main/java/capturemanager/classes/StreamControlNative.java @@ -0,0 +1,11 @@ +package capturemanager.classes; + +abstract class StreamControlNative { + + native protected long createStreamControlNodeFactory( + long aPtr, + String aStringIID); + + native protected String getCollectionOfStreamControlNodeFactories( + long aPtr); +} diff --git a/src/main/java/capturemanager/classes/StreamNode.java b/src/main/java/capturemanager/classes/StreamNode.java new file mode 100644 index 0000000..a10db33 --- /dev/null +++ b/src/main/java/capturemanager/classes/StreamNode.java @@ -0,0 +1,23 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IStreamNode; + +final class StreamNode implements IStreamNode { + + StreamNode(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable { + super.finalize(); + + if (mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + +} diff --git a/src/main/java/capturemanager/classes/StrideForBitmap.java b/src/main/java/capturemanager/classes/StrideForBitmap.java new file mode 100644 index 0000000..6e0b761 --- /dev/null +++ b/src/main/java/capturemanager/classes/StrideForBitmap.java @@ -0,0 +1,49 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IStrideForBitmap; + +class StrideForBitmap extends StrideForBitmapNative implements IStrideForBitmap { + + protected static final String IID = "{74D903C9-69E6-4FC7-BF7A-9F47605C52BE}"; + + StrideForBitmap(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public int getStrideForBitmap(String aStringMFVideoFormat, int aWidthInPixels) { + + int lresult = 0; + + do + { + if(mPtr == 0) + break; + + if(aStringMFVideoFormat == null) + break; + + lresult = getStrideForBitmap( + mPtr, + aStringMFVideoFormat, + aWidthInPixels); + } + while(false); + + return lresult; + } + +} diff --git a/src/main/java/capturemanager/classes/StrideForBitmapNative.java b/src/main/java/capturemanager/classes/StrideForBitmapNative.java new file mode 100644 index 0000000..288a4aa --- /dev/null +++ b/src/main/java/capturemanager/classes/StrideForBitmapNative.java @@ -0,0 +1,8 @@ +package capturemanager.classes; + +abstract class StrideForBitmapNative { + native protected int getStrideForBitmap( + long aPtr, + String aStringMFVideoFormat, + int aWidthInPixels); +} diff --git a/src/main/java/capturemanager/classes/VersionControl.java b/src/main/java/capturemanager/classes/VersionControl.java new file mode 100644 index 0000000..1395648 --- /dev/null +++ b/src/main/java/capturemanager/classes/VersionControl.java @@ -0,0 +1,31 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IVersionControl; + +final class VersionControl extends VersionControlNative implements IVersionControl { + + protected static final String IID = "{39DC3AEF-3B59-4C0D-A1B2-54BF2653C056}"; + + VersionControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public String getXMLStringVersion() { + return getXMLStringVersion(mPtr); + } + +} diff --git a/src/main/java/capturemanager/classes/VersionControlNative.java b/src/main/java/capturemanager/classes/VersionControlNative.java new file mode 100644 index 0000000..e634587 --- /dev/null +++ b/src/main/java/capturemanager/classes/VersionControlNative.java @@ -0,0 +1,5 @@ +package capturemanager.classes; + +abstract class VersionControlNative { + native protected String getXMLStringVersion(long aPtr); +} diff --git a/src/main/java/capturemanager/classes/WebCamControl.java b/src/main/java/capturemanager/classes/WebCamControl.java new file mode 100644 index 0000000..64e46c9 --- /dev/null +++ b/src/main/java/capturemanager/classes/WebCamControl.java @@ -0,0 +1,58 @@ +package capturemanager.classes; + +import capturemanager.interfaces.IWebCamControl; + +final class WebCamControl extends WebCamControlNative implements IWebCamControl { + + WebCamControl(long aPtr) { + mPtr = aPtr; + } + + protected long mPtr = 0; + + @Override + protected void finalize() throws Throwable + { + super.finalize(); + + if(mPtr != 0) + CaptureManagerNativeProxy.getInstance().Release(mPtr); + + mPtr = 0; + } + + @Override + public String getCamParametrs() { + String lresult = ""; + + do + { + lresult = getCamParametrs(mPtr); + } + while(false); + + return lresult; + } + + @Override + public void setCamParametr( + int aParametrIndex, + int aNewValue, + int aFlag) { + + do + { + if(mPtr == 0) + break; + + setCamParametr( + mPtr, + aParametrIndex, + aNewValue, + aFlag); + } + while(false); + + } + +} diff --git a/src/main/java/capturemanager/classes/WebCamControlNative.java b/src/main/java/capturemanager/classes/WebCamControlNative.java new file mode 100644 index 0000000..67c2090 --- /dev/null +++ b/src/main/java/capturemanager/classes/WebCamControlNative.java @@ -0,0 +1,11 @@ +package capturemanager.classes; + +abstract class WebCamControlNative { + native protected String getCamParametrs( + long aPtr); + native protected void setCamParametr( + long aPtr, + int aParametrIndex, + int aNewValue, + int aFlag); +} diff --git a/src/main/java/capturemanager/interfaces/ICallbackListener.java b/src/main/java/capturemanager/interfaces/ICallbackListener.java new file mode 100644 index 0000000..b2a979c --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ICallbackListener.java @@ -0,0 +1,5 @@ +package capturemanager.interfaces; + +public interface ICallbackListener { + void invoke(byte[] aSampleBuffer, int aSampleSize); +} diff --git a/src/main/java/capturemanager/interfaces/ICaptureManagerControl.java b/src/main/java/capturemanager/interfaces/ICaptureManagerControl.java new file mode 100644 index 0000000..e90a79c --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ICaptureManagerControl.java @@ -0,0 +1,26 @@ +package capturemanager.interfaces; + +public interface ICaptureManagerControl { + + String getCollectionOfSources(); + + String getCollectionOfSinks(); + + ISourceControl createSourceControl(); + + ISessionControl createSessionControl(); + + ISinkControl createSinkControl(); + + IStreamControl createStreamControl(); + + IEncoderControl createEncoderControl(); + + int getStrideForBitmapInfoHeader( + String aStringMFVideoFormat, + int aWidthInPixels); + + IVersionControl getVersionControl(); + + void release(); +} diff --git a/src/main/java/capturemanager/interfaces/ICaptureManagerNativeProxy.java b/src/main/java/capturemanager/interfaces/ICaptureManagerNativeProxy.java new file mode 100644 index 0000000..db6cae2 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ICaptureManagerNativeProxy.java @@ -0,0 +1,10 @@ +package capturemanager.interfaces; + +public interface ICaptureManagerNativeProxy { + + public long explicitGetPtrClass(String aStringFilePath, String aStringCLSID, String aStringGUID); + + public void freeLibrary(String aFileName); + + public void Release(long aPtr); +} diff --git a/src/main/java/capturemanager/interfaces/IEVRSinkFactory.java b/src/main/java/capturemanager/interfaces/IEVRSinkFactory.java new file mode 100644 index 0000000..8555f4f --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IEVRSinkFactory.java @@ -0,0 +1,7 @@ +package capturemanager.interfaces; + +import java.awt.Component; + +public interface IEVRSinkFactory { + IStreamNode createOutputNode(Component aGraphicComponent); +} diff --git a/src/main/java/capturemanager/interfaces/IEncoderControl.java b/src/main/java/capturemanager/interfaces/IEncoderControl.java new file mode 100644 index 0000000..7cb3dab --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IEncoderControl.java @@ -0,0 +1,7 @@ +package capturemanager.interfaces; + +public interface IEncoderControl { + IEncoderNodeFactory createEncoderNodeFactory(String aEncoderCLSID); + String getCollectionOfEncoders(); + String getMediaTypeCollectionOfEncoder(IMediaType aPtrUncompressedMediaType, String aEncoderCLSID); +} diff --git a/src/main/java/capturemanager/interfaces/IEncoderNodeFactory.java b/src/main/java/capturemanager/interfaces/IEncoderNodeFactory.java new file mode 100644 index 0000000..f91cb79 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IEncoderNodeFactory.java @@ -0,0 +1,18 @@ +package capturemanager.interfaces; + +public interface IEncoderNodeFactory { + + IMediaType createCompressedMediaType( + IMediaType aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType); + + IStreamNode createEncoderNode( + IMediaType aPtrUncompressedMediaType, + String aStringEncodingModeGUID, + int aEncodingModeValue, + int aIndexCompressedMediaType, + IStreamNode aPtrDownStreamNode); + +} diff --git a/src/main/java/capturemanager/interfaces/IFileSinkFactory.java b/src/main/java/capturemanager/interfaces/IFileSinkFactory.java new file mode 100644 index 0000000..c1a7fc0 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IFileSinkFactory.java @@ -0,0 +1,9 @@ +package capturemanager.interfaces; + +import java.util.List; + +public interface IFileSinkFactory { + List createOutputNodes( + List aArrayPtrCompressedMediaTypes, + String aPtrFileName); +} diff --git a/src/main/java/capturemanager/interfaces/ILogPrintOutControl.java b/src/main/java/capturemanager/interfaces/ILogPrintOutControl.java new file mode 100644 index 0000000..c37ac77 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ILogPrintOutControl.java @@ -0,0 +1,8 @@ +package capturemanager.interfaces; + +public interface ILogPrintOutControl { + void addPrintOutDestination(int aLevelType, String aFilePath); + void removePrintOutDestination(int aLevelType, String aFilePath); + void setVerbose(int aLevelType, String aFilePath, Boolean aState); + void release(); +} diff --git a/src/main/java/capturemanager/interfaces/IMediaType.java b/src/main/java/capturemanager/interfaces/IMediaType.java new file mode 100644 index 0000000..faa0f0e --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IMediaType.java @@ -0,0 +1,5 @@ +package capturemanager.interfaces; + +public interface IMediaType { + +} diff --git a/src/main/java/capturemanager/interfaces/ISampleGrabberCall.java b/src/main/java/capturemanager/interfaces/ISampleGrabberCall.java new file mode 100644 index 0000000..dcc517e --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISampleGrabberCall.java @@ -0,0 +1,9 @@ +package capturemanager.interfaces; + +import java.nio.ByteBuffer; + +public interface ISampleGrabberCall { + int readData(ByteBuffer byteBuffer); + void RGB32ToBGRA(ByteBuffer byteBuffer); + IStreamNode getStreamNode(); +} diff --git a/src/main/java/capturemanager/interfaces/ISampleGrabberCallSinkFactory.java b/src/main/java/capturemanager/interfaces/ISampleGrabberCallSinkFactory.java new file mode 100644 index 0000000..8747e53 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISampleGrabberCallSinkFactory.java @@ -0,0 +1,9 @@ +package capturemanager.interfaces; + +public interface ISampleGrabberCallSinkFactory { + + ISampleGrabberCall createOutputNode( + String aStringMajorType, + String aStringSubType, + int aSampleByteSize); +} diff --git a/src/main/java/capturemanager/interfaces/ISampleGrabberCallback.java b/src/main/java/capturemanager/interfaces/ISampleGrabberCallback.java new file mode 100644 index 0000000..c857ae2 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISampleGrabberCallback.java @@ -0,0 +1,9 @@ +package capturemanager.interfaces; + +public interface ISampleGrabberCallback { + + void addCallbackListener(ICallbackListener aICallbackListener); + + IStreamNode getStreamNode(); + +} diff --git a/src/main/java/capturemanager/interfaces/ISampleGrabberCallbackSinkFactory.java b/src/main/java/capturemanager/interfaces/ISampleGrabberCallbackSinkFactory.java new file mode 100644 index 0000000..6f39ff9 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISampleGrabberCallbackSinkFactory.java @@ -0,0 +1,7 @@ +package capturemanager.interfaces; + +public interface ISampleGrabberCallbackSinkFactory { + ISampleGrabberCallback createOutputNode( + String aStringMajorType, + String aStringSubType); +} diff --git a/src/main/java/capturemanager/interfaces/ISession.java b/src/main/java/capturemanager/interfaces/ISession.java new file mode 100644 index 0000000..498068a --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISession.java @@ -0,0 +1,12 @@ +package capturemanager.interfaces; + +public interface ISession { + boolean startSession( + long aStartPositionInHundredNanosecondUnits, + String aStringGUIDTimeFormat); + boolean pauseSession(); + boolean stopSession(); + boolean closeSession(); + int getSessionDescriptor(); + void addUpdateStateListener(IUpdateStateListener aICallbackListener); +} diff --git a/src/main/java/capturemanager/interfaces/ISessionControl.java b/src/main/java/capturemanager/interfaces/ISessionControl.java new file mode 100644 index 0000000..369b221 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISessionControl.java @@ -0,0 +1,10 @@ +package capturemanager.interfaces; + +import java.util.*; + +public interface ISessionControl { + + ISession createSession( + List aArrayPtrSourceNodesOfTopology); + +} diff --git a/src/main/java/capturemanager/interfaces/ISinkControl.java b/src/main/java/capturemanager/interfaces/ISinkControl.java new file mode 100644 index 0000000..5c42518 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISinkControl.java @@ -0,0 +1,21 @@ +package capturemanager.interfaces; + +public interface ISinkControl { + + IFileSinkFactory createFileSinkFactory( + String aStringContainerTypeGUID); + +// IByteStreamSinkFactory createSinkFactory( +// String aStringContainerTypeGUID); + + ISampleGrabberCallSinkFactory createSampleGrabberCallSinkFactory( + String aStringContainerTypeGUID); + + ISampleGrabberCallbackSinkFactory createSampleGrabberCallbackSinkFactory( + String aStringContainerTypeGUID); + + IEVRSinkFactory createEVRSinkFactory( + String aStringContainerTypeGUID); + + String getCollectionOfSinks(); +} diff --git a/src/main/java/capturemanager/interfaces/ISourceControl.java b/src/main/java/capturemanager/interfaces/ISourceControl.java new file mode 100644 index 0000000..0ed56b0 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISourceControl.java @@ -0,0 +1,45 @@ +package capturemanager.interfaces; + +public interface ISourceControl { + IMediaType getSourceOutputMediaType( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType); + +// IStreamNode createSource( +// String aSymbolicLink); + + IStreamNode createSourceNode( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType, + IStreamNode aPtrDownStreamTopologyNode); + + IStreamNode createSourceNode( + String aSymbolicLink, + int aIndexStream, + int aIndexMediaType); + +// IStreamNode createSourceNodeFromExternalSource( +// object aPtrMediaSource, +// uint aIndexStream, +// uint aIndexMediaType, +// out object aPtrPtrTopologyNode); + +// IStreamNode createSourceNodeFromExternalSourceWithDownStreamConnection( +// object aPtrMediaSource, +// uint aIndexStream, +// uint aIndexMediaType, +// object aPtrDownStreamTopologyNode, +// out object aPtrPtrTopologyNode); + + String getCollectionOfSources(); + +// IStreamNode getSourceOutputMediaTypeFromMediaSource( +// object aPtrMediaSource, +// uint aIndexStream, +// uint aIndexMediaType, +// out object aPtrPtrOutputMediaType); + +// IWebCamControl createWebCamControl(string aSymbolicLink); +} diff --git a/src/main/java/capturemanager/interfaces/ISpreaderNodeFactory.java b/src/main/java/capturemanager/interfaces/ISpreaderNodeFactory.java new file mode 100644 index 0000000..15fdc48 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/ISpreaderNodeFactory.java @@ -0,0 +1,8 @@ +package capturemanager.interfaces; + +import java.util.List; + +public interface ISpreaderNodeFactory { + IStreamNode createSpreaderNode( + List aDownStreamTopologyNodelist); +} diff --git a/src/main/java/capturemanager/interfaces/IStreamControl.java b/src/main/java/capturemanager/interfaces/IStreamControl.java new file mode 100644 index 0000000..828a3ce --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IStreamControl.java @@ -0,0 +1,11 @@ +package capturemanager.interfaces; + +public interface IStreamControl { + + String getCollectionOfStreamControlNodeFactories(); + + ISpreaderNodeFactory createStreamControlNodeFactory(); + + ISpreaderNodeFactory createStreamControlNodeFactory( + String aStringIID); +} diff --git a/src/main/java/capturemanager/interfaces/IStreamNode.java b/src/main/java/capturemanager/interfaces/IStreamNode.java new file mode 100644 index 0000000..d7b1515 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IStreamNode.java @@ -0,0 +1,5 @@ +package capturemanager.interfaces; + +public interface IStreamNode { + +} diff --git a/src/main/java/capturemanager/interfaces/IStrideForBitmap.java b/src/main/java/capturemanager/interfaces/IStrideForBitmap.java new file mode 100644 index 0000000..abf90ca --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IStrideForBitmap.java @@ -0,0 +1,7 @@ +package capturemanager.interfaces; + +public interface IStrideForBitmap { + int getStrideForBitmap( + String aStringMFVideoFormat, + int aWidthInPixels); +} diff --git a/src/main/java/capturemanager/interfaces/IUpdateStateListener.java b/src/main/java/capturemanager/interfaces/IUpdateStateListener.java new file mode 100644 index 0000000..1cc5144 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IUpdateStateListener.java @@ -0,0 +1,5 @@ +package capturemanager.interfaces; + +public interface IUpdateStateListener { + void invoke(int aCallbackEventCode, int aSessionDescriptor); +} diff --git a/src/main/java/capturemanager/interfaces/IVersionControl.java b/src/main/java/capturemanager/interfaces/IVersionControl.java new file mode 100644 index 0000000..4e2ed53 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IVersionControl.java @@ -0,0 +1,5 @@ +package capturemanager.interfaces; + +public interface IVersionControl { + String getXMLStringVersion(); +} diff --git a/src/main/java/capturemanager/interfaces/IWebCamControl.java b/src/main/java/capturemanager/interfaces/IWebCamControl.java new file mode 100644 index 0000000..22735b4 --- /dev/null +++ b/src/main/java/capturemanager/interfaces/IWebCamControl.java @@ -0,0 +1,11 @@ +package capturemanager.interfaces; + +public interface IWebCamControl { + + String getCamParametrs(); + + void setCamParametr( + int aParametrIndex, + int aNewValue, + int aFlag); +} diff --git a/src/main/java/capturemanager/utils/NativeUtils.java b/src/main/java/capturemanager/utils/NativeUtils.java new file mode 100644 index 0000000..b5c0bf1 --- /dev/null +++ b/src/main/java/capturemanager/utils/NativeUtils.java @@ -0,0 +1,52 @@ +/* + * Class NativeUtils is published under the The MIT License: + * + * Copyright (c) 2012 Adam Heinrich + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package capturemanager.utils; + +import java.io.*; + +/** + * A simple library class which helps with loading dynamic libraries stored in the + * JAR archive. These libraries usualy contain implementation of some methods in + * native code (using JNI - Java Native Interface). + * + * @see http://adamheinrich.com/blog/2012/how-to-load-native-jni-library-from-jar + * @see https://github.com/adamheinrich/native-utils + * + */ +public class NativeUtils { + + /** + * Private constructor - this class will never be instanced + */ + private NativeUtils() { + } + + public static File loadLibrary(final String path) throws IOException { + final File file = new File(path); + + System.load(file.getAbsolutePath()); + + return file; + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/TestCaptureManagerDriver.java b/src/main/java/com/github/eduramiba/webcamcapture/TestCaptureManagerDriver.java new file mode 100644 index 0000000..1dbcfbb --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/TestCaptureManagerDriver.java @@ -0,0 +1,68 @@ +package com.github.eduramiba.webcamcapture; + +import com.github.eduramiba.webcamcapture.drivers.WebcamDeviceWithBufferOperations; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.CaptureManagerDriver; +import com.github.sarxos.webcam.Webcam; +import com.github.sarxos.webcam.WebcamDevice; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javafx.application.Application; +import javafx.application.Platform; +import javafx.scene.Scene; +import javafx.scene.image.ImageView; +import javafx.scene.image.WritableImage; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestCaptureManagerDriver extends Application { + + private static final Logger LOG = LoggerFactory.getLogger(TestCaptureManagerDriver.class); + + public static final ScheduledExecutorService EXECUTOR = Executors.newScheduledThreadPool(4); + + public static void main(String[] args) { + Webcam.setDriver(new CaptureManagerDriver()); + + launch(args); + } + + @Override + public void start(Stage stage) throws Exception { + ImageView imageView = new ImageView(); + HBox root = new HBox(); + root.getChildren().add(imageView); + + Webcam.getWebcams().stream() + .findFirst() + .ifPresent((final Webcam camera) -> { + final WebcamDevice device = camera.getDevice(); + LOG.info("Found camera: {}, device = {}", camera, device); + + final int width = device.getResolution().width; + final int height = device.getResolution().height; + final WritableImage fxImage = new WritableImage(width, height); + Platform.runLater(() -> { + imageView.setImage(fxImage); + }); + + camera.open(); + if (device instanceof WebcamDeviceWithBufferOperations) { + EXECUTOR.scheduleAtFixedRate(() -> { + ((WebcamDeviceWithBufferOperations) device).updateFXIMage(fxImage); + }, 0, 16, TimeUnit.MILLISECONDS); + } + }); + + // Create the Scene + Scene scene = new Scene(root); + // Add the scene to the Stage + stage.setScene(scene); + // Set the title of the Stage + stage.setTitle("Displaying an Image"); + // Display the Stage + stage.show(); + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithBufferOperations.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithBufferOperations.java new file mode 100644 index 0000000..10b06e5 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithBufferOperations.java @@ -0,0 +1,15 @@ +package com.github.eduramiba.webcamcapture.drivers; + +import com.github.sarxos.webcam.WebcamDevice; +import java.awt.image.BufferedImage; +import java.nio.ByteBuffer; +import javafx.scene.image.WritableImage; + +public interface WebcamDeviceWithBufferOperations extends WebcamDevice { + + BufferedImage getImage(final ByteBuffer byteBuffer); + + boolean updateFXIMage(final WritableImage writableImage, final ByteBuffer byteBuffer); + + boolean updateFXIMage(final WritableImage writableImage); +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithId.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithId.java new file mode 100644 index 0000000..80b5928 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/WebcamDeviceWithId.java @@ -0,0 +1,7 @@ +package com.github.eduramiba.webcamcapture.drivers; + +import com.github.sarxos.webcam.WebcamDevice; + +public interface WebcamDeviceWithId extends WebcamDevice { + String getId(); +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerDriver.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerDriver.java new file mode 100644 index 0000000..17b2db8 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerDriver.java @@ -0,0 +1,46 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager; + +import capturemanager.classes.CaptureManager; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.parser.CaptureManagerModelXMLParser; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import com.github.sarxos.webcam.WebcamDevice; +import com.github.sarxos.webcam.WebcamDriver; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CaptureManagerDriver implements WebcamDriver { + + private static final Logger LOG = LoggerFactory.getLogger(CaptureManagerDriver.class); + + @Override + public List getDevices() { + try { + final CaptureManager captureManager = CaptureManager.getInstance(); + + final CaptureManagerModelXMLParser parser = new CaptureManagerModelXMLParser(); + final List sources = parser.parseVideoSources(captureManager.getICaptureManagerControl().getCollectionOfSources()); + + final List sinksFactories = parser.parseSinkFactories(captureManager.getICaptureManagerControl().getCollectionOfSinks()); + + return sources.stream() + .filter(Objects::nonNull) + .map(source -> new CaptureManagerVideoDevice(source, sinksFactories)) + .filter(CaptureManagerVideoDevice::isValid) + .collect(Collectors.toList()); + } catch (Throwable ex) { + LOG.error("Unexpected error listing video devices", ex); + + return Collections.emptyList(); + } + } + + @Override + public boolean isThreadSafe() { + return false; + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerFrameGrabberSession.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerFrameGrabberSession.java new file mode 100644 index 0000000..fc89efe --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerFrameGrabberSession.java @@ -0,0 +1,322 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager; + +import capturemanager.classes.CaptureManager; +import capturemanager.interfaces.*; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerMediaType; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerStreamDescriptor; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.SinkValuePart; +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.awt.image.*; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import javafx.scene.image.PixelFormat; +import javafx.scene.image.PixelWriter; +import javafx.scene.image.WritableImage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CaptureManagerFrameGrabberSession { + + private static final Logger LOG = LoggerFactory.getLogger(CaptureManagerFrameGrabberSession.class); + + private static final String MFMediaType_Video = "{73646976-0000-0010-8000-00AA00389B71}"; + private static final String MFVideoFormat_RGB32 = "{00000016-0000-0010-8000-00AA00389B71}"; + + private ByteBuffer directBuffer = null; + private byte[] arrayByteBuffer = null; + private BufferedImage bufferedImage = null; + + private ISampleGrabberCall simpleGrabberCall = null; + + private SampleModel sampleModel = null; + + private ISession session = null; + private int videoWidth = -1; + private int videoHeight = -1; + private int bufferSizeBytes = -1; + + public boolean init( + final CaptureManagerSource source, + final CaptureManagerStreamDescriptor stream, + final CaptureManagerMediaType mediaType, + final List sinkFactories + ) { + final int streamIndex = source.getStreamDescriptors().indexOf(stream); + + if (streamIndex < 0) { + LOG.error("Could not find stream = {} in source = {}", stream, source); + return false; + } + + final int mediaTypeIndex = stream.getMediaTypes().indexOf(mediaType); + + if (mediaTypeIndex < 0) { + LOG.error("Could not find media type = {} in stream {}", mediaType, stream); + return false; + } + + final ISourceControl sourceControl = CaptureManager.getInstance().getICaptureManagerControl().createSourceControl(); + + if (sourceControl == null) { + LOG.error("Could not create source control"); + return false; + } + + final ISinkControl sinkControl = CaptureManager.getInstance().getICaptureManagerControl().createSinkControl(); + + if (sinkControl == null) { + LOG.error("Could not create sink control"); + return false; + } + + final ISessionControl sessionControl = CaptureManager.getInstance().getICaptureManagerControl().createSessionControl(); + + if (sessionControl == null) { + LOG.error("Could not create session control"); + return false; + } + + final CaptureManagerSinkFactory sinkFactory = sinkFactories.stream() + .filter( + s -> + s.getGuid().equalsIgnoreCase("{759D24FF-C5D6-4B65-8DDF-8A2B2BECDE39}") + || Utils.containsIgnoreCase(s.getName(), "SampleGrabberCallSinkFactory") + ) + .findFirst() + .orElse(null); + + if (sinkFactory == null) { + LOG.error("Could not find SampleGrabberCallbackSinkFactory"); + return false; + } + + final SinkValuePart sinkValuePart = Utils.coalesce( + findSinkValuePart(sinkFactory, "ASYNC"), + findSinkValuePart(sinkFactory, "SYNC"), + findSinkValuePart(sinkFactory, null) + ); + + if (sinkValuePart == null) { + LOG.error("Could not find sinkValuePart in sink factory = {}", sinkFactory); + } + + final String sinkGUID = sinkFactory.getValueParts().stream().findFirst() + .map(SinkValuePart::getGuid) + .orElse(null); + + if (Utils.isBlank(sinkGUID)) { + LOG.error("Could not find valid value part GUID in sink factory = {}", sinkFactory); + } + + final ISampleGrabberCallSinkFactory sampleGrabberCallbackSinkFactory = sinkControl.createSampleGrabberCallSinkFactory( + sinkGUID + ); + + if (sampleGrabberCallbackSinkFactory == null) { + LOG.error("Could not create ISampleGrabberCallbackSinkFactory"); + return false; + } + + this.videoWidth = mediaType.getWidth(); + this.videoHeight = mediaType.getHeight(); + + final String videoFormat = MFVideoFormat_RGB32; + + final int stride = CaptureManager.getInstance().getICaptureManagerControl().getStrideForBitmapInfoHeader( + videoFormat, + videoWidth + ); + + bufferSizeBytes = Math.abs(stride) * videoWidth; + + directBuffer = ByteBuffer.allocateDirect(bufferSizeBytes); + arrayByteBuffer = new byte[bufferSizeBytes]; + + bufferedImage = new BufferedImage(videoWidth, videoHeight, BufferedImage.TYPE_INT_BGR); + + sampleModel = new ComponentSampleModel( + DataBuffer.TYPE_BYTE, videoWidth, videoHeight, 4, videoWidth * 4, + new int[]{2, 1, 0} // Try {1,2,3}, {3,2,1}, {0,1,2} + ); + + simpleGrabberCall = sampleGrabberCallbackSinkFactory.createOutputNode( + MFMediaType_Video, + videoFormat, + bufferSizeBytes + ); + + + if (simpleGrabberCall == null) { + LOG.error("Could not create ISampleGrabberCallback"); + return false; + } + final IStreamNode streamNode = simpleGrabberCall.getStreamNode(); + + if (streamNode == null) { + LOG.error("Could not create streamNode"); + return false; + } + + final IStreamNode sourceNode = sourceControl.createSourceNode( + source.getSymbolicLink(), + streamIndex, + mediaTypeIndex, + streamNode + ); + + if (sourceNode == null) { + LOG.error("Could not create sourceNode"); + return false; + } + + final List lArrayPtrSourceNodesOfTopology = new ArrayList<>(); + + lArrayPtrSourceNodesOfTopology.add(sourceNode); + + session = sessionControl.createSession( + lArrayPtrSourceNodesOfTopology + ); + + if (session == null) { + LOG.error("Could not create session control last step"); + return false; + } + + session.addUpdateStateListener(new IUpdateStateListener() { + @Override + public void invoke(int aCallbackEventCode, int aSessionDescriptor) { + LOG.info("invoke with (aCallbackEventCode, aSessionDescriptor) = ({}, {})", aCallbackEventCode, aSessionDescriptor); + } + }); + + LOG.info("Successfully created CallSessionControl"); + + return true; + } + + private SinkValuePart findSinkValuePart(final CaptureManagerSinkFactory sinkFactory, final String name) { + return sinkFactory.getValueParts().stream() + .filter(s -> name == null || s.getValue().equalsIgnoreCase(name)) + .findFirst() + .orElse(null); + } + + public synchronized void start() { + if (session == null) { + LOG.error("Call init before start!!"); + return; + } + + session.startSession(0, "{00000000-0000-0000-0000-000000000000}"); + } + + public synchronized void stop() { + if (session == null) { + return; + } + + session.stopSession(); + + session.closeSession(); + } + + public synchronized BufferedImage toBufferedImage() { + if (!isOpen()) { + return null; + } + + updateDirectBuffer(); + return toBufferedImage(directBuffer); + } + + public synchronized BufferedImage toBufferedImage(final ByteBuffer byteBuffer) { + if (byteBuffer == null) { + return null; + } + + byteBuffer.mark(); + byteBuffer.position(0); + byteBuffer.get(arrayByteBuffer, 0, byteBuffer.capacity()); + byteBuffer.reset(); + + final DataBuffer dataBuffer = new DataBufferByte(arrayByteBuffer, arrayByteBuffer.length); + final Raster raster = Raster.createRaster(sampleModel, dataBuffer, null); + bufferedImage.setData(raster); + + return bufferedImage; + } + + public synchronized boolean updateFXIMage(final WritableImage writableImage) { + if (!isOpen()) { + return false; + } + + final int sizeData = updateDirectBuffer(); + + if (sizeData <= 0) { + return false; + } + + updateFXIMage(writableImage, directBuffer); + + return true; + } + + public synchronized void updateFXIMage(final WritableImage writableImage, final ByteBuffer byteBuffer) { + final PixelWriter pw = writableImage.getPixelWriter(); + + byteBuffer.mark(); + byteBuffer.position(0); + pw.setPixels(0, 0, videoWidth, videoHeight, PixelFormat.getByteBgraPreInstance(), byteBuffer, 4 * videoWidth); + byteBuffer.reset(); + } + + public synchronized ByteBuffer getDirectBuffer() { + if (!isOpen()) { + return null; + } + + directBuffer.position(0); + return directBuffer; + } + + + public synchronized int updateDirectBuffer() { + return simpleGrabberCall.readData(directBuffer); + } + + public boolean isOpen() { + return session != null; + } + + public synchronized void getImageBytes(final ByteBuffer target) { + if (target == null) { + return; + } + + if (target.remaining() < bufferSizeBytes) { + LOG.error("At least {} bytes needed but passed buffer has only {} remaining size", bufferSizeBytes, target.capacity()); + return; + } + + updateDirectBuffer(); + copyBuffer(target, directBuffer); + } + + private static int copyBuffer(ByteBuffer dest, ByteBuffer src) { + final int nTransfer = Math.min(dest.remaining(), src.remaining()); + if (nTransfer > 0) { + dest.put( + src.array(), + src.arrayOffset() + src.position(), + nTransfer + ); + src.position(src.position() + nTransfer); + } + + return nTransfer; + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerVideoDevice.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerVideoDevice.java new file mode 100644 index 0000000..d441783 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/CaptureManagerVideoDevice.java @@ -0,0 +1,265 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager; + +import com.github.eduramiba.webcamcapture.drivers.WebcamDeviceWithBufferOperations; +import com.github.eduramiba.webcamcapture.drivers.WebcamDeviceWithId; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerMediaType; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerStreamDescriptor; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import com.github.eduramiba.webcamcapture.utils.Pair; +import com.github.sarxos.webcam.WebcamDevice; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import javafx.scene.image.WritableImage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CaptureManagerVideoDevice implements WebcamDevice, WebcamDevice.FPSSource, WebcamDevice.BufferAccess, WebcamDeviceWithId, WebcamDeviceWithBufferOperations { + + private static final Logger LOG = LoggerFactory.getLogger(CaptureManagerVideoDevice.class); + + private final CaptureManagerSource source; + private final List sinksFactories; + private final Dimension[] resolutions; + private Dimension resolution; + + private CaptureManagerFrameGrabberSession session = null; + + public CaptureManagerVideoDevice(CaptureManagerSource source, List sinksFactories) { + this.source = Objects.requireNonNull(source, "source"); + this.sinksFactories = Objects.requireNonNull(sinksFactories, "sinksFactories"); + + this.resolutions = source.getStreamDescriptors() + .stream() + .flatMap(s -> s.getMediaTypes().stream()) + .map(m -> new Dimension(m.getWidth(), m.getHeight())) + .distinct() + .toArray(Dimension[]::new); + + this.resolution = bestResolution(resolutions); + } + + public boolean isValid() { + return resolution != null && resolution.width > 0 && resolution.height > 0; + } + + private Dimension bestResolution(final Dimension[] resolutions) { + Dimension best = null; + int bestPixels = 0; + + for (Dimension dim : resolutions) { + int px = dim.width * dim.height; + + if (px > bestPixels) { + best = dim; + bestPixels = px; + } + } + + return best; + } + + @Override + public String getId() { + return source.getSymbolicLink(); + } + + @Override + public String getName() { + return source.getFriendlyName(); + } + + @Override + public Dimension[] getResolutions() { + return resolutions; + } + + @Override + public Dimension getResolution() { + return resolution; + } + + @Override + public void setResolution(Dimension resolution) { + this.resolution = resolution; + } + + @Override + public BufferedImage getImage() { + if (isOpen()) { + return session.toBufferedImage(); + } + return null; + } + + @Override + public void open() { + if (isOpen()) { + return; + } + + session = new CaptureManagerFrameGrabberSession(); + + final Pair best = findBestMediaTypeInStreams( + source.getStreamDescriptors(), + resolution + ); + + if (best != null) { + final CaptureManagerStreamDescriptor stream = best.getLeft(); + final CaptureManagerMediaType mediaType = best.getRight(); + + LOG.info("Using video media type: {}", mediaType); + session.init( + source, + stream, + mediaType, + sinksFactories + ); + session.start(); + } else { + LOG.warn("Could not find best stream and mediaType for source = {} and resolution = {}", source, resolution); + } + } + + @Override + public void close() { + if (session != null && session.isOpen()) { + session.stop(); + } + } + + @Override + public void dispose() { + session = null; + } + + @Override + public boolean isOpen() { + return session != null && session.isOpen(); + } + + private static Pair findBestMediaTypeInStreams( + final Collection videoStreams, + final Dimension resolution + ) { + CaptureManagerStreamDescriptor bestStream = null; + CaptureManagerMediaType bestMediaType = null; + + for (CaptureManagerStreamDescriptor stream : videoStreams) { + final CaptureManagerMediaType streamBestMediaType = findBestMediaType(stream, resolution); + final CaptureManagerMediaType newBestMediaType = findBestMediaTypeInList(Arrays.asList(bestMediaType, streamBestMediaType), resolution); + + if (newBestMediaType == streamBestMediaType) { + bestStream = stream; + } + + bestMediaType = newBestMediaType; + } + + if (bestStream != null && bestMediaType != null) { + return Pair.of(bestStream, bestMediaType); + } else { + return null; + } + } + + private static CaptureManagerMediaType findBestMediaType(final CaptureManagerStreamDescriptor videoStream, final Dimension resolution) { + if (videoStream == null || !videoStream.isVideoStream()) { + return null; + } + + return findBestMediaTypeInList(videoStream.getMediaTypes(), resolution); + } + + private static CaptureManagerMediaType findBestMediaTypeInList(final Collection mediaTypes, final Dimension resolution) { + int maxPixels = 0; + CaptureManagerMediaType bestMediaType = null; + + for (CaptureManagerMediaType mediaType : mediaTypes) { + if (mediaType == null) { + continue; + } + + if (resolution != null && (resolution.width != mediaType.getWidth() || resolution.height != mediaType.getHeight())) { + continue; + } + + final int pixels = mediaType.getWidth() * mediaType.getHeight(); + + if (pixels > maxPixels) { + maxPixels = pixels; + bestMediaType = mediaType; + } else if (pixels == maxPixels && mediaType.getSubType().contains("NV12")) {//Prefer NV12 + bestMediaType = mediaType; + } else if (pixels == maxPixels && mediaType.getSubType().contains("YUV")) {//Prefer YUV if no NV12 + bestMediaType = mediaType; + } + } + + return bestMediaType; + } + + public static final int MAX_FPS = 30; + + @Override + public double getFPS() { + //TODO: Use actual FPS declared by stream + return MAX_FPS; + } + + @Override + public ByteBuffer getImageBytes() { + if (!isOpen()) { + return null; + } + + session.updateDirectBuffer(); + return session.getDirectBuffer(); + } + + @Override + public void getImageBytes(final ByteBuffer byteBuffer) { + if (isOpen()) { + session.getImageBytes(byteBuffer); + } + } + + @Override + public boolean updateFXIMage(WritableImage writableImage, ByteBuffer byteBuffer) { + if (isOpen()) { + session.updateFXIMage(writableImage, byteBuffer); + return true; + } + + return false; + } + + @Override + public boolean updateFXIMage(WritableImage writableImage) { + if (isOpen()) { + return session.updateFXIMage(writableImage); + } + + return false; + } + + @Override + public String toString() { + return source.toString(); + } + + @Override + public BufferedImage getImage(ByteBuffer byteBuffer) { + if (!isOpen()) { + return null; + } + + return session.toBufferedImage(byteBuffer); + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerMediaType.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerMediaType.java new file mode 100644 index 0000000..7d09a9d --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerMediaType.java @@ -0,0 +1,111 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model; + +import com.github.eduramiba.webcamcapture.utils.Utils; + +public class CaptureManagerMediaType { + + private final int width; + private final int height; + private final String majorType; + private final String subType; + + public CaptureManagerMediaType(int width, int height, String majorType, String subType) { + this.width = width; + this.height = height; + this.majorType = Utils.trimToEmpty(majorType); + this.subType = Utils.trimToEmpty(subType); + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public String getMajorType() { + return majorType; + } + + public String getSubType() { + return subType; + } + + @Override + public String toString() { + return "CaptureManagerMediaType{" + "width=" + width + ", height=" + height + ", majorType=" + majorType + ", subType=" + subType + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CaptureManagerMediaType that = (CaptureManagerMediaType) o; + + if (width != that.width) { + return false; + } + if (height != that.height) { + return false; + } + if (!majorType.equals(that.majorType)) { + return false; + } + return subType.equals(that.subType); + } + + @Override + public int hashCode() { + int result = width; + result = 31 * result + height; + result = 31 * result + majorType.hashCode(); + result = 31 * result + subType.hashCode(); + return result; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + + private int width; + private int height; + private String majorType; + private String subType; + + private Builder() { + } + + public Builder width(int width) { + this.width = width; + return this; + } + + public Builder height(int height) { + this.height = height; + return this; + } + + public Builder majorType(String majorType) { + this.majorType = majorType; + return this; + } + + public Builder subType(String subType) { + this.subType = subType; + return this; + } + + public CaptureManagerMediaType build() { + return new CaptureManagerMediaType(width, height, majorType, subType); + } + } + +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerSource.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerSource.java new file mode 100644 index 0000000..dc2a797 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerSource.java @@ -0,0 +1,192 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model; + +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.util.Collections; +import java.util.List; + +public class CaptureManagerSource { + + private final String symbolicLink; + private final String deviceLink; + private final String friendlyName; + private final String majorType; + private final String subType; + private final boolean isSoftwareDevice; + private final List streamDescriptors; + + public CaptureManagerSource(String symbolicLink, String deviceLink, String friendlyName, String majorType, String subType, boolean isSoftwareDevice, List streamDescriptors) { + this.symbolicLink = Utils.trimToEmpty(symbolicLink); + this.deviceLink = Utils.trimToEmpty(deviceLink); + this.friendlyName = Utils.trimToEmpty(friendlyName); + this.majorType = Utils.trimToEmpty(majorType); + this.subType = Utils.trimToEmpty(subType); + this.isSoftwareDevice = isSoftwareDevice; + this.streamDescriptors = Utils.coalesce(streamDescriptors, Collections.emptyList()); + } + + public String getSymbolicLink() { + return symbolicLink; + } + + public String getDeviceLink() { + return deviceLink; + } + + public String getFriendlyName() { + return friendlyName; + } + + public String getMajorType() { + return majorType; + } + + public String getSubType() { + return subType; + } + + public boolean isSoftwareDevice() { + return isSoftwareDevice; + } + + public boolean isVideoDevice() { + return streamDescriptors.stream().anyMatch(CaptureManagerStreamDescriptor::isVideoStream); + } + + public List getStreamDescriptors() { + return streamDescriptors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CaptureManagerSource that = (CaptureManagerSource) o; + + if (isSoftwareDevice != that.isSoftwareDevice) { + return false; + } + if (!symbolicLink.equals(that.symbolicLink)) { + return false; + } + if (!deviceLink.equals(that.deviceLink)) { + return false; + } + if (!friendlyName.equals(that.friendlyName)) { + return false; + } + if (!majorType.equals(that.majorType)) { + return false; + } + if (!subType.equals(that.subType)) { + return false; + } + return streamDescriptors.equals(that.streamDescriptors); + } + + @Override + public int hashCode() { + int result = symbolicLink.hashCode(); + result = 31 * result + deviceLink.hashCode(); + result = 31 * result + friendlyName.hashCode(); + result = 31 * result + majorType.hashCode(); + result = 31 * result + subType.hashCode(); + result = 31 * result + (isSoftwareDevice ? 1 : 0); + result = 31 * result + streamDescriptors.hashCode(); + return result; + } + + @Override + public String toString() { + return "CaptureManagerSource{" + "symbolicLink=" + symbolicLink + ", deviceLink=" + deviceLink + ", friendlyName=" + friendlyName + ", majorType=" + majorType + ", subType=" + subType + ", isSoftwareDevice=" + isSoftwareDevice + ", streamDescriptors=" + streamDescriptors + '}'; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + + private String symbolicLink; + private String deviceLink; + private String friendlyName; + private String majorType; + private String subType; + private boolean isSoftwareDevice = false; + private List streamDescriptors; + + private Builder() { + } + + public String getSymbolicLink() { + return symbolicLink; + } + + public String getDeviceLink() { + return deviceLink; + } + + public String getFriendlyName() { + return friendlyName; + } + + public String getMajorType() { + return majorType; + } + + public String getSubType() { + return subType; + } + + public boolean isSoftwareDevice() { + return isSoftwareDevice; + } + + public List getStreamDescriptors() { + return streamDescriptors; + } + + public Builder symbolicLink(String symbolicLink) { + this.symbolicLink = symbolicLink; + return this; + } + + public Builder deviceLink(String deviceLink) { + this.deviceLink = deviceLink; + return this; + } + + public Builder friendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + public Builder majorType(String majorType) { + this.majorType = majorType; + return this; + } + + public Builder subType(String subType) { + this.subType = subType; + return this; + } + + public Builder isSoftwareDevice(boolean isSoftwareDevice) { + this.isSoftwareDevice = isSoftwareDevice; + return this; + } + + public Builder streamDescriptors(List streamDescriptors) { + this.streamDescriptors = streamDescriptors; + return this; + } + + public CaptureManagerSource build() { + return new CaptureManagerSource(symbolicLink, deviceLink, friendlyName, majorType, subType, isSoftwareDevice, streamDescriptors); + } + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerStreamDescriptor.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerStreamDescriptor.java new file mode 100644 index 0000000..2b4edb5 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/CaptureManagerStreamDescriptor.java @@ -0,0 +1,164 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model; + +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.util.Collections; +import java.util.List; + +public class CaptureManagerStreamDescriptor { + + private final String majorType; + private final String majorTypeGUID; + private final String frameSourceTypes; + private final String categoryName; + private final String categoryGUID; + private final String streamName; + private final List mediaTypes; + + public CaptureManagerStreamDescriptor(String majorType, String majorTypeGUID, String frameSourceTypes, String categoryName, String categoryGUID, String streamName, List mediaTypes) { + this.majorType = Utils.trimToEmpty(majorType); + this.majorTypeGUID = Utils.trimToEmpty(majorTypeGUID); + this.frameSourceTypes = Utils.trimToEmpty(frameSourceTypes); + this.categoryName = Utils.trimToEmpty(categoryName); + this.categoryGUID = Utils.trimToEmpty(categoryGUID); + this.streamName = Utils.trimToEmpty(streamName); + this.mediaTypes = Utils.coalesce(mediaTypes, Collections.emptyList()); + } + + public String getMajorType() { + return majorType; + } + + public String getMajorTypeGUID() { + return majorTypeGUID; + } + + public String getFrameSourceTypes() { + return frameSourceTypes; + } + + public String getCategoryName() { + return categoryName; + } + + public String getCategoryGUID() { + return categoryGUID; + } + + public String getStreamName() { + return streamName; + } + + public List getMediaTypes() { + return mediaTypes; + } + + public boolean isVideoStream() { + return "MFMediaType_Video".equalsIgnoreCase(majorType); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CaptureManagerStreamDescriptor that = (CaptureManagerStreamDescriptor) o; + + if (!majorType.equals(that.majorType)) { + return false; + } + if (!majorTypeGUID.equals(that.majorTypeGUID)) { + return false; + } + if (!frameSourceTypes.equals(that.frameSourceTypes)) { + return false; + } + if (!categoryName.equals(that.categoryName)) { + return false; + } + if (!categoryGUID.equals(that.categoryGUID)) { + return false; + } + if (!streamName.equals(that.streamName)) { + return false; + } + return mediaTypes.equals(that.mediaTypes); + } + + @Override + public int hashCode() { + int result = majorType.hashCode(); + result = 31 * result + majorTypeGUID.hashCode(); + result = 31 * result + frameSourceTypes.hashCode(); + result = 31 * result + categoryName.hashCode(); + result = 31 * result + categoryGUID.hashCode(); + result = 31 * result + streamName.hashCode(); + result = 31 * result + mediaTypes.hashCode(); + return result; + } + + @Override + public String toString() { + return "CaptureManagerStreamDescriptor{" + "majorType=" + majorType + ", majorTypeGUID=" + majorTypeGUID + ", frameSourceTypes=" + frameSourceTypes + ", categoryName=" + categoryName + ", categoryGUID=" + categoryGUID + ", streamName=" + streamName + ", mediaTypes=" + mediaTypes + '}'; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + + private String majorType; + private String majorTypeGUID; + private String frameSourceTypes; + private String categoryName; + private String categoryGUID; + private String streamName; + private List mediaTypes; + + private Builder() { + } + + public Builder majorType(String majorType) { + this.majorType = majorType; + return this; + } + + public Builder majorTypeGUID(String majorTypeGUID) { + this.majorTypeGUID = majorTypeGUID; + return this; + } + + public Builder frameSourceTypes(String frameSourceTypes) { + this.frameSourceTypes = frameSourceTypes; + return this; + } + + public Builder categoryName(String categoryName) { + this.categoryName = categoryName; + return this; + } + + public Builder categoryGUID(String categoryGUID) { + this.categoryGUID = categoryGUID; + return this; + } + + public Builder streamName(String streamName) { + this.streamName = streamName; + return this; + } + + public Builder mediaTypes(List mediaTypes) { + this.mediaTypes = mediaTypes; + return this; + } + + public CaptureManagerStreamDescriptor build() { + return new CaptureManagerStreamDescriptor(majorType, majorTypeGUID, frameSourceTypes, categoryName, categoryGUID, streamName, mediaTypes); + } + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/parser/CaptureManagerModelXMLParser.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/parser/CaptureManagerModelXMLParser.java new file mode 100644 index 0000000..f8db875 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/parser/CaptureManagerModelXMLParser.java @@ -0,0 +1,422 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model.parser; + +import com.fasterxml.aalto.AsyncByteArrayFeeder; +import com.fasterxml.aalto.AsyncXMLInputFactory; +import com.fasterxml.aalto.AsyncXMLStreamReader; +import com.fasterxml.aalto.stax.InputFactoryImpl; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerMediaType; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerStreamDescriptor; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.SinkValuePart; +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import javax.xml.stream.XMLStreamException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CaptureManagerModelXMLParser { + + private static final Logger LOG = LoggerFactory.getLogger(CaptureManagerModelXMLParser.class); + + public List parseVideoSources(final String xml) throws XMLStreamException { + final List list = new ArrayList<>(); + + final AsyncXMLInputFactory inputF = new InputFactoryImpl(); // sub-class of XMLStreamReader2 + final AsyncXMLStreamReader parser = inputF.createAsyncFor(xml.getBytes(StandardCharsets.UTF_8)); + + try { + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "root")) { + break; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT && parser.hasName()) { + final String name = parser.getLocalName(); + + if ("Source".equalsIgnoreCase(name)) { + parseSource(parser).ifPresent(list::add); + } + } + } + } finally { + parser.close(); + } + + return list.stream() + .filter(d -> !d.isSoftwareDevice()) + .filter(CaptureManagerSource::isVideoDevice) + .collect(Collectors.toList()); + } + + private Optional parseSource(final AsyncXMLStreamReader parser) throws XMLStreamException { + LOG.debug("Parse source - start"); + final CaptureManagerSource.Builder sourceBuilder = CaptureManagerSource.builder(); + final List streams = new ArrayList<>(); + + int nestingCount = 0; + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "source")) { + return Optional.empty(); + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + sourceBuilder.streamDescriptors(streams); + + if (Utils.containsIgnoreCase(sourceBuilder.getFriendlyName(), "Virtual Camera") + || Utils.containsIgnoreCase(sourceBuilder.getSymbolicLink(), "@device:sw:")) { + sourceBuilder.isSoftwareDevice(true);//OBS Virtual Camera presents itself as hardware device + } + + LOG.debug("Parse source - ok"); + return Optional.of(sourceBuilder.build()); + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + + if (parser.hasName()) { + final String name = parser.getLocalName(); + + if ("Source.Attributes".equalsIgnoreCase(name)) { + parseSourceAttributes(parser, sourceBuilder); + nestingCount--; + } else if ("StreamDescriptor".equalsIgnoreCase(name)) { + parseStreamDescriptor(parser).ifPresent(streams::add); + nestingCount--; + } + } + } + } + + LOG.warn("Parse source - no data"); + return Optional.empty(); + } + + private void parseSourceAttributes(final AsyncXMLStreamReader parser, final CaptureManagerSource.Builder sourceBuilder) throws XMLStreamException { + int nestingCount = 0; + String attributeName = "?"; + + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "source attributes")) { + return; + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + return; + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + + if (parser.hasName()) { + final String name = parser.getLocalName(); + + if ("Attribute".equalsIgnoreCase(name)) { + attributeName = parser.getAttributeValue(null, "Name"); + } else if ("SingleValue".equalsIgnoreCase(name)) { + final String value = parser.getAttributeValue(null, "Value"); + switch (attributeName) { + case "MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK": + sourceBuilder.symbolicLink(value); + break; + case "CM_DEVICE_LINK": + sourceBuilder.deviceLink(value); + break; + case "MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME": + sourceBuilder.friendlyName(value); + break; + case "MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_HW_SOURCE": + sourceBuilder.isSoftwareDevice(!Utils.containsIgnoreCase(value, "hardware")); + break; + } + } else if ("ValuePart".equalsIgnoreCase(name)) { + final String title = parser.getAttributeValue(null, "Title"); + final String value = parser.getAttributeValue(null, "Value"); + + switch (title) { + case "MajorType": + sourceBuilder.majorType(value); + break; + case "SubType": + sourceBuilder.subType(value); + break; + } + } + } + } + } + } + + private Optional parseStreamDescriptor(final AsyncXMLStreamReader parser) throws XMLStreamException { + LOG.debug("Parse stream descriptor - start"); + final CaptureManagerStreamDescriptor.Builder streamBuilder = CaptureManagerStreamDescriptor.builder(); + final List mediaTypes = new ArrayList<>(); + + final String majorType = parser.getAttributeValue(null, "MajorType"); + final String majorTypeGUID = parser.getAttributeValue(null, "MajorTypeGUID"); + + streamBuilder.majorType(majorType); + streamBuilder.majorTypeGUID(majorTypeGUID); + + int nestingCount = 0; + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "stream descriptor")) { + return Optional.empty(); + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + streamBuilder.mediaTypes(mediaTypes); + LOG.debug("Parse stream descriptor - ok"); + return Optional.of(streamBuilder.build()); + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + + if (parser.hasName()) { + final String name = parser.getLocalName(); + + if ("MediaType".equalsIgnoreCase(name)) { + parseMediaType(parser).ifPresent(mediaTypes::add); + nestingCount--; + } + } + } + } + + LOG.warn("Parse stream descriptor - no data"); + return Optional.empty(); + } + + private Optional parseMediaType(final AsyncXMLStreamReader parser) throws XMLStreamException { + LOG.debug("Parse media type - start"); + final CaptureManagerMediaType.Builder mediaTypeBuilder = CaptureManagerMediaType.builder(); + + String mediaTypeItemName = "?"; + int nestingCount = 0; + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "media type")) { + return Optional.empty(); + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + final CaptureManagerMediaType mediaType = mediaTypeBuilder.build(); + LOG.debug("Parse media type - correct - subtype = {}", mediaType.getSubType()); + return Optional.of(mediaType); + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + + if (parser.hasName()) { + final String name = parser.getLocalName(); + + if ("MediaTypeItem".equalsIgnoreCase(name)) { + mediaTypeItemName = parser.getAttributeValue(null, "Name"); + } else if ("SingleValue".equalsIgnoreCase(name)) { + final String value = parser.getAttributeValue(null, "Value"); + switch (mediaTypeItemName) { + case "MF_MT_MAJOR_TYPE": + mediaTypeBuilder.majorType(value); + break; + case "MF_MT_SUBTYPE": + mediaTypeBuilder.subType(value); + break; + } + } else if ("ValuePart".equalsIgnoreCase(name)) { + final String title = parser.getAttributeValue(null, "Title"); + final String value = parser.getAttributeValue(null, "Value"); + + if ("MF_MT_FRAME_SIZE".equalsIgnoreCase(mediaTypeItemName)) { + switch (title) { + case "Width": + mediaTypeBuilder.width(Integer.parseInt(value)); + break; + case "Height": + mediaTypeBuilder.height(Integer.parseInt(value)); + break; + } + } + } + } + } + } + + LOG.warn("Parse media type - no data"); + return Optional.empty(); + } + + public List parseSinkFactories(final String xml) throws XMLStreamException { + final List list = new ArrayList<>(); + + final AsyncXMLInputFactory inputF = new InputFactoryImpl(); // sub-class of XMLStreamReader2 + final AsyncXMLStreamReader parser = inputF.createAsyncFor(xml.getBytes(StandardCharsets.UTF_8)); + + try { + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "root")) { + break; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT && parser.hasName()) { + final String name = parser.getLocalName(); + + if ("SinkFactory".equalsIgnoreCase(name)) { + parseSinkFactory(parser).ifPresent(list::add); + } + } + } + } finally { + parser.close(); + } + + return list; + } + + private Optional parseSinkFactory(final AsyncXMLStreamReader parser) throws XMLStreamException { + LOG.debug("Parse sink factory - start"); + final CaptureManagerSinkFactory.Builder sinkFactoryBuilder = CaptureManagerSinkFactory.builder(); + final List parts = new ArrayList<>(); + + sinkFactoryBuilder.name( + parser.getAttributeValue(null, "Name") + ); + sinkFactoryBuilder.guid( + parser.getAttributeValue(null, "GUID") + ); + sinkFactoryBuilder.title( + parser.getAttributeValue(null, "Title") + ); + + int nestingCount = 0; + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "sink factory")) { + return Optional.empty(); + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + sinkFactoryBuilder.valueParts(parts); + LOG.debug("Parse sink factory - ok"); + return Optional.of(sinkFactoryBuilder.build()); + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + + if (parser.hasName()) { + final String name = parser.getLocalName(); + + if ("ValuePart".equalsIgnoreCase(name)) { + parseSinkValuePart(parser).ifPresent(parts::add); + nestingCount--; + } + } + } + } + + LOG.warn("Parse sink factory - no data"); + return Optional.empty(); + } + + private Optional parseSinkValuePart(final AsyncXMLStreamReader parser) throws XMLStreamException { + LOG.debug("Parse sink value part - start"); + final SinkValuePart.Builder partBuilder = SinkValuePart.builder(); + + partBuilder.title( + parser.getAttributeValue(null, "Title") + ); + partBuilder.value( + parser.getAttributeValue(null, "Value") + ); + partBuilder.mime( + parser.getAttributeValue(null, "MIME") + ); + partBuilder.description( + parser.getAttributeValue(null, "Description") + ); + partBuilder.maxPortCount( + Integer.parseInt(parser.getAttributeValue(null, "MaxPortCount")) + ); + partBuilder.guid( + parser.getAttributeValue(null, "GUID") + ); + + int nestingCount = 0; + while (parser.hasNext()) { + final int type = parser.next(); + + if (isPrematureEnd(parser, type, "sink value part")) { + return Optional.empty(); + } + + if (type == AsyncXMLStreamReader.END_ELEMENT) { + if (nestingCount <= 0) { + LOG.debug("Parse sink value part - ok"); + return Optional.of(partBuilder.build()); + } + + nestingCount--; + } + + if (type == AsyncXMLStreamReader.START_ELEMENT) { + nestingCount++; + } + } + + LOG.warn("Parse sink value part - no data"); + return Optional.empty(); + } + + private boolean isPrematureEnd(final AsyncXMLStreamReader parser, final int type, final String where) { + if (type == AsyncXMLStreamReader.EVENT_INCOMPLETE) { + parser.getInputFeeder().endOfInput(); + } + + final boolean result = type == AsyncXMLStreamReader.EVENT_INCOMPLETE || type == AsyncXMLStreamReader.END_DOCUMENT; + + if (result) { + LOG.debug("Premature end of XML stream at {}. Event type = {}", where, type); + } + + return result; + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/CaptureManagerSinkFactory.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/CaptureManagerSinkFactory.java new file mode 100644 index 0000000..fa96dcf --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/CaptureManagerSinkFactory.java @@ -0,0 +1,112 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks; + +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.util.Collections; +import java.util.List; + +public class CaptureManagerSinkFactory { + + private final String name; + private final String title; + private final String guid; + private final List valueParts; + + public CaptureManagerSinkFactory(String name, String title, String guid, List valueParts) { + this.name = Utils.trimToEmpty(name); + this.title = Utils.trimToEmpty(title); + this.guid = Utils.trimToEmpty(guid); + this.valueParts = Utils.coalesce(valueParts, Collections.emptyList()); + } + + public String getName() { + return name; + } + + public String getTitle() { + return title; + } + + public String getGuid() { + return guid; + } + + public List getValueParts() { + return valueParts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CaptureManagerSinkFactory that = (CaptureManagerSinkFactory) o; + + if (!name.equals(that.name)) { + return false; + } + if (!title.equals(that.title)) { + return false; + } + if (!guid.equals(that.guid)) { + return false; + } + return valueParts.equals(that.valueParts); + } + + @Override + public int hashCode() { + int result = name.hashCode(); + result = 31 * result + title.hashCode(); + result = 31 * result + guid.hashCode(); + result = 31 * result + valueParts.hashCode(); + return result; + } + + @Override + public String toString() { + return "CaptureManagerSinkFactory{" + "name=" + name + ", title=" + title + ", guid=" + guid + ", valueParts=" + valueParts + '}'; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + + private String name; + private String title; + private String guid; + private List valueParts; + + private Builder() { + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder title(String title) { + this.title = title; + return this; + } + + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + public Builder valueParts(List valueParts) { + this.valueParts = valueParts; + return this; + } + + public CaptureManagerSinkFactory build() { + return new CaptureManagerSinkFactory(name, title, guid, valueParts); + } + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/SinkValuePart.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/SinkValuePart.java new file mode 100644 index 0000000..97e247f --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/model/sinks/SinkValuePart.java @@ -0,0 +1,142 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks; + +import com.github.eduramiba.webcamcapture.utils.Utils; + +public class SinkValuePart { + + private final String title; + private final String value; + private final String mime; + private final String description; + private final int maxPortCount; + private final String guid; + + public SinkValuePart(String title, String value, String mime, String description, int maxPortCount, String guid) { + this.title = Utils.trimToEmpty(title); + this.value = Utils.trimToEmpty(value); + this.mime = Utils.trimToEmpty(mime); + this.description = Utils.trimToEmpty(description); + this.maxPortCount = maxPortCount; + this.guid = Utils.trimToEmpty(guid); + } + + public String getTitle() { + return title; + } + + public String getValue() { + return value; + } + + public String getMime() { + return mime; + } + + public String getDescription() { + return description; + } + + public int getMaxPortCount() { + return maxPortCount; + } + + public String getGuid() { + return guid; + } + + @Override + public String toString() { + return "SinkValuePart{" + "title=" + title + ", value=" + value + ", mime=" + mime + ", description=" + description + ", maxPortCount=" + maxPortCount + ", guid=" + guid + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + SinkValuePart valuePart = (SinkValuePart) o; + + if (maxPortCount != valuePart.maxPortCount) { + return false; + } + if (!title.equals(valuePart.title)) { + return false; + } + if (!value.equals(valuePart.value)) { + return false; + } + if (!mime.equals(valuePart.mime)) { + return false; + } + if (!description.equals(valuePart.description)) { + return false; + } + return guid.equals(valuePart.guid); + } + + @Override + public int hashCode() { + int result = title.hashCode(); + result = 31 * result + value.hashCode(); + result = 31 * result + mime.hashCode(); + result = 31 * result + description.hashCode(); + result = 31 * result + maxPortCount; + result = 31 * result + guid.hashCode(); + return result; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + + private String title; + private String value; + private String mime; + private String description; + private int maxPortCount; + private String guid; + + private Builder() { + } + + public Builder title(String title) { + this.title = title; + return this; + } + + public Builder value(String value) { + this.value = value; + return this; + } + + public Builder mime(String mime) { + this.mime = mime; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder maxPortCount(int maxPortCount) { + this.maxPortCount = maxPortCount; + return this; + } + + public Builder guid(String guid) { + this.guid = guid; + return this; + } + + public SinkValuePart build() { + return new SinkValuePart(title, value, mime, description, maxPortCount, guid); + } + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/AbstractCaptureManagerSessionControl.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/AbstractCaptureManagerSessionControl.java new file mode 100644 index 0000000..fbed2c0 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/AbstractCaptureManagerSessionControl.java @@ -0,0 +1,49 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.session; + +import capturemanager.interfaces.ISession; +import capturemanager.interfaces.IUpdateStateListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class AbstractCaptureManagerSessionControl implements CaptureManagerSessionControl, IUpdateStateListener { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractCaptureManagerSessionControl.class); + + public static final int UnknownEvent = (0); + public static final int Error = (1); + public static final int Status_Error = (2); + public static final int Execution_Error = (3); + public static final int ItIsReadyToStart = (4); + public static final int ItIsStarted = (5); + public static final int ItIsPaused = (6); + public static final int ItIsStopped = (7); + public static final int ItIsEnded = (8); + public static final int ItIsClosed = (9); + public static final int VideoCaptureDeviceRemoved = (10); + + protected ISession mISession = null; + + @Override + public void start() { + if (mISession == null) + return; + + mISession.startSession(0, "{00000000-0000-0000-0000-000000000000}"); + } + + @Override + public void stop() { + if (mISession == null) + return; + + mISession.stopSession(); + + mISession.closeSession(); + } + + @Override + public void invoke(int aCallbackEventCode, int aSessionDescriptor) { + LOG.info("invoke with (aCallbackEventCode, aSessionDescriptor) = ({}, {})", aCallbackEventCode, aSessionDescriptor); + } + +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/CaptureManagerSessionControl.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/CaptureManagerSessionControl.java new file mode 100644 index 0000000..beb9fb8 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/CaptureManagerSessionControl.java @@ -0,0 +1,23 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.session; + +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerMediaType; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerStreamDescriptor; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import java.awt.*; +import java.util.List; + +public interface CaptureManagerSessionControl { + + boolean init( + final CaptureManagerSource source, + final CaptureManagerStreamDescriptor stream, + final CaptureManagerMediaType mediaType, + final List sinkFactories, + Component aGraphicComponent + ); + + void start(); + + void stop(); +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/impl/CallSessionControl.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/impl/CallSessionControl.java new file mode 100644 index 0000000..95a80ca --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/capturemanager/session/impl/CallSessionControl.java @@ -0,0 +1,266 @@ +package com.github.eduramiba.webcamcapture.drivers.capturemanager.session.impl; + +import capturemanager.classes.CaptureManager; +import capturemanager.interfaces.*; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerMediaType; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerSource; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.CaptureManagerStreamDescriptor; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.CaptureManagerSinkFactory; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.model.sinks.SinkValuePart; +import com.github.eduramiba.webcamcapture.drivers.capturemanager.session.AbstractCaptureManagerSessionControl; +import com.github.eduramiba.webcamcapture.utils.Utils; +import java.awt.*; +import java.awt.image.*; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CallSessionControl extends AbstractCaptureManagerSessionControl { + + private static final Logger LOG = LoggerFactory.getLogger(CallSessionControl.class); + + private static final String MFMediaType_Video = "{73646976-0000-0010-8000-00AA00389B71}"; + + private static final String MFVideoFormat_RGB32 = "{00000016-0000-0010-8000-00AA00389B71}"; + private static final String MFVideoFormat_DEFAULT = MFVideoFormat_RGB32; + + private ByteBuffer directBuffer = null; + private byte[] rawData = null; + + private ISampleGrabberCall mISampleGrabberCall = null; + + private Component displayPanel = null; + + private BufferedImage mImage = null; + + private SampleModel sampleModel = null; + + private int mVideoWidth = 0; + + private int mVideoHeight = 0; + + @Override + public boolean init( + final CaptureManagerSource source, + final CaptureManagerStreamDescriptor stream, + final CaptureManagerMediaType mediaType, + final List sinkFactories, + Component component + ) { + displayPanel = component; + + final int streamIndex = source.getStreamDescriptors().indexOf(stream); + + if (streamIndex < 0) { + LOG.error("Could not find stream = {} in source = {}", stream, source); + return false; + } + + final int mediaTypeIndex = stream.getMediaTypes().indexOf(mediaType); + + if (mediaTypeIndex < 0) { + LOG.error("Could not find media type = {} in stream {}", mediaType, stream); + return false; + } + + final ISourceControl sourceControl = CaptureManager.getInstance().getICaptureManagerControl().createSourceControl(); + + if (sourceControl == null) { + LOG.error("Could not create source control"); + return false; + } + + final ISinkControl sinkControl = CaptureManager.getInstance().getICaptureManagerControl().createSinkControl(); + + if (sinkControl == null) { + LOG.error("Could not create sink control"); + return false; + } + + final ISessionControl sessionControl = CaptureManager.getInstance().getICaptureManagerControl().createSessionControl(); + + if (sessionControl == null) { + LOG.error("Could not create session control"); + return false; + } + + final CaptureManagerSinkFactory sinkFactory = sinkFactories.stream() + .filter( + s -> + s.getGuid().equalsIgnoreCase("{759D24FF-C5D6-4B65-8DDF-8A2B2BECDE39}") + || Utils.containsIgnoreCase(s.getName(), "SampleGrabberCallSinkFactory") + ) + .findFirst() + .orElse(null); + + LOG.info("Sink factory: {}", sinkFactory); + + if (sinkFactory == null) { + LOG.error("Could not find SampleGrabberCallbackSinkFactory"); + return false; + } + + final SinkValuePart sinkValuePart = sinkFactory.getValueParts().stream() + .filter(s -> s.getValue().equalsIgnoreCase("PULL")) + .findFirst() + .orElse(null); + + if (sinkValuePart == null) { + LOG.error("Could not find sinkValuePart in sink factory = {}", sinkFactory); + } + + LOG.info("Sink value part = {}", sinkValuePart); + + final String sinkGUID = sinkFactory.getValueParts().stream().findFirst() + .map(SinkValuePart::getGuid) + .orElse(null); + + if (Utils.isBlank(sinkGUID)) { + LOG.error("Could not find valid value part GUID in sink factory = {}", sinkFactory); + } + + final ISampleGrabberCallSinkFactory sampleGrabberCallbackSinkFactory = sinkControl.createSampleGrabberCallSinkFactory( + sinkGUID + ); + + if (sampleGrabberCallbackSinkFactory == null) { + LOG.error("Could not create ISampleGrabberCallbackSinkFactory"); + return false; + } + + final int videoWidth = mediaType.getWidth(); + final int videoHeight = mediaType.getHeight(); + + final String videoFormat = MFVideoFormat_DEFAULT; + + final int stride = CaptureManager.getInstance().getICaptureManagerControl().getStrideForBitmapInfoHeader( + videoFormat, + videoWidth + ); + + final int sampleByteSize = Math.abs(stride) * videoWidth; + + directBuffer = ByteBuffer.allocateDirect(sampleByteSize); + rawData = new byte[sampleByteSize]; + + mVideoWidth = videoWidth; + mVideoHeight = videoHeight; + + mImage = new BufferedImage(mVideoWidth, mVideoHeight, BufferedImage.TYPE_INT_BGR); + + sampleModel = new ComponentSampleModel( + DataBuffer.TYPE_BYTE, mVideoWidth, mVideoHeight, 4, mVideoWidth * 4, + new int[]{2, 1, 0} // Try {1,2,3}, {3,2,1}, {0,1,2} + ); + + mISampleGrabberCall = sampleGrabberCallbackSinkFactory.createOutputNode( + MFMediaType_Video, + videoFormat, + sampleByteSize + ); + + + if (mISampleGrabberCall == null) { + LOG.error("Could not create ISampleGrabberCallback"); + return false; + } + final IStreamNode streamNode = mISampleGrabberCall.getStreamNode(); + + if (streamNode == null) { + LOG.error("Could not create streamNode"); + return false; + } + + final IStreamNode sourceNode = sourceControl.createSourceNode( + source.getSymbolicLink(), + streamIndex, + mediaTypeIndex, + streamNode + ); + + if (sourceNode == null) { + LOG.error("Could not create sourceNode"); + return false; + } + + final List lArrayPtrSourceNodesOfTopology = new ArrayList(); + + lArrayPtrSourceNodesOfTopology.add(sourceNode); + + mISession = sessionControl.createSession( + lArrayPtrSourceNodesOfTopology + ); + + if (mISession == null) { + LOG.error("Could not create session control last step"); + return false; + } + + mISession.addUpdateStateListener(this); + + LOG.error("Successfully created CallSessionControl"); + + return true; + } + + private final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + + public static final int MAX_FPS = 60; + public static final int PERIOD_MILLIS = 1000 / MAX_FPS; + + @Override + public void start() { + super.start(); + + executorService.scheduleAtFixedRate(() -> { + final int sizeData = mISampleGrabberCall.readData(directBuffer); + if (sizeData > 0) { + drawImage(directBuffer, sizeData); + } + }, 0, PERIOD_MILLIS, TimeUnit.MILLISECONDS); + } + + private void drawImage(final ByteBuffer byteBuffer, final int sizeData) { + byteBuffer.position(0); + byteBuffer.get(rawData, 0, sizeData); + + final DataBuffer buffer = new DataBufferByte(rawData, rawData.length); + final Raster raster = Raster.createRaster(sampleModel, buffer, null); + mImage.setData(raster); + + final double p1 = (double) displayPanel.getHeight() / (double) displayPanel.getWidth(); + final double p2 = (double) mImage.getHeight() / (double) mImage.getWidth(); + + if (p1 >= p2) { + double height = (double) displayPanel.getWidth() * p2; + + double heightShift = ((double) displayPanel.getHeight() - height) * 0.5; + synchronized (this) { + displayPanel.getGraphics().drawImage(mImage, 0, (int) heightShift, displayPanel.getWidth(), + (int) (height + heightShift), 0, 0, mImage.getWidth(), mImage.getHeight(), null); + } + } else { + double width = (double) displayPanel.getHeight() * (1 / p2); + + double widthShift = ((double) displayPanel.getWidth() - width) * 0.5; + + synchronized (this) { + displayPanel.getGraphics().drawImage(mImage, (int) widthShift, 0, (int) (width + widthShift), + displayPanel.getHeight(), 0, 0, mImage.getWidth(), mImage.getHeight(), null); + } + } + } + + + @Override + public void stop() { + super.stop(); + executorService.shutdownNow(); + } + +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/utils/Pair.java b/src/main/java/com/github/eduramiba/webcamcapture/utils/Pair.java new file mode 100644 index 0000000..1c73dfc --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/utils/Pair.java @@ -0,0 +1,55 @@ +package com.github.eduramiba.webcamcapture.utils; + +import java.util.Objects; + +public class Pair { + + private final T1 left; + private final T2 right; + + public Pair(T1 left, T2 right) { + this.left = left; + this.right = right; + } + + public T1 getLeft() { + return left; + } + + public T2 getRight() { + return right; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + Objects.hashCode(this.left); + hash = 59 * hash + Objects.hashCode(this.right); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Pair other = (Pair) obj; + if (!Objects.equals(this.left, other.left)) { + return false; + } + if (!Objects.equals(this.right, other.right)) { + return false; + } + return true; + } + + public static Pair of(T1 left, T2 right) { + return new Pair<>(left, right); + } +} diff --git a/src/main/java/com/github/eduramiba/webcamcapture/utils/Utils.java b/src/main/java/com/github/eduramiba/webcamcapture/utils/Utils.java new file mode 100644 index 0000000..2d7d641 --- /dev/null +++ b/src/main/java/com/github/eduramiba/webcamcapture/utils/Utils.java @@ -0,0 +1,200 @@ +package com.github.eduramiba.webcamcapture.utils; + +public class Utils { + + public static T coalesce(T o1, T o2) { + if (o1 == null) { + return o2; + } + + return o1; + } + + public static T coalesce(T o1, T o2, T o3) { + if (o1 == null) { + if (o2 == null) { + return o3; + } + + return o2; + } + + return o1; + } + + public static T coalesce(T... objects) { + for (T object : objects) { + if (object != null) { + return object; + } + } + + return null; + } + + ////// + //The following are copied from apache commons-lang3 to avoid adding a dependency just for a few functions: + /** + *

+ * Checks if CharSequence contains a search CharSequence irrespective of case, handling {@code null}. Case-insensitivity is defined as by {@link String#equalsIgnoreCase(String)}. + * + *

+ * A {@code null} CharSequence will return {@code false}.

+ * + *
+     * Utils.containsIgnoreCase(null, *) = false
+     * Utils.containsIgnoreCase(*, null) = false
+     * Utils.containsIgnoreCase("", "") = true
+     * Utils.containsIgnoreCase("abc", "") = true
+     * Utils.containsIgnoreCase("abc", "a") = true
+     * Utils.containsIgnoreCase("abc", "z") = false
+     * Utils.containsIgnoreCase("abc", "A") = true
+     * Utils.containsIgnoreCase("abc", "Z") = false
+     * 
+ * + * @param str the CharSequence to check, may be null + * @param searchStr the CharSequence to find, may be null + * @return true if the CharSequence contains the search CharSequence irrespective of case or false if not or {@code null} string input + * @since 3.0 Changed signature from containsIgnoreCase(String, String) to containsIgnoreCase(CharSequence, CharSequence) + */ + public static boolean containsIgnoreCase(final CharSequence str, final CharSequence searchStr) { + if (str == null || searchStr == null) { + return false; + } + final int len = searchStr.length(); + final int max = str.length() - len; + for (int i = 0; i <= max; i++) { + if (regionMatches(str, true, i, searchStr, 0, len)) { + return true; + } + } + return false; + } + + /** + *

+ * Removes control characters (char <= 32) from both ends of this String returning an empty String ("") if the String is empty ("") after the trim or if it is {@code null}. + * + *

+ * The String is trimmed using {@link String#trim()}. Trim removes start and end characters <= 32. To strip whitespace use {@link #stripToEmpty(String)}.

+ * + *
+     * Utils.trimToEmpty(null)          = ""
+     * Utils.trimToEmpty("")            = ""
+     * Utils.trimToEmpty("     ")       = ""
+     * Utils.trimToEmpty("abc")         = "abc"
+     * Utils.trimToEmpty("    abc    ") = "abc"
+     * 
+ * + * @param str the String to be trimmed, may be null + * @return the trimmed String, or an empty String if {@code null} input + * @since 2.0 + */ + public static String trimToEmpty(final String str) { + return str == null ? "" : str.trim(); + } + + /** + * Gets a CharSequence length or {@code 0} if the CharSequence is {@code null}. + * + * @param cs a CharSequence or {@code null} + * @return CharSequence length or {@code 0} if the CharSequence is {@code null}. + * @since 2.4 + * @since 3.0 Changed signature from length(String) to length(CharSequence) + */ + public static int length(final CharSequence cs) { + return cs == null ? 0 : cs.length(); + } + + /** + *

+ * Checks if a CharSequence is empty (""), null or whitespace only.

+ * + *

+ * Whitespace is defined by {@link Character#isWhitespace(char)}.

+ * + *
+     * Utils.isBlank(null)      = true
+     * Utils.isBlank("")        = true
+     * Utils.isBlank(" ")       = true
+     * Utils.isBlank("bob")     = false
+     * Utils.isBlank("  bob  ") = false
+     * 
+ * + * @param cs the CharSequence to check, may be null + * @return {@code true} if the CharSequence is null, empty or whitespace only + * @since 2.0 + * @since 3.0 Changed signature from isBlank(String) to isBlank(CharSequence) + */ + public static boolean isBlank(final CharSequence cs) { + final int strLen = length(cs); + if (strLen == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if (!Character.isWhitespace(cs.charAt(i))) { + return false; + } + } + return true; + } + + /** + * Green implementation of regionMatches. + * + * @param cs the {@code CharSequence} to be processed + * @param ignoreCase whether or not to be case insensitive + * @param thisStart the index to start on the {@code cs} CharSequence + * @param substring the {@code CharSequence} to be looked for + * @param start the index to start on the {@code substring} CharSequence + * @param length character length of the region + * @return whether the region matched + */ + static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int thisStart, + final CharSequence substring, final int start, final int length) { + if (cs instanceof String && substring instanceof String) { + return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length); + } + int index1 = thisStart; + int index2 = start; + int tmpLen = length; + + // Extract these first so we detect NPEs the same as the java.lang.String version + final int srcLen = cs.length() - thisStart; + final int otherLen = substring.length() - start; + + // Check for invalid parameters + if (thisStart < 0 || start < 0 || length < 0) { + return false; + } + + // Check that the regions are long enough + if (srcLen < length || otherLen < length) { + return false; + } + + while (tmpLen-- > 0) { + final char c1 = cs.charAt(index1++); + final char c2 = substring.charAt(index2++); + + if (c1 == c2) { + continue; + } + + if (!ignoreCase) { + return false; + } + + // The real same check as in String.regionMatches(): + final char u1 = Character.toUpperCase(c1); + final char u2 = Character.toUpperCase(c2); + if (u1 != u2 && Character.toLowerCase(u1) != Character.toLowerCase(u2)) { + return false; + } + } + + return true; + } + + ////// +}