Compartilhar via


IDvdInfo2::GetDVDTextStringAsNative

 
Microsoft DirectShow 9.0

IDvdInfo2::GetDVDTextStringAsNative

The GetDVDTextStringAsNative method retrieves a DVD text string for a specified language, and returns the text string as an array of bytes.

Syntax

  HRESULT GetDVDTextStringAsNative(
  ULONG ulLangIndex,
  ULONG ulStringIndex,
  BYTE *pchBuffer,
  ULONG ulMaxBufferSize,
  ULONG *pulActualSize,
  DVD_TextStringType *pType
);

Parameters

ulLangIndex

[in] Zero-based index of the language. To find the number of text-string languages on the DVD, call IDvdInfo2::GetDVDTextNumberOfLanguages.

ulStringIndex

[in] Zero-based index of the string to retrieve. To find the number of strings for a given language, call IDvdInfo2::GetDVDTextLanguageInfo.

pchBuffer

[out] Pointer to a buffer that receives the text string. If pchBuffer is NULL, this method returns the size of the string in pulActualSize.

ulMaxBufferSize

[in] Size of the pchBuffer in bytes

pulActualSize

[out] Receives the actual length of the string in bytes, including the terminating NULL.

pType

[out] Receives a member of the DVD_TextStringType enumeration. The value indicates the type of text string, such as movie title or song name.  This parameter can also receive values that are not defined in the DVD_TextStringType enumeration.

Return Values

Returns one of the following HRESULT values.

Return code Description
S_OK Success.
E_POINTER Invalid argument.
E_UNEXPECTED An unexpected internal error occurred.

Remarks

This method returns a DVD text string as a raw byte array, with no conversions. You can use this method to get text strings that are encoded using character sets other than Unicode or 7-bit ASCII (ISO/IEC 646), such as JIS Roman Kanji. To find the character set, call IDvdInfo2::GetDVDTextLanguageInfo.

For Unicode and ASCII text strings, you can use the IDvdInfo2::GetDVDTextStringAsUnicode method, which returns a wide-character string.

The returned string always includes a single terminating NULL byte. If the buffer is smaller than the length of the DVD text string, the string is truncated. To find the required size of the buffer, call the method once with pchBuffer equal to NULL and ulMaxBufferSize equal to zero. The size is returned in pulActualSize. Then allocate a buffer and call the method again.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also