IWMSContentDescriptionList::GetIndexedDescription

banner art

Previous Next

IWMSContentDescriptionList::GetIndexedDescription

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

Syntax

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

Parameters

dwDescriptionNum

[in] DWORD containing the index.

pstrLanguage

[out] LPWSTR a national language.

ppDescription

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

Return Values

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 Code

// 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.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next