/////////////////////////////////////////////////////////////////////////////
// $Id: DSRend.idl,v 1.7 2002-11-14 19:02:08 tobbej Exp $
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2002 Torbjörn Jansson.  All rights reserved.
/////////////////////////////////////////////////////////////////////////////
//
//  This file is subject to the terms of the GNU General Public License as
//  published by the Free Software Foundation.  A copy of this license is
//  included with this software distribution in the file COPYING.  If you
//  do not have a copy, you may obtain a copy by writing to the Free
//  Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details
/////////////////////////////////////////////////////////////////////////////

/**
 * @file DSRend.idl IDL source for DSRend.dll.
 * This file will be processed by the MIDL tool to
 * produce the type library (DSRend.tlb) and marshalling code.
 */

import "oaidl.idl";
import "ocidl.idl";
import "strmif.idl";    //IMediaSample definition
    
    typedef enum 
    {
        BUFFER_FLAGS_FIELD_UNKNOWN=0x00000000,
        BUFFER_FLAGS_FIELD_ODD=0x00000001,
        BUFFER_FLAGS_FIELD_EVEN=0x00000002
    }BUFFER_FLAGS;

    [
        helpstring("FieldBuffer structure")
    ]
    typedef struct _FieldBuffer
    {
        BYTE *pBuffer;
        BUFFER_FLAGS flags;
    }FieldBuffer;

    
    [
        helpstring("BufferInfo structure")
    ]
    typedef struct
    {
        [helpstring("width of one field")] long Width;
        [helpstring("height of one field")] long Height;
        [helpstring("frame counter for dscaler")] int CurrentFrame;
        BOOL bIsField;
    }BufferInfo;

    /**
     * Interface used in the filter
     */
    [
        object,
        uuid(22A829B8-C04A-4102-9A2C-45E54CED56D3),
    
        helpstring("IDSRendFilter Interface"),
        pointer_default(unique)
    ]
    interface IDSRendFilter : IUnknown
    {
        [helpstring("method SetFieldHistory")] HRESULT SetFieldHistory([in] long cFields);
        [helpstring("method GetFields")] HRESULT GetFields([in,out] FieldBuffer *ppFields,[in,out] long *count,BufferInfo *pBufferInfo,[in] DWORD dwTimeout,[in] DWORD dwLastRenderTime);
        [helpstring("method FreeFields")] HRESULT FreeFields();
    };
    
    typedef struct
    {
        BOOL bNeedConv;
        BOOL bFieldInput;
        LONG Width;
        LONG Height;
    }DSRendStatus;

    typedef enum
    {
        DSREND_FIELD_FORMAT_AUTO,
        DSREND_FIELD_FORMAT_FRAME,
        DSREND_FIELD_FORMAT_FIELD
    }DSREND_FIELD_FORMAT;

    /**
     * Status interface
     */
    [
        object,
        uuid(20605312-3D0E-4DB3-A17D-67436CA009AA),
        helpstring("IDSRendStatus Interface"),
        pointer_default(unique)
    ]
    interface IDSRendSettings : IUnknown
    {
    
        [propget, helpstring("property Status")] HRESULT Status([out, retval] DSRendStatus *pVal);
        [propget, helpstring("property SwapFields")] HRESULT SwapFields([out, retval] BOOL *pVal);
        [propput, helpstring("property SwapFields")] HRESULT SwapFields([in] BOOL newVal);
        [propget, helpstring("property ForceYUY2")] HRESULT ForceYUY2([out, retval] BOOL *pVal);
        [propput, helpstring("property ForceYUY2")] HRESULT ForceYUY2([in] BOOL newVal);
        [propget, helpstring("property FieldFormat")] HRESULT FieldFormat([out, retval] DSREND_FIELD_FORMAT *pVal);
        [propput, helpstring("property FieldFormat")] HRESULT FieldFormat([in] DSREND_FIELD_FORMAT newVal);
        [propget, helpstring("property VertMirror")] HRESULT VertMirror([out, retval] BOOL *pVal);
        [propput, helpstring("property VertMirror")] HRESULT VertMirror([in] BOOL newVal);
    };


[
    uuid(694D6921-E73C-40C0-9F75-5BC4FA646DF7),
    version(1.0),
    helpstring("DSRend 1.0 Type Library")
]
library DSRENDLib
{
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");

    [
        uuid(29383BF2-74DD-4F7F-A3D0-A00ABE5D966D),
        helpstring("DSRendFilter Class")
    ]
    coclass DSRendFilter
    {
        [default] interface IDSRendFilter;
    };
    [
        uuid(F4DA29E0-5C4D-4C69-8545-A5B94F51578A),
        helpstring("DSRendInPin Class")
    ]
    coclass DSRendInPin
    {
        interface IUnknown;
        interface IDSRendSettings;
    };

    [
        uuid(02FA8EB3-9D40-4764-9D04-173BDB52D4A7),
        helpstring("DSRendQualityPage Class")
    ]
    coclass DSRendQualityPage
    {
        interface IUnknown;
    };

    [
        uuid(8AC05775-495A-435A-A143-A1002657E584),
        helpstring("SettingsPage Class")
    ]
    coclass SettingsPage
    {
        interface IUnknown;
    };

    [
        uuid(495D7645-48CF-4B3F-AF26-61CC5F03B4DF),
        helpstring("DSRendAboutPage Class")
    ]
    coclass DSRendAboutPage
    {
        interface IUnknown;
    };
};
