IWMSContentDescriptionList::GetIndexedDescription

The GetIndexedDescription method retrieves a specific content description context from the description list by index.

HRESULT GetIndexedDescription(
  DWORD  dwDescriptionNum,
  LPWSTR*  pstrLanguage,
  IWMSContext**  ppDescription
);

Arguments

dwDescriptionNum

[in] DWORD containing the index.

pstrLanguage

[out] LPWSTR a national language.

ppDescription

[out] Pointer to a pointer to an IWMSContext IWMSContext Interface containing the content description context.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code

Number

Description

E_INVALIDARG

0x80070057

The pstrLanguage parameter or the ppDescription parameter is NULL.

E_UNEXPECTED

0x8000FFFF

An unexpected error occurred, and the specified context could not be found.

Example

// Declare variables.
HRESULT hr;
LPWSTR wszLanguage = NULL;
LPWSTR wsz;

// Use a pointer to a description context,to retrieve the number of 
// content descriptions in the description list.
hr = pContentDescription->GetDescriptionCount( &dwNumDescriptions );
if (FAILED(hr)) goto EXIT;

// Retrieve the first description list.
if (dwNumDescriptions > 0)
{
    hr = m_pContentDescription->GetIndexedDescription(
                                      0, 
                                      &wszLanguage, 
                                      &pContentDescriptionCtx );

    if( SUCCEEDED( hr ) )
    {
          // Retrieve the playlist URL.
          hr = pContentDescriptionCtx->GetStringValue( 
                     WMS_CONTENT_DESCRIPTION_PLAYLIST_ENTRY_URL,
                     WMS_CONTENT_DESCRIPTION_PLAYLIST_ENTRY_URL_ID,
                     &wsz, 
                     WMS_CONTEXT_GET_PROPERTY_STRING_BY_REFERENCE);
          if (FAILED(hr)) goto EXIT;
 
          // Retrieve the role.
          hrContent = pContentDescriptionCtx->GetStringValue(
                     WMS_CONTENT_DESCRIPTION_ROLE,
                     WMS_CONTENT_DESCRIPTION_ROLE_ID,
                     &wsz, 
                     WMS_CONTEXT_GET_PROPERTY_STRING_BY_REFERENCE);
          if (FAILED(hr)) goto EXIT;
    }
}

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: streamdescription.h.

Library: WMSServerTypeLib.dll.

See Also

Concepts

IWMSContentDescriptionList Interface