/// <summary> /// Initializes a new instance of the MediaStreamSource class with the specified <see cref="VideoMediaFormat"/>. /// </summary> /// <remarks>H.264 is supported.</remarks> /// <param name="videoMediaFormat">The <see cref="VideoMediaFormat"/> for this source.</param> /// <exception cref="ArgumentNullException"><paramref name="videoMediaFormat"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="videoMediaFormat"/> is not supported.</exception> /// <seealso cref="SupportedVideoTypes"/> /// <since_tizen> 3 </since_tizen> public MediaStreamSource(VideoMediaFormat videoMediaFormat) { if (videoMediaFormat == null) { throw new ArgumentNullException(nameof(videoMediaFormat)); } _videoMediaFormat = videoMediaFormat; VideoConfiguration = CreateVideoConfiguration(videoMediaFormat); }
/// <summary> /// Initializes a new instance of the MediaStreamSource class /// with the specified <see cref="AudioMediaFormat"/> and <see cref="VideoMediaFormat"/>. /// </summary> /// <param name="audioMediaFormat">The <see cref="AudioMediaFormat"/> for this source.</param> /// <param name="videoMediaFormat">The <see cref="VideoMediaFormat"/> for this source.</param> /// <remarks>AAC and H.264 are supported.</remarks> /// <exception cref="ArgumentNullException">Both <paramref name="audioMediaFormat"/> and <paramref name="videoMediaFormat"/> are null.</exception> /// <exception cref="ArgumentException"> /// <paramref name="audioMediaFormat"/> is not supported.<br/> /// -or-<br/> /// <paramref name="videoMediaFormat"/> is not supported. /// </exception> /// <seealso cref="SupportedAudioTypes"/> /// <seealso cref="SupportedVideoTypes"/> /// <since_tizen> 3 </since_tizen> public MediaStreamSource(AudioMediaFormat audioMediaFormat, VideoMediaFormat videoMediaFormat) { if (audioMediaFormat == null && videoMediaFormat == null) { throw new ArgumentNullException(nameof(audioMediaFormat) + " and " + nameof(videoMediaFormat)); } _audioMediaFormat = audioMediaFormat; _videoMediaFormat = videoMediaFormat; AudioConfiguration = CreateAudioConfiguration(audioMediaFormat); VideoConfiguration = CreateVideoConfiguration(videoMediaFormat); }
private MediaStreamConfiguration CreateVideoConfiguration(VideoMediaFormat format) { if (format == null) { return(null); } if (!SupportedVideoTypes.Contains(format.MimeType)) { Log.Error(PlayerLog.Tag, "The video format is not supported : " + format.MimeType); throw new ArgumentException($"The video format is not supported, Type : {format.MimeType}."); } return(new MediaStreamConfiguration(this, StreamType.Video)); }