InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IMediaReadFormat Class Referenceabstract

#include <IMediaReadFormat.h>

Inheritance diagram for IMediaReadFormat:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IMEDIAREADFORMAT }
 

Public Member Functions

virtual bool16 CanAccessMedia ()=0
 
virtual bool16 CanRead (const MediaLocation &loc)=0
 
virtual bool16 CanRead (IPMStream *iPMStream)=0
 
virtual ErrorCode Close ()=0
 
virtual IPMStreamCreateContentStreamRead (const MediaLocation &loc)=0
 
virtual ErrorCode GetAttributes (IMediaContentData *contentData)=0
 
virtual ErrorCode GetLastError ()=0
 
virtual IPMStreamGetPosterStream ()=0
 
virtual bool16 IsOpen ()=0
 
virtual ErrorCode Open (IPMStream *iPMStream)=0
 
virtual ErrorCode Open (const MediaLocation &loc)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface provides read-only access to media content. This interface must be supported by all media filters.

Member Function Documentation

virtual bool16 IMediaReadFormat::CanAccessMedia ()
pure virtual

Tests if the media filter is able to access media content. This method allows users to determine if the filter is in a usable state without incurring the cost of a call to Open(). This method is particular useful if the implementation of this interface relies on an external component to access media.

Note: if this method returns kFalse, then calls to all other methods are likely to fail.

Returns
kTrue if media can be accessed; kFalse if not.
virtual bool16 IMediaReadFormat::CanRead (const MediaLocationloc)
pure virtual

Tests if the media filter can read and recognize the content at a specified MediaLocation. This method has no pre or post conditions.

Parameters
loca MediaLocation to read.
Returns
kTrue if the MediaLocation can be successfully read; kFalse otherwise.
See Also
MediaLocation.
virtual bool16 IMediaReadFormat::CanRead (IPMStreamiPMStream)
pure virtual

Tests if the media filter recognizes the format of a stream-based content. This method has no pre or post conditions.

Parameters
iPMStreaman IPMStream to media content. The filter should not assume that the stream is positioned at the first content byte.
Returns
kTrue if the stream's contents are recognized; kFalse otherwise.
virtual ErrorCode IMediaReadFormat::Close ()
pure virtual

Closes this interface to the media content. When this method returns, all streams provided by this interface are no longer valid. Calling this method when this interface is already closed is not considered to be an error.

Returns
kSuccess if the close succeeded. A non-zero ErrorCode value is returned if an error occurred while closing the interface.
virtual IPMStream* IMediaReadFormat::CreateContentStreamRead (const MediaLocationloc)
pure virtual

Creates a readable stream to the media content.

Parameters
locthe media location.
Returns
a pointer to a valid IPMStream object if content is available; nil otherwise.
virtual ErrorCode IMediaReadFormat::GetAttributes (IMediaContentDatacontentData)
pure virtual

Retrieves media content data recognized by the filter. Content data is metadata about the content. The metadata is set by the filter as IMediaContentData attributes.

Parameters
contentDatavalid pointer to an IMediaContentData instance.
Precondition
The interface must be open before calling this method.
Returns
kSuccess if the attributes were successfully retrieved; otherwise returns a non-zero ErrorCode.
virtual ErrorCode IMediaReadFormat::GetLastError ()
pure virtual

Retrieves the error status for the last method called. Calling this method resets the error status to kSuccess; thus, calling this method twice in succession without an intervening call to another method, always returns kSuccess for the second call.

Returns
an ErrorCode, or kSuccess if no error occurred during the execution of the last method called.
virtual IPMStream* IMediaReadFormat::GetPosterStream ()
pure virtual

Retrieves a stream to a poster image, if available.

Precondition
The interface must be open before calling this method.
Returns
a valid pointer to an IPMStream instance if a poster image is available; returns nil otherwise.
Postcondition
The stream is valid as long as this interface is open. The stream is released by the implementation of this interface; do not issue an explicit Release() call on the stream.
virtual bool16 IMediaReadFormat::IsOpen ()
pure virtual

Tests if this interface is open.

Returns
kTrue if this interface is open; kFalse otherwise.
virtual ErrorCode IMediaReadFormat::Open (IPMStreamiPMStream)
pure virtual

Opens this interface for reading a specified stream.

Returns
kSuccess if the open succeeded or if this interface is already open; returns a non-zero ErrorCode value if an error occurred.
virtual ErrorCode IMediaReadFormat::Open (const MediaLocationloc)
pure virtual

Opens this interface for reading a specified URL.

Parameters
urla valid URL string preceded by an http ("http://") or file ("file://") protocol header.
Returns
kSuccess if the open succeeded or if this interface is already open; returns a non-zero ErrorCode value if an error occurred.