in

andy vt's tools & blog

automating lazy

This Blog

Syndication

andy vt's blog

November 2011 - Posts

  • Loading Unregistered COM objects with .NET

    COM is very convenient, but sometimes it isn't desirable (or possible) to register a component for use in an application.  Geraint Davies provided a solution for C++ developers, but since I generally try to avoid writing unmanaged code it was necessary to figure out how to translate his e.g. into C#.  The full source for loading unregistered COM objects and managing lifecycle is available in SVN, but since it took me a little while to figure out that the trick to making it go was using "GetDelegateForFunctionPointer" the translated method is below.

    Enjoy.

     

    //http://www.gdcl.co.uk/2011/June/UnregisteredFilters.htm
    public object CreateObjectFromPath(string dllPath, Guid clsid, bool setSearchPath)
    {
        object createdObject = null;
        IntPtr lib = IntPtr.Zero;
    
        if (_libsLoaded.ContainsKey(dllPath))
            lib = _libsLoaded[dllPath];
        else
        {
            //some dlls have external dependancies, setting the search path to its location should assist with this
            if (setSearchPath)
            {
                NativeMethods.SetDllDirectory(Path.GetDirectoryName(dllPath));
            }
    
            lib = NativeMethods.LoadLibrary(dllPath);
    
            if (setSearchPath)
            {
                NativeMethods.SetDllDirectory(null);
            }
        }
    
        if (lib != IntPtr.Zero)
        {
            //we need to cache the handle so the COM object will work and we can clean up later
            _libsLoaded[dllPath] = lib;
            IntPtr fnP = NativeMethods.GetProcAddress(lib, "DllGetClassObject");
            if (fnP != IntPtr.Zero)
            {
                DllGETCLASSOBJECTInvoker fn = Marshal.GetDelegateForFunctionPointer(fnP, typeof(DllGETCLASSOBJECTInvoker)) as DllGETCLASSOBJECTInvoker;
    
                object pUnk = null;
                int hr = fn(clsid, IID_IUnknown, out pUnk);
                if (hr >= 0)
                {
                    IClassFactory pCF = pUnk as IClassFactory;
                    if (pCF != null)
                    {
                        hr = pCF.CreateInstance(null, IID_IUnknown, out createdObject);
                    }
                }
            }
            else
            {
                throw new Win32Exception();
            }
        }
        else
        {
            throw new Win32Exception();
        }
    
        return createdObject;
    }

     

  • DTB - 1.2.2.5

    Version 1.2.2.5
    - Add "Export JRiver MC XML Sidecar" action to advanced actions

    bin

  • EVRCapture

    EVRCapture is a POC application that demonstrates the following DirectShow concepts for working with capture devices:

    1. Use the PSI Parser filter to configure the MPEG-2 Demultiplexer both initially and as the media type changes
    2. Split output stream with for display and file capture
    3. Build a capture graph configuring crossbars and capture/encoder filters (Hauppauge Colossus and HD PVR are demonstrated).
    4. Get screen captures from the EVR

    source

  • SageDCT 2.1.7

    2.1.1
    - Additional PBDA Capture logging
    - Add shortcut to Start menu from x64 installer

    2.1.2
    - Add more PBDA Capture logging

    2.1.3
    - More logging
    - Potential workaround for missing sink

    2.1.4
    - Standby support for PBDA capture

    2.1.5
    - Add a check for discovered v. assigned tuners
    - encode_digital_tv_as_program_stream setting is set according to recording preference
    - encoder generation page displays a more descriptive name for tuners
    - PBDA capture method will check for a successful recording using file size before returning

    2.1.6
    - Better object cleanup
    - Better error handling during PBDA capture cleanup
    - Log skipped duplicate channels
    - UPnP capture method will check for a successful recording using file size before returning 

    2.1.7
    - Recycle PBDA Tuner when the tuner fails after a configurable number of times (default is 2)
    - Delay graph building for a configurable period (default is 30 seconds)

    x86 | x64

  • Installing AVIVO

    AVIVO has been rebranded, so it's now called "AMD Media Codec Pack".

    1) Download it
    2) Run it to extract the contents. Pay attention to where they go (C:\ATI\Support\11-10_vista_win7_32-64_xcode\Packages\Apps)
    3) Cancel the installer if you're not using an AMD GPU
    4) Navigate to the location noted in #2 and select the correct version of AVIVO for your platform, open the directory, and run the installer
    5) Don't panic when you see this error message:

    6) Open an elevated cmd prompt and navigate to "C:\Program Files\Common Files\ATI Technologies\Multimedia"

    7) regsvr32 the appropriate atimpenc dll for your platform
    8) If the regsvr32 files, you probably don't have the necessary Visual Studio runtime installed. It looks like these are also in the folder from #2, but I'd go grab the latest VS2010 rev from MS.
    Posted Nov 01 2011, 06:49 PM by babgvant with 1 comment(s)
    Filed under:
  • SageDCT 2.1

    2.1
    - Add option for PBDA base DCT recording (experimental) requires AVIVO MPEG muxer specific to the PC's platform to be installed
    - Refactored capture support to enable different (i.e. non-UPnP based) methods for interacting with the DCT
    - Installer no longer starts SageDCT service
    - Change RTP setup sequence to fix a potential race condition on some DCT
    - Add option to delay RTP Play command if more time is required to setup RTP sequence
    - Add x64 version (PDBA capture is platform specific)

    x86 | x64

@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems