| 1 | /* BoCA - BonkEnc Component Architecture |
| 2 | * Copyright (C) 2007-2015 Robert Kausch <[email protected]> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation, either version 2 of |
| 7 | * the License, or (at your option) any later version. |
| 8 | * |
| 9 | * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR |
| 10 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 11 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ |
| 12 | |
| 13 | #include "dllinterface.h" |
| 14 | |
| 15 | WMCREATEWRITER ex_WMCreateWriter = NIL; |
| 16 | WMCREATEWRITERFILESINK ex_WMCreateWriterFileSink = NIL; |
| 17 | WMCREATEPROFILEMANAGER ex_WMCreateProfileManager = NIL; |
| 18 | |
| 19 | DynamicLoader *wmvcoredll = NIL; |
| 20 | |
| 21 | Bool LoadWMVCoreDLL() |
| 22 | { |
| 23 | wmvcoredll = new DynamicLoader("WMVCore"); |
| 24 | |
| 25 | ex_WMCreateWriter = (WMCREATEWRITER) wmvcoredll->GetFunctionAddress("WMCreateWriter"); |
| 26 | ex_WMCreateWriterFileSink = (WMCREATEWRITERFILESINK) wmvcoredll->GetFunctionAddress("WMCreateWriterFileSink"); |
| 27 | ex_WMCreateProfileManager = (WMCREATEPROFILEMANAGER) wmvcoredll->GetFunctionAddress("WMCreateProfileManager"); |
| 28 | |
| 29 | if (ex_WMCreateWriter == NIL || |
| 30 | ex_WMCreateWriterFileSink == NIL || |
| 31 | ex_WMCreateProfileManager == NIL) { FreeWMVCoreDLL(); return False; } |
| 32 | |
| 33 | return True; |
| 34 | } |
| 35 | |
| 36 | Void FreeWMVCoreDLL() |
| 37 | { |
| 38 | Object::DeleteObject(wmvcoredll); |
| 39 | |
| 40 | wmvcoredll = NIL; |
| 41 | } |