private Native.ExtraPreviewCallback _extraPreviewCallback;
private event EventHandler<ExtraPreviewEventArgs> _extraPreview;
- /// <summary>
- /// An event that occurs once per frame when previewing.
- /// Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>An event that occurs once per frame when previewing.</summary>
+ /// <since_tizen> 10 </since_tizen>
public event EventHandler<ExtraPreviewEventArgs> ExtraPreview
{
add
/// </remarks>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public Display Display
{
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value> None, Created, Preview, Capturing, Captured.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraState State
{
get
/// <since_tizen> 3 </since_tizen>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">An invalid state.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public bool DisplayReuseHint
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraFacingDirection"/> that specifies the facing direction of the camera device.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraFacingDirection Direction
{
get
/// <since_tizen> 3 </since_tizen>
/// <value>This returns 2, if the device supports primary and secondary cameras.
/// Otherwise 1, if the device only supports primary camera.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int CameraCount
{
get
private bool _disposed = false;
private CameraState _state = CameraState.None;
PinnedPreviewBuffer<byte> _previewBuffer;
+ private CameraDeviceManager _cameraDeviceManager;
/// <summary>
/// Initializes a new instance of the <see cref="Camera"/> class.
CameraDeviceType cameraDeviceType = CameraDeviceType.BuiltIn;
CameraDevice cameraDevice = device;
- if (CameraDeviceManager.IsSupported || device == CameraDevice.Default)
+ try
{
- var deviceInfo = GetDeviceInformation();
+ _cameraDeviceManager = new CameraDeviceManager();
+ }
+ catch (NotSupportedException)
+ {
+ Log.Info(CameraLog.Tag,
+ $"CameraDeviceManager is not supported. Not error.");
+ }
+
+ if (_cameraDeviceManager != null || device == CameraDevice.Default)
+ {
+ var deviceInfo = _cameraDeviceManager.SupportedDevices;
+
+ // CameraDeviceManager is not used internally anymore.
+ _cameraDeviceManager.Dispose();
+
if (!deviceInfo.Any())
{
- throw new InvalidOperationException("CDM is supported but, there's no available camera device.");
+ throw new InvalidOperationException("CameraDeviceManager is supported but, there's no available camera device.");
}
cameraDeviceType = deviceInfo.First().Type;
CreateNativeCameraDevice(cameraDeviceType, cameraDevice);
}
- private IEnumerable<CameraDeviceInformation> GetDeviceInformation()
- {
- using (var cameraDeviceManager = new CameraDeviceManager())
- {
- return cameraDeviceManager.GetDeviceInformation();
- }
- }
-
private void CreateNativeCameraDevice(CameraDeviceType type, CameraDevice device)
{
if (type == CameraDeviceType.BuiltIn || type == CameraDeviceType.Usb)
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of the ChangeDevice feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void ChangeDevice(CameraDevice device)
{
ValidateState(CameraState.Created);
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StartPreview()
{
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StopPreview()
{
/// </remarks>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StartCapture()
{
/// <exception cref="ArgumentOutOfRangeException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StartCapture(int count, int interval, CancellationToken cancellationToken)
{
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StartFocusing(bool continuous)
{
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StopFocusing()
{
/// </remarks>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StartFaceDetection()
{
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
/// <exception cref="UnauthorizedAccessException">In case of access to the resources cannot be granted.</exception>
public void StopFaceDetection()
{
IsMediaPacketPreviewCallbackSupported = IsFeatureSupported(NativeCapabilities.IsMediaPacketPreviewCallbackSupported);
IsZeroShutterLagSupported = IsFeatureSupported(NativeCapabilities.IsZeroShutterLagSupported);
IsContinuousCaptureSupported = IsFeatureSupported(NativeCapabilities.IsContinuousCaptureSupported);
+ IsExtraPreviewSupported = IsFeatureSupported(NativeCapabilities.IsExtraPreviewSupported);
IsHdrCaptureSupported = IsFeatureSupported(NativeCapabilities.IsHdrCaptureSupported);
IsAntiShakeSupported = IsFeatureSupported(NativeCapabilities.IsAntiShakeSupported);
IsVideoStabilizationSupported = IsFeatureSupported(NativeCapabilities.IsVideoStabilizationSupported);
}
/// <summary>
- /// Gets the face detection feature's supported state.
+ /// Gets the face detection feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsFaceDetectionSupported { get; }
/// <summary>
- /// Gets the media packet preview callback feature's supported state.
+ /// Gets the media packet preview callback feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsMediaPacketPreviewCallbackSupported { get; }
/// <summary>
- /// Gets the zero shutter lag feature's supported state.
+ /// Gets the zero shutter lag feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsZeroShutterLagSupported { get; }
/// <summary>
- /// Gets the continuous capture feature's supported state.
+ /// Gets the continuous capture feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsContinuousCaptureSupported { get; }
/// <summary>
- /// Gets the support state of the HDR capture.
+ /// Gets the extra preview feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 10 </since_tizen>
+ public bool IsExtraPreviewSupported { get; }
+
+ /// <summary>
+ /// Gets the HDR capture feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsHdrCaptureSupported { get; }
/// <summary>
- /// Gets the support state of the anti-shake feature.
+ /// Gets the anti-shake feature feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsAntiShakeSupported { get; }
/// <summary>
- /// Gets the support state of the video stabilization feature.
+ /// Gets the video stabilization feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsVideoStabilizationSupported { get; }
/// <summary>
- /// Gets the support state of auto contrast feature.
+ /// Gets the auto contrast feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsAutoContrastSupported { get; }
/// <summary>
- /// Gets the support state of the brightness feature.
+ /// Gets the brightness feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsBrigtnessSupported { get; }
/// <summary>
- /// Gets the support state of the exposure feature.
+ /// Gets the exposure feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsExposureSupported { get; }
/// <summary>
- /// Gets the support state of the zoom feature.
+ /// Gets the zoom feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsZoomSupported { get; }
/// <summary>
- /// Gets the support state of the pan feature.
+ /// Gets the pan feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsPanSupported { get; }
/// <summary>
- /// Gets the support state of the tilt feature.
+ /// Gets the tilt feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 4 </since_tizen>
public bool IsTiltSupported { get; }
/// <summary>
- /// Gets the support state of the hue feature.
+ /// Gets the hue feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
/// <since_tizen> 5 </since_tizen>
/// <returns>
/// It returns a list containing all the supported preview resolutions.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<Size> SupportedPreviewResolutions
{
get
/// <returns>
/// It returns a list containing all the supported capture resolutions.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<Size> SupportedCaptureResolutions
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraPixelFormat"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraPixelFormat> SupportedCapturePixelFormats
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraPixelFormat"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraPixelFormat> SupportedPreviewPixelFormats
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraFps"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraFps> SupportedPreviewFps
{
get
/// </returns>
/// <since_tizen> 4 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(int width, int height)
{
return GetSupportedPreviewFpsByResolutions(width, height);
/// </returns>
/// <since_tizen> 4 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(Size size)
{
return GetSupportedPreviewFpsByResolutions(size.Width, size.Height);
/// It returns a list containing all the supported <see cref="CameraAutoFocusMode"/>.
/// </returns>
/// <since_tizen> 4 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraAutoFocusMode> SupportedAutoFocusModes
{
get
/// It returns a list containing all the supported <see cref="CameraExposureMode"/>.
/// </returns>
/// <since_tizen> 4 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraExposureMode> SupportedExposureModes
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraIsoLevel"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraIsoLevel> SupportedIsoLevels
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraTheaterMode"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraTheaterMode> SupportedTheaterModes
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraWhiteBalance"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraWhiteBalance> SupportedWhiteBalances
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraFlashMode"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraFlashMode> SupportedFlashModes
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraSceneMode"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraSceneMode> SupportedSceneModes
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraEffectMode"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraEffectMode> SupportedEffects
{
get
/// <returns>
/// An IEnumerable containing all the supported <see cref="Rotation"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<Rotation> SupportedStreamRotations
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="Flips"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<Flips> SupportedStreamFlips
{
get
/// <returns>
/// It returns a list containing all the supported <see cref="CameraPtzType"/>.
/// </returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public IEnumerable<CameraPtzType> SupportedPtzTypes
{
get
*/
using System;
-using System.ComponentModel;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using static Interop.CameraDeviceManager;
namespace Tizen.Multimedia
{
/// <summary>
/// Provides data for the <see cref="CameraDeviceManager.DeviceConnectionChanged"/> event.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public class CameraDeviceConnectionChangedEventArgs : EventArgs
{
- internal CameraDeviceConnectionChangedEventArgs(ref CameraDeviceStruct device, bool status)
+ internal CameraDeviceConnectionChangedEventArgs(CameraDeviceInformation deviceInfo, bool status)
{
- CameraDeviceInformation = CameraDeviceManager.GetDeviceInformation(device);
+ CameraDeviceInformation = deviceInfo;
IsConnected = status;
}
/// <summary>
/// Gets the camera device information.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public CameraDeviceInformation CameraDeviceInformation { get; }
/// <summary>
- /// Gets the status of camera device.
+ /// Gets the connection status of camera device.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public bool IsConnected { get; }
}
}
-using System.Linq;
/*
* Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
*
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Linq;
using Native = Interop.CameraDeviceManager;
namespace Tizen.Multimedia
/// <remarks>
/// This supports the product infrastructure and is not intended to be used directly from 3rd party application code.
/// </remarks>
- /// <since_tizen> 9 </since_tizen>
+ /// <since_tizen> 10 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- [EditorBrowsable(EditorBrowsableState.Never)]
public class CameraDeviceManager : IDisposable
{
private IntPtr _handle;
/// </summary>
/// <exception cref="InvalidOperationException">Invalid operation.</exception>
/// <exception cref="NotSupportedException">The camera device manager is not supported.</exception>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public CameraDeviceManager()
{
Native.Initialize(out _handle).ThrowIfFailed("Failed to initialize CameraDeviceManager");
/// <summary>
/// Finalizes an instance of the Camera class.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
~CameraDeviceManager()
{
Dispose(false);
/// <summary>
/// Gets the status whether camera device(usb, network) is connected or not.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <returns>true if usb or network camera is connected.</returns>
+ /// <exception cref="ObjectDisposedException">The CameraDeviceManager already has been disposed.</exception>
+ /// <since_tizen> 10 </since_tizen>
public bool IsExternalCameraConnected =>
- GetDeviceInformation().Where(d => d.Type == CameraDeviceType.Usb ||
- d.Type == CameraDeviceType.Network)
- .Any();
+ SupportedDevices.Where(d => d.Type == CameraDeviceType.Usb ||
+ d.Type == CameraDeviceType.Network)
+ .Any();
/// <summary>
- /// Gets the current camera device information.
+ /// Retrieves all the supported camera devices and returns its information.
/// </summary>
- /// <returns></returns>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public IEnumerable<CameraDeviceInformation> GetDeviceInformation()
- {
- var deviceList = new Native.CameraDeviceListStruct();
-
- Native.GetDeviceList(Handle, ref deviceList).
- ThrowIfFailed("Failed to get camera device list");
-
- return GetDeviceInformation(deviceList);
- }
-
- internal static bool IsSupported
+ /// <returns>
+ /// if camera device exist, returns list of <see cref="CameraDeviceInformation"/>; otherwise returns Enumerable.Empty.
+ /// </returns>
+ /// <exception cref="ArgumentException">Invalid enumeration.</exception>
+ /// <exception cref="ArgumentNullException">name or id is null.</exception>
+ /// <exception cref="ObjectDisposedException">The CameraDeviceManager already has been disposed.</exception>
+ /// <since_tizen> 10 </since_tizen>
+ public IEnumerable<CameraDeviceInformation> SupportedDevices
{
get
{
- try
+ var deviceList = new List<CameraDeviceInformation>();
+
+ Exception caught = null;
+
+ Native.SupportedDeviceCallback callback = (ref Native.CameraDeviceStruct supportedDevice, IntPtr userData) =>
{
- using (var cameraDeviceManager = new CameraDeviceManager())
+ try
{
+ var deviceInfo = new CameraDeviceInformation(supportedDevice.type, supportedDevice.device, supportedDevice.name,
+ supportedDevice.id, supportedDevice.extraStreamNum);
+ Log.Debug(CameraLog.Tag, deviceInfo.ToString());
+
+ deviceList.Add(deviceInfo);
return true;
}
- }
- catch (NotSupportedException)
- {
- Log.Info(CameraLog.Tag,
- $"CameraDeviceManager is not supported. Not error.");
- }
- return false;
- }
- }
+ catch (Exception e)
+ {
+ caught = e;
+ return false;
+ }
+ };
- internal static IEnumerable<CameraDeviceInformation> GetDeviceInformation(Native.CameraDeviceListStruct list)
- {
- if (list.count == 0)
- {
- return Enumerable.Empty<CameraDeviceInformation>();
- }
+ Native.SupportedDevices(Handle, callback, IntPtr.Zero).
+ ThrowIfFailed("failed to get supported devices");
- var deviceList = new List<CameraDeviceInformation>();
+ if (caught != null)
+ {
+ throw caught;
+ }
- for (int i = 0 ; i < list.count ; i++)
- {
- deviceList.Add(GetDeviceInformation(list.device[i]));
+ return deviceList.Any() ? deviceList.AsReadOnly() : Enumerable.Empty<CameraDeviceInformation>();
}
-
- return deviceList.AsReadOnly();
}
- internal static CameraDeviceInformation GetDeviceInformation(Native.CameraDeviceStruct device) =>
- new CameraDeviceInformation(device.Type, device.device, device.name, device.id, device.extraStreamNum);
+ /// <summary>
+ /// Gets the current camera device information.
+ /// Retrieves all the supported camera devices and returns its information.
+ /// </summary>
+ /// <remarks>This method is only for backward compatibility. Please use SupportedDevices instead.</remarks>
+ /// <returns>
+ /// if camera device exist, returns list of <see cref="CameraDeviceInformation"/>; otherwise returns Enumerable.Empty.
+ /// </returns>
+ /// <see also="WebRTCState"/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public IEnumerable<CameraDeviceInformation> GetDeviceInformation() => SupportedDevices;
private event EventHandler<CameraDeviceConnectionChangedEventArgs> _deviceConnectionChanged;
/// <summary>
/// An event that occurs when camera device is connected or disconnected.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <exception cref="ObjectDisposedException">The CameraDeviceManager already has been disposed.</exception>
+ /// <since_tizen> 10 </since_tizen>
public event EventHandler<CameraDeviceConnectionChangedEventArgs> DeviceConnectionChanged
{
add
private int _connectionCallbackId = -1;
private void RegisterDeviceConnectionChangedCallback()
{
- _deviceConnectionChangedCallback = (ref Native.CameraDeviceStruct device, bool status, IntPtr userData) =>
+ _deviceConnectionChangedCallback = (ref Native.CameraDeviceStruct supportedDevice, bool isConnected, IntPtr userData) =>
{
- Log.Debug(CameraLog.Tag, "Invoke DeviceConnectionChanged event");
- _deviceConnectionChanged?.Invoke(this, new CameraDeviceConnectionChangedEventArgs(ref device, status));
+ var deviceInfo = new CameraDeviceInformation(supportedDevice.type, supportedDevice.device, supportedDevice.name,
+ supportedDevice.id, supportedDevice.extraStreamNum);
+ Log.Debug(CameraLog.Tag, deviceInfo.ToString());
+
+ _deviceConnectionChanged?.Invoke(this, new CameraDeviceConnectionChangedEventArgs(deviceInfo, isConnected));
};
Native.SetDeviceConnectionChangedCallback(Handle, _deviceConnectionChangedCallback, IntPtr.Zero, out _connectionCallbackId).
/// Releases the unmanaged resources used by the camera.
/// </summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
/// <summary>
/// Releases all resources used by the camera.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public void Dispose()
{
Dispose(true);
/// <summary>
/// Provides the ability to get camera device information.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public struct CameraDeviceInformation
{
/// <summary>
/// Initializes a new instance of the <see cref="CameraDeviceInformation"/> class.
/// </summary>
- /// <param name="type"><see cref="CameraDeviceType"/></param>
- /// <param name="device"><see cref="CameraDevice"/></param>
+ /// <param name="type">The camera type</param>
+ /// <param name="device">The camera device</param>
/// <param name="name">The name of camera device</param>
/// <param name="id">The ID of camera device</param>
- /// <param name="numberOfExtraStream">The number of extra stream</param>
+ /// <param name="numberOfExtraStream">The number of extra streams</param>
/// <exception cref="ArgumentException">Invalid enumeration.</exception>
/// <exception cref="ArgumentNullException">name or id is null.</exception>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
internal CameraDeviceInformation(CameraDeviceType type, CameraDevice device, string name, string id, int numberOfExtraStream)
{
ValidationUtil.ValidateEnum(typeof(CameraDeviceType), type, nameof(type));
/// Gets the camera device type.
/// </summary>
/// <value><see cref="CameraDeviceType"/></value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public CameraDeviceType Type { get; }
/// <summary>
/// Gets the <see cref="CameraDevice"/>.
/// </summary>
/// <value><see cref="CameraDevice"/></value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public CameraDevice Device { get; }
/// <summary>
/// Gets the camera device name.
/// </summary>
/// <value>The camera device name</value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public string Name { get; }
/// <summary>
- /// Gets the camera device Id.
+ /// Gets the camera device ID.
/// </summary>
- /// <value>The camera device id.</value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <value>The camera device ID.</value>
+ /// <since_tizen> 10 </since_tizen>
public string Id { get; }
/// <summary>
- /// Gets the number of extra stream.
+ /// Gets the number of extra streams.
/// </summary>
- /// <value>The number of extra stream.</value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <value>The number of extra streams.</value>
+ /// <since_tizen> 10 </since_tizen>
public int NumberOfExtraStream { get; }
/// <summary>
/// Returns a string that represents the current object.
/// </summary>
/// <returns>A string that represents the current object.</returns>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public override string ToString() =>
$"Type:{Type.ToString()}, Device:{Device.ToString()}, Name:{Name}, Id:{Id}, NumberOfExtraStream:{NumberOfExtraStream}";
}
/// </remarks>
/// <value>A <see cref="CameraDisplayMode"/> that specifies the display mode.</value>
/// <exception cref="ArgumentException">Display mode type is incorrect.</exception>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
public CameraDisplayMode Mode
{
get
/// <remarks>
/// This property is meaningful only in overlay or EVAS surface display type.
/// </remarks>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
public bool Visible
{
get
/// </remarks>
/// <value>A <see cref="Rotation"/> that specifies the rotation of the camera device.</value>
/// <exception cref="ArgumentException">Display rotation type is incorrect.</exception>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
public Rotation Rotation
{
get
/// </remarks>
/// <value>A <see cref="Flips"/> that specifies the camera flip type.</value>
/// <exception cref="ArgumentException">Display flip type is incorrect.</exception>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
public Flips Flip
{
get
/// <remarks>
/// This property is meaningful only in overlay or EVAS surface display type.
/// </remarks>
- /// <exception cref="ObjectDisposedException" > The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException" > The camera has already been disposed. </exception>
public Rectangle RoiArea
{
get
/// <summary>
/// Enumeration for camera device type
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public enum CameraDeviceType
{
/// <summary>
/// </remarks>
/// /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetAutoFocusArea(int x, int y)
{
Native.SetAutoFocusArea(_camera.GetHandle(), x, y).
/// </remarks>
/// /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetAutoFocusArea(Point pos)
{
Native.SetAutoFocusArea(_camera.GetHandle(), pos.X, pos.Y).
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void ClearFocusArea()
{
Native.ClearAutoFocusArea(_camera.GetHandle()).
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraAutoFocusMode"/> that specifies the auto focus mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraAutoFocusMode AutoFocusMode
{
get
/// The contrast level of the camera.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int Contrast
{
get
/// If true auto contrast is enabled, otherwise false.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public bool AutoContrast
{
get
/// The hue level of the camera.
/// </summary>
/// <since_tizen> 5 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int Hue
{
get
/// The brightness level of the camera.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int Brightness
{
get
/// The exposure value.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int Exposure
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraExposureMode"/> that specifies the exposure mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraExposureMode ExposureMode
{
get
/// The range for the zoom level is received from the ZoomRange property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int ZoomLevel
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraWhiteBalance"/> that specifies the white balance mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraWhiteBalance WhiteBalance
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraIsoLevel"/> that specifies the ISO level.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraIsoLevel IsoLevel
{
get
/// The range for the image quality is 1 to 100.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int ImageQuality
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraFps"/> that specifies the preview frame rate.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraFps PreviewFps
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Size PreviewResolution
{
get
/// Depending on the capture resolution aspect ratio and the display resolution,
/// the recommended preview resolution is determined.
/// </remarks>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Size RecommendedPreviewResolution
{
get
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraPixelFormat"/> that specifies the pixel format of the preview data.</value>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraPixelFormat PreviewPixelFormat
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Size CaptureResolution
{
get
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraPixelFormat"/> that specifies the pixel format of captured image.</value>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraPixelFormat CapturePixelFormat
{
get
/// The bit rate of the encoded preview.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int EncodedPreviewBitrate
{
get
/// The GOP(Group Of Pictures) interval of the encoded preview.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int EncodedPreviewGopInterval
{
get
/// If you want to display the preview image on the external display with the full screen mode,
/// use this property.
/// </remarks>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraTheaterMode TheaterMode
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraEffectMode"/> that specifies the effect mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraEffectMode Effect
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraSceneMode"/> that specifies the scene mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraSceneMode SceneMode
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraFlashMode"/> that specifies the flash mode.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraFlashMode FlashMode
{
get
/// Gets the camera lens orientation angle.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int LensOrientation
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="Rotation"/> that specifies the rotation of camera device.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Rotation StreamRotation
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="Flips"/> that specifies the camera flip type.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Flips StreamFlip
{
get
/// so that we eventually arrive at a picture that is representative in both dark and bright areas.
/// If this attribute is set, then event handler set for the HdrCaptureProgress event is invoked.
/// </remarks>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraHdrMode HdrMode
{
get
/// If true, the antishake feature is enabled, otherwise false.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public bool AntiShake
{
get
/// If video stabilization is enabled, zero shutter lag is disabled.
/// This feature is used to record a video.
/// </remarks>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public bool VideoStabilization
{
get
/// In some countries, this operation is not permitted.
/// </remarks>
/// <exception cref="InvalidOperationException">Disabling shutter sound is not permitted.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void DisableShutterSound(bool shutterSound)
{
Native.DisableShutterSound(_camera.GetHandle(), shutterSound).
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>A <see cref="CameraPtzType"/> that specifies the type of the PTZ.</value>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraPtzType PtzType
{
set
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetPan(CameraPtzMoveType type, int panStep)
{
ValidationUtil.ValidateEnum(typeof(CameraPtzMoveType), type, nameof(type));
/// <returns>Returns the camera's horizontal position.</returns>
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int GetPan()
{
Native.GetPan(_camera.GetHandle(), out int val).
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetTilt(CameraPtzMoveType type, int tiltStep)
{
ValidationUtil.ValidateEnum(typeof(CameraPtzMoveType), type, nameof(type));
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
/// <returns>Returns the current vertical position.</returns>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int GetTilt()
{
Native.GetTilt(_camera.GetHandle(), out int val).
/// </summary>
/// <value>true if EXIF tags are enabled in the JPEG file, otherwise false.</value>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public bool EnableTag
{
get
/// The camera image description in the EXIF tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public string ImageDescriptionTag
{
get
/// The software information in the EXIF tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public string SoftwareTag
{
get
/// The geo tag(GPS data) in the EXIF tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public Location GeoTag
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <feature> http://tizen.org/feature/camera </feature>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void RemoveGeoTag()
{
Native.RemoveGeotag(_camera.GetHandle()).
/// The camera orientation in the tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public CameraTagOrientation OrientationTag
{
get
/// <summary>
/// Gets the information of extra preview stream.
/// </summary>
- /// <param name="streamId">The stream id.</param>
- /// <since_tizen> 9 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="streamId">The stream ID.</param>
+ /// <returns>A extra stream information.</returns>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public ExtraPreviewStreamInfo GetExtraPreviewStreamInfo(int streamId)
{
GetExtraPreviewStreamFormat(_camera.GetHandle(), streamId, out CameraPixelFormat format,
/// Sets the information of extra preview stream.
/// </summary>
/// <param name="info">The extra preview stream information.</param>
- /// <since_tizen> 9 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetExtraPreviewStreamInfo(ExtraPreviewStreamInfo info)
{
SetExtraPreviewStreamFormat(_camera.GetHandle(), info.StreamId, info.Format,
}
/// <summary>
- /// Gets the bitrate of extra preview with given stream id.
+ /// Gets the bitrate of extra preview with given stream ID.
/// </summary>
- /// <param name="streamId">The stream id.</param>
- /// <since_tizen> 9 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="streamId">The stream ID.</param>
+ /// <returns>A bitrate of extra stream.</returns>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public int GetExtraPreviewBitrate(int streamId)
{
Native.GetExtraPreviewBitrate(_camera.GetHandle(), streamId, out int bitrate).
}
/// <summary>
- /// Sets the bitrate of extra preview with given stream id.
+ /// Sets the bitrate of extra preview with given stream ID.
/// </summary>
- /// <param name="streamId">The stream id.</param>
- /// <param name="bitrate">The bitrate fo extra preview.</param>
- /// <since_tizen> 9 </since_tizen>
- /// <exception cref="ObjectDisposedException">The camera already has been disposed.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="streamId">The stream ID.</param>
+ /// <param name="bitrate">The bitrate for extra preview.</param>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
public void SetExtraPreviewBitrate(int streamId, int bitrate)
{
Native.SetExtraPreviewBitrate(_camera.GetHandle(), streamId, bitrate).
ThrowIfFailed("Failed to set extra preview bitrate");
}
+
+ /// <summary>
+ /// Gets the GOP(Group Of Pictures) interval of extra preview with given stream ID.
+ /// </summary>
+ /// <param name="streamId">The stream ID.</param>
+ /// <returns>A GOP interval of extra preview.</returns>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int GetExtraPreviewGopInterval(int streamId)
+ {
+ Native.GetExtraPreviewBitrate(_camera.GetHandle(), streamId, out int gopInterval).
+ ThrowIfFailed("Failed to get extra preview gop interval");
+
+ return gopInterval;
+ }
+
+ /// <summary>
+ /// Sets The GOP(Group Of Pictures) interval of extra preview with given stream ID.
+ /// </summary>
+ /// <param name="streamId">The stream ID.</param>
+ /// <param name="gopInterval">The stream ID.</param>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public void SetExtraPreviewGopInterval(int streamId, int gopInterval)
+ {
+ Native.SetExtraPreviewBitrate(_camera.GetHandle(), streamId, gopInterval).
+ ThrowIfFailed("Failed to set extra preview gop interval");
+ }
+
+ /// <summary>
+ /// Gets the rotation of extra preview with given stream ID.
+ /// </summary>
+ /// <param name="streamId">The stream ID.</param>
+ /// <returns>A rotation of extra preview.</returns>
+ /// <since_tizen> 10 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public Rotation GetExtraPreviewRotation(int streamId)
+ {
+ Native.GetExtraPreviewRotation(_camera.GetHandle(), streamId, out Rotation rotation).
+ ThrowIfFailed("Failed to get extra preview gop interval");
+
+ return rotation;
+ }
}
/// <summary>
/// Provides the ability to get the information of extra preview stream.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public struct ExtraPreviewStreamInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="ExtraPreviewStreamInfo"/> class.
/// </summary>
- /// <param name="streamId">The stream id.</param>
+ /// <param name="streamId">The stream ID.</param>
/// <param name="format">The preview format.</param>
/// <param name="size">The preview resolution.</param>
- /// <param name="fps">The fps.</param>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="fps">The FPS.</param>
+ /// <since_tizen> 10 </since_tizen>
public ExtraPreviewStreamInfo(int streamId, CameraPixelFormat format, Size size, int fps)
{
StreamId = streamId;
}
/// <summary>
- /// Gets the stream Id.
+ /// Gets the stream ID.
/// </summary>
- /// <value>The stream Id.</value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int StreamId { get; set;}
+ /// <value>The stream ID.</value>
+ /// <since_tizen> 10 </since_tizen>
+ public int StreamId { get; }
/// <summary>
/// Gets the extra preview format.
/// </summary>
- /// <value></value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <value>The camera pixel format.</value>
+ /// <since_tizen> 10 </since_tizen>
public CameraPixelFormat Format { get; }
/// <summary>
/// Gets the extra preview resolution.
/// </summary>
- /// <value></value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <value>A resolution of extra preview.</value>
+ /// <since_tizen> 10 </since_tizen>
public Size Size { get; }
/// <summary>
- /// Gets the fps.
+ /// Gets the FPS.
/// </summary>
/// <value></value>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public int Fps { get; }
/// <summary>
/// Returns a string that represents the current object.
/// </summary>
/// <returns>A string that represents the current object.</returns>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public override string ToString() =>
$"StreamId:{StreamId}, Format:{Format.ToString()}, Resolution:{Size.Width}x{Size.Height}, Fps:{Fps}";
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
*/
using System;
-using System.ComponentModel;
namespace Tizen.Multimedia
{
/// <summary>
/// Provides data for the <see cref="Camera.ExtraPreview"/> event.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public class ExtraPreviewEventArgs : EventArgs
{
internal ExtraPreviewEventArgs(PreviewFrame preview, int streadId)
/// <summary>
/// Gets the preview frame data.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public PreviewFrame Preview { get; }
/// <summary>
/// Gets the stream ID.
/// </summary>
- /// <since_tizen> 9 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
public int StreamId { get; }
}
}
internal static partial class CameraDeviceManager
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void DeviceConnectionChangedCallback(ref CameraDeviceStruct device, bool status, IntPtr userData);
+ internal delegate void DeviceConnectionChangedCallback(ref CameraDeviceStruct connectedDevice, bool idConnedted, IntPtr userData);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate bool SupportedDeviceCallback(ref CameraDeviceStruct supportedDevice, IntPtr userData);
[DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_initialize")]
[DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_deinitialize")]
internal static extern CameraError Deinitialize(IntPtr handle);
- [DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_get_device_list")]
- internal static extern CameraError GetDeviceList(IntPtr handle, ref CameraDeviceListStruct deviceList);
+ [DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_foreach_supported_device")]
+ internal static extern CameraError SupportedDevices(IntPtr handle, SupportedDeviceCallback callback, IntPtr userData);
[DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_add_device_connection_changed_cb")]
internal static extern CameraError SetDeviceConnectionChangedCallback(IntPtr handle, DeviceConnectionChangedCallback callback, IntPtr userData, out int id);
[DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_remove_device_connection_changed_cb")]
internal static extern CameraError UnsetDeviceConnectionChangedCallback(IntPtr handle, int id);
-
- [NativeStruct("camera_device_s", Include="camera_internal.h", PkgConfig="capi-media-camera")]
+ [NativeStruct("camera_device_s", Include="camera.h", PkgConfig="capi-media-camera")]
[StructLayout(LayoutKind.Sequential)]
internal struct CameraDeviceStruct
{
- internal CameraDeviceType Type;
+ internal CameraDeviceType type;
internal CameraDevice device;
internal int extraStreamNum;
}
-
- [NativeStruct("camera_device_list_s", Include="camera_internal.h", PkgConfig="capi-media-camera")]
- [StructLayout(LayoutKind.Sequential)]
- internal struct CameraDeviceListStruct
- {
- internal uint count;
-
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
- internal CameraDeviceStruct[] device;
- }
}
}
\ No newline at end of file
internal delegate bool PtzTypeCallback(CameraPtzType type, IntPtr userData);
- [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_continuous_capture")]
- [return: MarshalAs(UnmanagedType.I1)]
- internal static extern bool IsContinuousCaptureSupported(IntPtr handle);
-
[DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_face_detection")]
[return: MarshalAs(UnmanagedType.I1)]
internal static extern bool IsFaceDetectionSupported(IntPtr handle);
+ [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_media_packet_preview_cb")]
+ [return: MarshalAs(UnmanagedType.I1)]
+ internal static extern bool IsMediaPacketPreviewCallbackSupported(IntPtr handle);
+
[DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_zero_shutter_lag")]
[return: MarshalAs(UnmanagedType.I1)]
internal static extern bool IsZeroShutterLagSupported(IntPtr handle);
- [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_media_packet_preview_cb")]
+ [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_continuous_capture")]
[return: MarshalAs(UnmanagedType.I1)]
- internal static extern bool IsMediaPacketPreviewCallbackSupported(IntPtr handle);
+ internal static extern bool IsContinuousCaptureSupported(IntPtr handle);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_extra_preview")]
+ [return: MarshalAs(UnmanagedType.I1)]
+ internal static extern bool IsExtraPreviewSupported(IntPtr handle);
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_hdr_capture")]
[return: MarshalAs(UnmanagedType.I1)]
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_extra_preview_bitrate")]
internal static extern CameraError GetExtraPreviewBitrate(IntPtr handle, int streamId, out int bitrate);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_extra_preview_gop_interval")]
+ internal static extern CameraError SetExtraPreviewGopInterval(IntPtr handle, int streamId, int gopInterval);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_extra_preview_gop_interval")]
+ internal static extern CameraError GetExtraPreviewGopInterval(IntPtr handle, int streamId, out int gopInterval);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_preview_frame_rotation")]
+ internal static extern CameraError GetExtraPreviewRotation(IntPtr handle, int streamId, out Rotation rotation);
}
}