//
//  OTStream.h
//
//  Copyright (c) 2014 Tokbox, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>

/**
* Defines values for the <[OTStream videoType]> property.
*/
typedef NS_ENUM(int32_t, OTStreamVideoType) {
    /**
     * Defines the camera video mode setting for the
     * <[OTStream videoType]> property.
     */
    OTStreamVideoTypeCamera = 1,
    /**
     * Defines the screen video mode setting for the
     * <[OTStream videoType]> property.
     */
    OTStreamVideoTypeScreen = 2,
    /**
     * Defines the custom video mode setting for the
     * <[OTStream videoType]> property.
     */
    OTStreamVideoTypeCustom = 3,
};

@class OTSession, OTConnection;

/**
 * An OTStream object represents a stream of multimedia, which may
 * contain video and/or audio data.
 *
 * Use OTStream instances to initialize <OTSubscriber> interfaces. Do not
 * attempt to initialize an OTStream directly.
 */
@interface OTStream : NSObject

/** @name Getting basic stream information */

/**
 * The <OTConnection> object corresponding to the connection that is publishing the stream.
 * You can compare this to to the <[OTSession connection]> property to see if the stream
 * is being published by the local device.
 */
@property(readonly) OTConnection* _Nonnull connection;

/**
 * The session (an <OTSession> object) the stream is bound to.
 */
@property(readonly) OTSession* _Nonnull session;

/**
 * The unique ID of the stream.
 */
@property(readonly) NSString* _Nonnull streamId;

/**
 * The timestamp for the creation of the stream on the OpenTok media server.
 */
@property(readonly) NSDate* _Nonnull creationTime;

/**
 * The name of the stream. In the OpenTok iOS SDK, you can specify a published
 * stream's name when you when you sent the
 * <[OTPublisherKit initWithDelegate:settings:]> message.
 */
@property(readonly) NSString* _Nullable name;

/** @name Getting audio and video information */

/**
 * Whether the stream is publishing audio (YES) or not (NO).
 * See <[OTPublisherKit publishAudio]> and <[OTSubscriberKit subscribeToAudio]>.
 */
@property(readonly) BOOL hasAudio;

/**
 * Whether the stream is publishing video (YES) or not (NO).
 * See <[OTPublisherKit publishVideo]> and <[OTSubscriberKit subscribeToVideo]>.
 */
@property(readonly) BOOL hasVideo;

/**
 * Whether the stream is publishing captions (YES) or not (NO).
 * See <[OTPublisherKit publishCaptions]> and <[OTSubscriberKit subscribeToCaptions]>.
 */
@property(readonly) BOOL hasCaptions;

/**
 * The publisher's capturer target resolution for this stream, as last signaled to the
 * session. This value is broadcast to all session participants and is readable on both
 * the publishing and subscribing clients.
 *
 * This property can change at runtime when the publisher changes the capture resolution,
 * for example due to a device orientation change or a change in capture settings.
 *
 * Note: This represents the publisher's capturer target resolution, not the resolution
 * actually encoded or received by a subscriber. The publisher may encode at a lower
 * resolution due to bandwidth or CPU constraints.
 *
 * For streams that use the scalable video feature, this is set to the
 * maximum resolution available for the stream. For more information
 * on scalable video, see the documentation for the [OpenTok Media
 * Router](https://tokbox.com/developer/guides/create-session/#media-mode ).
 */
@property (readonly) CGSize videoDimensions;

/**
 * Specifies the type of video for this stream.
 *
 * This property is set one of the following values:
 *
 * * <code>OTStreamVideoTypeScreen</code> &mdash; The stream's video
 *   encoding is optimized for screen sharing.
 *
 * * <code>OTStreamVideoTypeCamera</code> &mdash; The stream is not
 *   optimized for screen sharing (for example, it uses a camera as the video
 *   source).
 *
 * * <code>OTStreamVideoTypeCustom</code> &mdash; The custom stream
 *   video type applies only to Web generated streams.
 *
 * For more information, see <[OTPublisherKit videoType]>.
 */
@property (readonly) OTStreamVideoType videoType;

@end
