//***************************************************************************** 
// 
// Microsoft Windows Media 
// Copyright (C) Microsoft Corporation. All rights reserved. 
//
// FileName:            wmsdatapath.idl
//
// Abstract:
//
//*****************************************************************************

cpp_quote("//*****************************************************************************") 
cpp_quote("//") 
cpp_quote("// Microsoft Windows Media") 
cpp_quote("// Copyright (C) Microsoft Corporation. All rights reserved.") 
cpp_quote("//")
cpp_quote("// Automatically generated by Midl from wmsdatapath.idl" )
cpp_quote("//")
cpp_quote("// DO NOT EDIT THIS FILE.")
cpp_quote("//")
cpp_quote("//*****************************************************************************") 

import "objidl.idl";
import "nsscore.idl";
import "DataContainer.idl";
import "StreamDescription.idl";
import "WMSPacket.idl";

interface IWMSPacketStreamer;
interface IWMSPacketStreamerCallback;
interface IWMSPushSource;
interface IWMSPushSourceCallback;
interface IWMSPushSink;
interface IWMSPacketStreamDataContainer;

cpp_quote( "EXTERN_GUID( IID_IWMSPacketStreamer, 0x72527A81,0x1119,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
cpp_quote( "EXTERN_GUID( IID_IWMSPacketStreamerCallback, 0x72527A82,0x1119,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
cpp_quote( "EXTERN_GUID( IID_IWMSPushSource, 0x0B840593,0x115C,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
cpp_quote( "EXTERN_GUID( IID_IWMSPushSourceCallback, 0xead035e4, 0xbe4a, 0x4a7a, 0xbc, 0x19, 0x5b, 0xb, 0x9e, 0x9, 0xd7, 0x4c );" )
cpp_quote( "EXTERN_GUID( IID_IWMSPushSink, 0x0B840594,0x115C,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
cpp_quote( "EXTERN_GUID( IID_IWMSPacketStreamDataContainer, 0xb1b6039, 0x572c, 0x11d2, 0x9e, 0xff, 0x0, 0x60, 0x97, 0xd2, 0xd7, 0xcf );" )


///////////////////////////////////////////////////////////////////////////////
// These are the options for a seek and play command that are passed in
// the command context to the play command.
typedef [public] enum WMS_SEEK_AND_PLAY_TYPE
{
    WMSPlayFromCurrentPosition,
    WMSSeekToIFrameAndPlay,
    WMSSeekToPositionAndPlay,
} WMS_SEEK_AND_PLAY_TYPE;


// These are the flags passed to a seek command.
cpp_quote("#define WMS_SEEK_TO_IFRAME           0x0001")


//////////////////////////////////////////////////////////////////////////////
//
//                        GENERIC PACKET STREAMER
//
//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(72527A81-1119-11d2-9EEE-006097D2D7CF),
    version(9.0),
    helpstring("Contains methods for retrieving information on streams being sent down a data path and for controlling the streams being sent down a data path.")
]
interface IWMSPacketStreamer : IUnknown
{
    // This is called every time a source changes. This is called once 
    // for a simple movie file, and called every time a server-side 
    // playlist changes its output.
    [helpstring("Retrieves header information on streams that are being sent down the data path.")] HRESULT 
    GetStreamInfo(
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext
                );

    // A parser will be smart about waiting until the next
    // iframe before sending data from a newly selected stream.
    [helpstring("Specifies the streams that are sent down the data path.")] HRESULT 
    SelectStream(
                [in] IWMSCommandContext *pCommand,
                [in] IWMSStreamSwitchDescriptionList *pStreamSwitchDescList,
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext 
                );

    // This affects all selected streams. It returns the min seek
    // point of all selected streams.
    // When the parser seeks to a point, it returns all frames 
    // after and including the first iframe of the stream. This 
    // lets us ignore pframes that are after the common seek point
    // but before the next iframe.
    [helpstring("Seeks to a specific offset in a multimedia stream.")] HRESULT 
    Seek(
                [in] IWMSCommandContext *pCommand,
                [in] DWORD dwOffsetType, 
                [in] QWORD qwOffset, 
                [in] DWORD dwFlags,
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext 
                );

	[helpstring("Reserved for future use.")] HRESULT 
    ChangeStreamFormat(
                [in] IWMSCommandContext *pCommand,
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext 
                );

	[helpstring("Reserved for future use.")] HRESULT 
    Interrupt(
                [in] IWMSCommandContext *pCommand,
				[in] DWORD dwOptions,
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext 
                );

    // Extended Commands
    [helpstring("Passes extended commands defined by a plug-in up the data path.")] HRESULT 
    DoExtendedCommand( 
                [in] LPWSTR szCommandName,
                [in] IWMSCommandContext *pCommand,
                [in] IWMSPacketStreamerCallback *pCallback,
                [in] QWORD qwContext
                );

    // This releases internal references, possibly breaking
    // cyclic references.
    [helpstring("Called by the server when the data path is being shut down.")] HRESULT 
    Shutdown();
};



//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(72527A82-1119-11d2-9EEE-006097D2D7CF),
    version(9.0),
    helpstring("Contains methods that enable a plug-in to respond to IWMSPacketStreamer method calls.")
]
interface IWMSPacketStreamerCallback : IUnknown
{
    [helpstring("Called by the plug-in to respond to the IWMSPacketStreamer::GetStreamInfo method call.")] HRESULT 
    OnGetStreamInfo(
                [in] HRESULT hr,
                [in] IWMSStreamHeaderList *pHeaderList,
                [in] IWMSContentDescriptionList *pContentDescription,
                [in] QWORD qwContext
                );

    [helpstring("Called by the plug-in to respond to the IWMSPacketStreamer::Seek method call.")] HRESULT            
    OnSeek( 
                [in] HRESULT hr,
                [in] QWORD qwActualPosition,
                [in] QWORD qwContext
                );

    [helpstring("Called by the plug-in to respond to the IWMSPacketStreamer::SelectStream method call.")] HRESULT             
    OnSelectStream( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );

    [helpstring("Reserved for future use.")] HRESULT            
    OnChangeStreamFormat( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );

    [helpstring("Reserved for future use.")] HRESULT             
    OnInterrupt( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );

    [helpstring("Called by the plug-in to respond to the IWMSPacketStreamer::DoExtendedCommand method call.")] HRESULT             
    OnDoExtendedCommand(
                [in] HRESULT hr,
                [in] QWORD qwContext
                );
};



//////////////////////////////////////////////////////////////////////////////
//
//                       PACKET STREAM DATA CONTAINER
//
// Each live source will implement a storage system that allocates data
// containers. Those data containers will implement IWMSPacketStreamer
// and IWMSPacketStreamDataContainer in addition to IWMSDataContainer.
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(0B1B6039-572C-11d2-9EFF-006097D2D7CF),
    version(9.0),
    helpstring("Contains methods to notify the server of stream signals and to determine the maximum packet size used by a data container.")
]
interface IWMSPacketStreamDataContainer : IUnknown
{
    [helpstring("Called by the server to indicate that it should be notified of stream signals.")] HRESULT 
    SetStreamSignalHandler(
                [in] IWMSStreamSignalHandler *pStreamSignalHandler
                );
    [helpstring("Retrieves the maximum packet size, in bytes, that is used by the data container.")] HRESULT 
    GetMaxPacketSize( [out] DWORD *pdwMaxPacketSize );
}




//////////////////////////////////////////////////////////////////////////////
//
//                         PACKET PUSH INTERFACES
//
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(0B840593-115C-11d2-9EEE-006097D2D7CF),
    version(9.0),
    helpstring("Contains methods that control the flow of data through a data path.")
]
interface IWMSPushSource : IUnknown
{
    [helpstring("Reserved for future use.")] HRESULT 
    ConnectSink( [in] IWMSPushSink *pDataOutput );

