IWMSContentDescriptionList::GetDescriptionCount

banner art

Previous Next

IWMSContentDescriptionList::GetDescriptionCount

The GetDescriptionCount method retrieves the number of content description contexts in the description list.

Syntax

  HRESULT GetDescriptionCount(
  DWORD*  pdwNumDescriptions
);

Parameters

pdwNumDescriptions

[out] Pointer to a DWORD containing the number of contexts in the list.

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 pdwNumDescriptions parameter is NULL.

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 = 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.
          hr = 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