Skip to main content
VideoDeviceController.GetMediaStreamProperties | getMediaStreamProperties method

Gets the encoding properties for the specified media stream type for the video device.

Syntax


var iMediaEncodingProperties = videoDeviceController.getMediaStreamProperties(mediaStreamType);

public IMediaEncodingProperties GetMediaStreamProperties(
  MediaStreamType mediaStreamType
)

Public Function GetMediaStreamProperties(
  mediaStreamType As MediaStreamType 
) As IMediaEncodingProperties

public:
IMediaEncodingProperties^ GetMediaStreamProperties(
  MediaStreamType mediaStreamType
)

Parameters

mediaStreamType

Type: MediaStreamType

The type of media stream for which to get the properties.

Return value

Type: IMediaEncodingProperties

The encoding properties.

Remarks

The encoding properties returned from this method can either be of type VideoEncodingProperties or ImageEncodingProperties, regardless of the stream type you specify. For this reason, you must check the type of each returned IMediaEncodingProperties object and cast to the appropriate type before accessing the properties of the object.


IMediaEncodingProperties _properties = 
                _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.Photo).FirstOrDefault();

if (_properties is ImageEncodingProperties)
{
  _width = (_properties as ImageEncodingProperties).Width;
}
else if (_properties is VideoEncodingProperties)
{
  _width = (_properties as VideoEncodingProperties).Width;
}

IMediaEncodingProperties^ spMediaEncodingProps = m_spMediaCaptureMgr->VideoDeviceController->GetMediaStreamProperties(streamType)->GetAt(0);

if (spMediaEncodingProps->Type == "Image")
{
   ImageEncodingProperties^ spImageEncodingProps = dynamic_cast<ImageEncodingProperties^>(spMediaEncodingProps);
   *_width = spImageEncodingProps->Width;
}
else if (spMediaEncodingProps->Type == "Video")
{
  VideoEncodingProperties^ spVideoEncodingProps = dynamic_cast<VideoEncodingProperties^>(spMediaEncodingProps);
  *_uiWidth = spVideoEncodingProps->Width;
}

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.winmd

See also

VideoDeviceController
Camera resolution sample (Windows 10)