// %BANNER_BEGIN% // --------------------------------------------------------------------- // %COPYRIGHT_BEGIN% // Copyright (c) (2018-2022) Magic Leap, Inc. All Rights Reserved. // Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2 // Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein. // %COPYRIGHT_END% // --------------------------------------------------------------------- // %BANNER_END% namespace UnityEngine.XR.MagicLeap { using System; /// /// MLMedia APIs. /// public partial class MLMedia { /// /// Media player script that allows playback of a streaming video (either from file or web URL) /// This script will update the main texture parameter of the Renderer attached as a sibling /// with the video frame from playback. Audio is also handled through this class and will /// playback audio from the file. /// public partial class Player { /// /// VideoScalingMode. /// public enum VideoScalingMode { /// /// Scale to fit. /// ScaleToFit = 1, /// /// Scale to fit with cropping. /// ScaleToFitWithCropping = 2 }; /// /// Comment Needed! /// [Flags] public enum PollingStateFlags : uint { /// /// Playing. /// IsPlaying = 1 << 0, /// /// Looping. /// IsLooping = 1 << 1, /// /// Prepared. /// HasBeenPrepared = 1 << 2, /// /// Playback completed. /// HasPlaybackCompleted = 1 << 3, /// /// Seek completed. /// HasSeekCompleted = 1 << 4, /// /// Size changed. /// HasSizeChanged = 1 << 5, /// /// Buffering updated. /// HasBufferingUpdated = 1 << 6, /// /// Received info. /// HasReceivedInfo = 1 << 7, /// /// Recieved error. /// HasReceivedError = 1 << 8, /// /// Timed text updated. /// HasTimedTextUpdated = 1 << 9, /// /// Subtitle updated. /// HasSubtitleUpdated = 1 << 10, /// /// Metadata updated. /// HasMetadataUpdated = 1 << 11, /// /// DRM info updated. /// HasDrmInfoUpdated = 1 << 12, /// /// Async Reset completed. /// HasResetCompleted = 1 << 13, /// /// All states. /// All = ~0u }; /// /// Comment Needed! /// public enum BufferingMode { /// /// Do not support buffering. /// None, /// /// Support only time based buffering. /// TimeOnly, /// /// Support only size based buffering. /// SizeOnly, /// /// Support both time and size based buffering, time based calculation precedes /// size based. Size based calculation will be used only when time information is not /// available for the stream. /// TimeThenSize, }; /// /// Frame Packing Arrangement for stereoscopic videos. /// public enum FramePackingMode { /// /// Not a stereoscopic video. /// None = 0, /// /// Checkboard. /// Checkboard, /// /// Column interleaved. /// ColumnInterleaved, /// /// Row interleaved. /// RowInterleaved, /// /// Side by side quincunx. /// SideBySideQuincunx, /// /// Side by side. /// SideBySide, /// /// Top bottom. /// TopBottom, /// /// Multiview frame by frame. /// MultiviewFrameByFrame, /// /// Frame by frame. /// FrameByFrame, /// /// Anaglyph. /// Anaglyph } /// /// Frame Packing Arrangement flags for stereoscopic videos. /// [Flags] public enum FramePackingFlags { /// /// No flags. /// None = 0, /// /// Right view first. /// RightViewFirst = 1, /// /// Left view flipped. /// LeftFlipped = 2, /// /// Right view flipped. /// RightFlipped = 4, /// /// Anaglyph red/cyan. /// Anaglyph_RedCyan = 8, /// /// Anaglyph green/magenta. /// AnaglyphGreenMagenta = 16 } /// /// Mode indicating where exactly to seek to. /// public enum SeekMode { /// /// Seek to the previous key frame. /// PreviousSync = 0, /// /// Seek to the next key frame. /// NextSync, /// /// Seek to the closest key frame. /// ClosestSync, /// /// Seek to the closest frame, more accurate but slower. /// Closest } /// /// Indicates various trigger various media player actions. /// MLMediaPlayerInfo from ml_media_player.h. /// public enum Info { /// /// Unknown status /// Unknown = 1, /// /// The player was started because it was used as the next player. /// StartedAsNext = 2, /// /// The player just pushed the very first video frame for rendering. /// RenderingStart = 3, /// /// The player just reached EOS and started from beginning loop. /// Looping = 4, /// /// The player acknowledgement that it has started playing. /// Started = 5, /// /// The player acknowledgement that it has paused. /// Paused = 6, /// /// The player acknowledgement that it has stopped playing. /// Stopped = 7, /// /// The player acknowledgement that it has started playing as result of shared player's request. /// StartedBySharedPlayer = 8, /// /// The player acknowledgement that it has paused playing as result of shared player's request. /// PausedBySharedPlayer = 9, /// /// The player acknowledgement that it is seeking as result of shared player's request. /// SeekBySharedPlayer = 10, /// /// The player acknowledgement that it has stopped playing as result of shared player's request. /// StoppedBySharedPlayer = 11, /// /// The Media player has started sync'ing with other shared players. /// SyncStart = 12, /// /// The Media player has completed sync'ing with other shared players. /// SyncComplete = 13, /// /// The video is too complex for the decoder: it can't decode frames fast enough. /// VideoTrackLagging = 700, /// /// Media player is temporarily pausing playback. /// BufferingStart = 701, /// /// Media player is resuming playback after filling buffers. /// BufferingEnd = 702, /// /// Network bandwidth info. /// NetworkBandwidth = 703, /// /// The player is Behind Live Window. /// BehindLiveWindow = 704, /// /// Media player is paused because device is in sleep or standby state. /// PowerStatePause = 705, /// /// Media player has resumed playback because device has returned from sleep or standby state. /// PowerStateResume = 706, /// /// Duration in milliseconds of buffered content. /// BufferedDuration = 707, /// /// Bad interleaving means that a media has been improperly interleaved. /// BadInterleaving = 800, /// /// The media is not seekable e.g live stream. /// NotSeekable = 801, /// /// New media metadata is available. /// MetadataUpdate = 802, /// /// Audio can not be played. /// PlayAudioError = 804, /// /// Video can not be played. /// PlayVideoError = 805, /// /// Media timed text error. /// TimedTextError = 900, } /// /// CEA608 caption color code. /// MLCea608CaptionColor from ml_media_cea608_caption.h. /// public enum Cea608CaptionColor : uint { /// /// CEA608 caption color is white. /// White = 0, /// /// CEA608 caption color is green. /// Green = 1, /// /// CEA608 caption color is blue. /// Blue = 2, /// /// CEA608 caption color is cyan. /// > Cyan = 3, /// /// CEA608 caption color is red. /// Red = 4, /// /// CEA608 caption color is yellow. /// Yellow = 5, /// /// CEA608 caption color is magenta. /// Magenta = 6, /// /// CEA608 caption color is invalid. /// Invalid = 7 } /// /// CEA608 caption style code. /// MLCea608CaptionStyle from ml_media_cea608_caption.h. /// public enum Cea608CaptionStyle : uint { /// /// CEA608 caption style code is normal. /// Normal = 0x00000000, /// /// CEA608 caption style code is italics. /// Italics = 0x00000001, /// /// CEA608 caption style code is underline. /// Underline = 0x00000002 } /// /// CEA608 caption Dimension constants. /// MLCea608CaptionDimension from ml_media_cea608_caption.h. /// public enum Cea608CaptionDimension : int { /// /// Max number of rows. /// MaxRows = 15, /// /// Max number of columns. /// MaxCols = 32, /// /// Max number of plus 2. /// MaxRowsPlus2 = 17, /// /// Max number of columns plus 2. /// MaxColsPlus2 = 34 } /// /// CEA708 Caption Pen Size constants. /// MLCea708CaptionPenSize from ml_media_cea708_caption.h. /// public enum Cea708CaptionPenSize { /// /// Small pen size. /// Small = 0, /// /// Standard pen size. /// Standard = 1, /// /// Large pen size. /// Large = 2, } /// /// CEA708 Caption Pen Offset constants. /// MLCea708CaptionPenOffset from ml_media_cea708_caption.h. /// public enum Cea708CaptionPenOffset { /// /// Subscript offset. /// Subscript = 0, /// /// Normal offset. /// Normal = 1, /// /// Superscript offset. /// Superscript = 2, } /// /// CEA708 Caption Emit Commands constants. /// MLCea708CaptionEmitCommand from ml_media_cea708_caption.h. /// public enum Cea708CaptionEmitCommand : int { /// /// Buffer command. /// Buffer = 1, /// /// Control command. /// Control = 2, /// /// SetCurrentWindow tells the caption decoder which window the following commands describe: /// - SetWindowAttributes /// - SetPenAttributes /// - SetPenColor /// - SetPenLocation. /// If the window specified has not already been created with a DefineWindow command then, /// SetCurrentWindow and the window property commands can be safely ignored. /// CWX = 3, /// /// ClearWindows clears all the windows specified in the 8 bit window bitmap. /// CLW = 4, /// /// DisplayWindows displays all the windows specified in the 8 bit window bitmap. /// DSW = 5, /// /// HideWindows hides all the windows specified in the 8 bit window bitmap. /// HDW = 6, /// /// ToggleWindows hides all displayed windows, and displays all hidden windows specified in the 8 bit window bitmap. /// TGW = 7, /// /// DeleteWindows deletes all the windows specified in the 8 bit window bitmap. /// If the current window, as specified by the last SetCurrentWindow command, /// is deleted then the current window becomes undefined and the window attribute commands /// should have no effect until after the next SetCurrentWindow or DefineWindow command. /// DLW = 8, /// /// Delay suspends all processing of the current service, except for DelayCancel and Reset scanning. /// DLY = 9, /// /// DelayCancel terminates any active delay and resumes normal command processing. DelayCancel should be scanned for during a Delay. /// DLC = 10, /// /// Reset deletes all windows, cancels any active delay, and clears the buffer before the Reset command. Reset should be scanned for during a Delay. /// RST = 11, /// /// The SetPenAttributes command specifies how certain attributes of subsequent characters are to be rendered in the current window, until the next SetPenAttributes command. /// SPA = 12, /// /// SetPenColor sets the foreground, background, and edge color for the subsequent characters. /// SPC = 13, /// SetPenLocation sets the location of for the next bit of appended text in the current window. It has two parameters, row and column. /// SPL = 14, /// /// SetWindowAttributes Sets the window attributes of the current window. /// SWA = 15, /// /// DefineWindow0-7 creates one of the eight windows used by a caption decoder. /// DFX = 16 } /// /// CEA708 Caption Emit Command Control constants. /// MLCea708CaptionEmitCommandControl from ml_media_cea708_caption.h. /// public enum Cea708CaptionEmitCommandControl : int { /// /// End of text. /// ETX = 0x03, /// /// Back space. /// BS = 0x08, /// /// This code is equivalent to CEA708 CLW command /// FF = 0x0c, /// /// Carriage return. /// HCR = 0x0e } /// /// CEA708 Caption Color Opacity constants. /// MLCea708CaptionColorOpacity from ml_media_cea708_caption.h. /// public enum Cea708CaptionColorOpacity : int { /// /// Solid opacity. /// Solid = 0, /// /// Flashing opacity. /// Flash = 1, /// /// Translucent opacity. /// Translucent = 2, /// /// Transparent opacity. /// Transparent = 3 } /// /// Enumeration of the available audio channel indices in 5.1 SMPTE order. /// public enum AudioChannel : uint { /// /// Front left channel index. /// FrontLeft = 0, /// /// Front right channel index. /// FrontRight = 1, /// /// Front center channel index. /// FrontCenter = 2, /// /// Low frequency effects channel index. /// LowFrequencyEffects = 3, /// /// Surround left channel index. /// SurroundLeft = 4, /// /// Surround right channel index. /// SurroundRight = 5 } } } }