    [helpstring("Reserved for future use.")] HRESULT 
    DisconnectSink();

    // Call start each time you change the rate (ie, play to 
    // fast-forward). A negative rate is rewind.
    [helpstring("Starts the flow of packets down a data path.")] HRESULT 
    StartPushing( 
                [in] IWMSCommandContext *pCommand,
                [in] double dblRate,
                [in] IWMSPushSourceCallback *pCallback,
                [in] QWORD qwContext
                );

    [helpstring("Stops the flow of packets down a data path.")] HRESULT 
    StopPushing( 
				[in] IWMSCommandContext *pCommand,
                [in] IWMSPushSourceCallback *pCallback,
                [in] QWORD qwContext
				);

    // This may or may not be implemented differently than StopPushing. 
    [helpstring("Pauses the flow of packets down a data path.")] HRESULT 
    PausePushing( 
				[in] IWMSCommandContext *pCommand,
                [in] IWMSPushSourceCallback *pCallback,
                [in] QWORD qwContext
				);
    [helpstring("Passes UDP resend requests up the data path.")] HRESULT 
    ResendPacket(
                [in] IWMSCommandContext *pCommand,
                [in] DWORD dwPacketNum, 
                [in] DWORD dwStreamNum 
                );
};




//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(EAD035E4-BE4A-4a7a-BC19-5B0B9E09D74C),
    version(9.0),
    helpstring("Contains methods that enable a plug-in to respond to IWMSPushSource method calls.")
]
interface IWMSPushSourceCallback : IUnknown
{
    [helpstring("Called by the plug-in to respond to the IWMSPushSource::StartPushing method call.")] HRESULT 
    OnStartPushing( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );

    [helpstring("Called by the plug-in to respond to the IWMSPushSource::StopPushing method call.")] HRESULT 
    OnStopPushing( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );

    [helpstring("Called by the plug-in to respond to the IWMSPushSource::PausePushing method call.")] HRESULT 
    OnPausePushing( 
                [in] HRESULT hr,
                [in] QWORD qwContext
                );
};



//////////////////////////////////////////////////////////////////////////////
[
    object,
    pointer_default(unique),
    uuid(0B840594-115C-11d2-9EEE-006097D2D7CF),
    version(9.0),
    helpstring("Contains a method to request that a data path component process a packet list.")
]
interface IWMSPushSink : IUnknown
{
    [helpstring("Reserved for future use.")] HRESULT 
    ConnectSource( [in] IWMSPushSource *pDataInput );
    [helpstring("Reserved for future use.")] HRESULT 
    DisconnectSource();

    // The main method for moving data through the server.
    [helpstring("Requests that a data path component process a packet list.")] HRESULT 
    ProcessPackets( [in] IWMSPacketList *pPacketList );
};



