![]() Throw new ArgumentException("Argument is of the wrong type. If (!(properties is ImageEncodingProperties) & !(properties is VideoEncodingProperties)) ![]() This helper class only uses VideoEncodingProperties or VideoEncodingProperties Throw new ArgumentNullException(nameof(properties)) Public StreamPropertiesHelper(IMediaEncodingProperties properties) Private IMediaEncodingProperties _properties You must include the namespace in the source file for the helper class. In addition to this, the helper class exposes properties for the aspect ratio of the properties, the frame rate (for video encoding properties only), and a friendly name that makes it easier to display the encoding properties in the app's UI. The helper class defined below handles the type checking and casting for ImageEncodingProperties or VideoEncodingProperties so that your app code doesn't need to distinguish between the two types. For this reason, you should always check the type of each returned value and cast it to the appropriate type before attempting to access any of the property values. The results of calling GetAvailableMediaStreamProperties may include ImageEncodingProperties or VideoEncodingProperties regardless of what MediaStreamType value is specified. The VideoDeviceController.GetAvailableMediaStreamProperties method takes a member of the MediaStreamType enumeration, such as VideoRecord or Photo, and returns a list of either ImageEncodingProperties or VideoEncodingProperties objects that convey the stream encoding settings, such as the resolution of the captured photo or video. This helper class is particularly useful due to the following behavior of the encoding properties feature: A media encoding properties helper classĬreating a simple helper class to wrap the functionality of the IMediaEncodingProperties interface makes it easier to select a set of encoding properties that meet particular criteria. The code in this article assumes that your app already has an instance of MediaCapture that has been properly initialized. It is recommended that you familiarize yourself with the basic media capture pattern in that article before moving on to more advanced capture scenarios. This article builds on concepts and code discussed in Basic photo, video, and audio capture with MediaCapture, which describes the steps for implementing basic photo and video capture.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |