다음을 통해 공유


IWMDMDeviceControl::GetCapabilities 메서드(mswmdm.h)

GetCapabilities 메서드는 디바이스 기능을 검색하여 디바이스가 수행할 수 있는 작업을 결정합니다. 기능은 미디어 디바이스에서 지원하는 디바이스 컨트롤의 메서드를 설명합니다.

구문

HRESULT GetCapabilities(
  [out] DWORD *pdwCapabilitiesMask
);

매개 변수

[out] pdwCapabilitiesMask

디바이스의 기능을 지정하는 DWORD 에 대한 포인터입니다. 이 변수에서 다음 플래그를 반환할 수 있습니다.

플래그 설명
WMDM_DEVICECAP_CANPLAY 미디어 디바이스는 MP3 오디오를 재생할 수 있습니다.
WMDM_DEVICECAP_CANSTREAMPLAY 미디어 디바이스는 호스트 컴퓨터에서 직접 스트리밍 오디오를 재생할 수 있습니다.
WMDM_DEVICECAP_CANRECORD 미디어 디바이스는 오디오를 녹음할 수 있습니다.
WMDM_DEVICECAP_CANSTREAMRECORD 미디어 디바이스는 스트리밍 오디오를 호스트 컴퓨터에 직접 녹음할 수 있습니다.
WMDM_DEVICECAP_CANPAUSE 미디어 디바이스는 재생 또는 녹화 작업 중에 일시 중지할 수 있습니다.
WMDM_DEVICECAP_CANRESUME 미디어 디바이스는 일시 중지된 작업을 다시 시작할 수 있습니다.
WMDM_DEVICECAP_CANSTOP 미디어 디바이스는 파일이 끝나기 전에 재생을 중지할 수 있습니다.
WMDM_DEVICECAP_CANSEEK 미디어 디바이스는 파일의 시작이 아닌 위치를 검색할 수 있습니다.
WMDM_DEVICECAP_HASSECURECLOCK 미디어 디바이스에는 보안 시계가 있습니다.

반환 값

이 메서드는 HRESULT를 반환합니다. 가능한 값에는 다음 표에 있는 값이 포함되지만, 이에 국한되는 것은 아닙니다.

반환 코드 Description
S_OK
메서드가 성공했습니다.
E_INVALIDARG
pdwCapabilitiesMask 매개 변수가 잘못되었거나 NULL 포인터입니다.
E_FAIL
지정되지 않은 오류가 발생했습니다.

설명

현재 해당 기능을 올바르게 보고하는 디바이스는 많지 않습니다.

예제

다음 C++ 코드는 디바이스 기능을 검색합니다.


// Examine the device capabilities.
// Use some of these to enable or disable the application's
// user interface elements.
CComQIPtr<IWMDMDeviceControl> pDeviceControl(pIWMDMDevice);
if (pDeviceControl != NULL)
{
    DWORD caps = 0;
    hr = pDeviceControl->GetCapabilities(&caps);
    if (caps & WMDM_DEVICECAP_CANPLAY)
    {
        // TODO: Display a message indicating that the media device can play MP3 audio.
    }
    if (caps & WMDM_DEVICECAP_CANSTREAMPLAY)
    {
        // TODO: Display a message that the device can play audio directly from the host computer.
    }
    if (caps & WMDM_DEVICECAP_CANRECORD)
    {
        // TODO: Display a message that the device can record audio.
    }
    if (caps & WMDM_DEVICECAP_CANSTREAMRECORD)
    {
        // TODO: Display a message that the media device can record 
        // streaming audio directly to the host computer.
    }
    if (caps & WMDM_DEVICECAP_CANPAUSE)
    {
        // TODO: Display a message that the device can pause during play or record operations.
    }
    if (caps & WMDM_DEVICECAP_CANRESUME)
    {
        // TODO: Display a message that the device can resume an operation that was paused.
    }
    if (caps & WMDM_DEVICECAP_CANSTOP)
    {
        // TODO: Display a message that the device can stop playing before the end of a file.
    }
    if (caps & WMDM_DEVICECAP_CANSEEK)
    {
        // TODO: Display a message that the device can seek to a position 
        // other than the beginning of the file.
    }
    if (caps & WMDM_DEVICECAP_HASSECURECLOCK)
    {
        // TODO: Display a message indicating that the device has a secure clock.
    }
}

요구 사항

요구 사항
대상 플랫폼 Windows
헤더 mswmdm.h
라이브러리 Mssachlp.lib

추가 정보

IWMDMDeviceControl 인터페이스

IWMDMObjectInfo 인터페이스