IFileClip Interface


IFileClip provides a simple way for an application to create one or more cuts from a single media file.

See IStandardCutList for more information about other cutlist interfaces typically used by applications.

When to Implement

Do not implement this interface. DirectShow implements it for you.

When to Use

Use this interface in your application when you want to provide cutlist functionality to the user.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IFileClip methods Description
SetFileAndStream Initializes the clip object with the specified media file and stream number.
CreateCut Creates a cutlist element.
GetMediaType Retrieves the clip's media type structure.


IFileClip::SetFileAndStream

IFileClip Interface

Initializes the clip object with the specified media file and stream number.

HRESULT SetFileAndStream(
  LPWSTR wstrFileName,
  DWORD streamNum
  );

Parameters
wstrFileName
[in] Name of the file from which to initialize the clip. Must be .AVI or .WAV file.
streamNum
[in] Stream number (.AVI files only) within the specified file from which to initialize the clip. Must be zero (0). AVI files with more than one stream of any type are not supported; clips must be from the first stream (stream 0).
Return Values

Returns an HRESULT value that depends on the implementation of the interface. HRESULT can include one of the following standard constants, or other values not listed.
Value Meaning
E_FAIL Failure.
E_INVALIDARG Argument is invalid.
E_NOTIMPL Method is not supported.
E_OUTOFMEMORY Could not allocate required memory.
S_OK Success.

Remarks

This method opens the file to verify the format and media type (which can be queried by the IFileClip::GetMediaType method).


IFileClip::CreateCut

IFileClip Interface

Creates a cutlist element.

HRESULT CreateCut(
  ICutListElement **ppElement,
  REFERENCE_TIME mtTrimIn,
  REFERENCE_TIME mtTrimOut,
  REFERENCE_TIME mtOrigin,
  REFERENCE_TIME mtLength,
  REFERENCE_TIME mtOffset
  );

Parameters
ppElement
[out] Address of a pointer to the ICutListElement interface of the created cutlist element.
mtTrimIn
[in] Trim in (beginning) position for the cut.
mtTrimOut
[in] Trim out (ending) position for the cut.
mtOrigin
[in] Clip origin. Must be zero (0).
mtLength
[in] Length of clip. Must be mtTrimOut minus mtTrimIn.
mtOffset
[in] Offset of clip. Must be zero (0).
Return Values

Returns an HRESULT value that depends on the implementation of the interface. HRESULT can include one of the following standard constants, or other values not listed.
Value Meaning
E_FAIL Failure.
E_INVALIDARG Argument is invalid.
E_NOTIMPL Method is not supported.
E_OUTOFMEMORY Could not allocate required memory.
S_OK Success.

Remarks

All of the times specified to this method are relative to the media clip rather than to the cutlist.


IFileClip::GetMediaType

IFileClip Interface

Retrieves the clip's media type structure.

HRESULT GetMediaType(
  AM_MEDIA_TYPE *pmt
  );

Parameters
pmt
[out] Pointer to the AM_MEDIA_TYPE structure describing the video clip.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. HRESULT can include one of the following standard constants, or other values not listed.
Value Meaning
E_FAIL Failure.
E_INVALIDARG Argument is invalid.
E_NOTIMPL Method is not supported.
E_OUTOFMEMORY Could not allocate required memory.
S_OK Success.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.