public class WOWZMediaConfig extends java.lang.Object implements java.lang.Comparable<WOWZMediaConfig>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ALWAYS_LANDSCAPE
An identifier for specifying that video should always be sent in landscape orientation.
|
static int |
ALWAYS_PORTRAIT
An identifier for specifying that video should always be sent in portrait orientation.
|
static int |
AUDIO_CHANNELS_MONO
An identifier for specifying single-channel (mono) audio.
|
static int |
AUDIO_CHANNELS_STEREO
An identifier for specifying dual-channel (stereo) audio.
|
static int |
CROP_TO_FRAME
Deprecated.
|
static int |
DEFAULT_AUDIO_BITRATE
The default value for the audio bitrate (64000 bps).
|
static int |
DEFAULT_AUDIO_SAMPLE_RATE
The default value for the audio sample rate (44100 Hz).
|
static int |
DEFAULT_SCALE_MODE
The default value for the video display scale mode (2).
|
static int |
DEFAULT_VIDEO_BITRATE
The default value for the video bitrate (1500 bps).
|
static float |
DEFAULT_VIDEO_BITRATE_SCALING_FACTOR |
static int |
DEFAULT_VIDEO_FRAME_BUFFER_MULTIPLIER |
static int |
DEFAULT_VIDEO_FRAME_HEIGHT
The default value for the height of the video frame (480 pixels).
|
static int |
DEFAULT_VIDEO_FRAME_RATE
The default value for the video frame rate (30 fps).
|
static WOWZSize |
DEFAULT_VIDEO_FRAME_SIZE
The default value for the video frame size, in pixels.
|
static int |
DEFAULT_VIDEO_FRAME_SKIP_COUNT |
static int |
DEFAULT_VIDEO_FRAME_WIDTH
The default value for the width of the video frame (640 pixels).
|
static int |
DEFAULT_VIDEO_KEYFRAME_INTERVAL
The default value for the keyframe interval (30 frames).
|
static int |
FILL_FRAME
Deprecated.
|
static int |
FILL_VIEW
An identifier that specifies video and image previews should be resized and cropped, if necessary,
to preserve the aspect ratio and fill the entire view.
|
static WOWZMediaConfig |
FRAME_SIZE_1280x720
An identifier for a preset configuration representing 720p HD video: a video resolution of 1280x720 pixels, a 3.75-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_1440x1080
An identifier for a preset configuration representing 1080i video: a video resolution of 1440x1080 pixels, a 5-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_176x144
An identifier for a preset configuration appropriate for Quarter CIF (QCIF): a video resolution of 176x144 pixels, a 280-kbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_1920x1080
An identifier for a preset configuration representing 1080p HD video: a video resolution of 1920x1080 pixels, a 5-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_320x240
An identifier for a preset configuration appropriate for Quarter Video Graphics Array (QVGA): a video resolution of 320x240 pixels, a 280-kbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_352x288
An identifier for a preset configuration appropriate for Common Intermediate Format (CIF): a video resolution of 352x288 pixels, a 1-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_3840x2160
An identifier for a preset configuration representing 4K Ultra HD video: a video resolution of 3840x2160 pixels, an 8-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_640x480
An identifier for a preset configuration appropriate for VGA displays: a video resolution of 640x480 pixels, a 1.5-Mbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static WOWZMediaConfig |
FRAME_SIZE_960x540
An identifier for a preset configuration appropriate for high-bandwidth connections: a video resolution of 960x540 pixels, a 1.5-Bbps video bitrate, 30 fps, a keyframe interval of 30,
a 44.1 kHz audio sample rate, and a 64-kbps audio bitrate.
|
static int |
ORIENTATION_LANDSCAPE
An identifier for specifying landscape orientation.
|
static int |
ORIENTATION_LANDSCAPE_INVERTED
An identifier for specifying inverted (upside down) landscape orientation.
|
static int |
ORIENTATION_PORTRAIT
An identifier for specifying portrait orientation.
|
static int |
ORIENTATION_PORTRAIT_INVERTED
An identifier for specifying inverted (upside down) portrait orientation.
|
static WOWZMediaConfig[] |
PRESET_CONFIGS
An array containing the preset configuration identifiers, sorted from lowest to highest frame size.
|
static int |
RESIZE_TO_ASPECT
An identifier that specifies video and image previews should be resized and letterboxed, if necessary,
to preserve the aspect ratio.
|
static int |
SAME_AS_SOURCE
An identifier for specifying that video should be sent in the same orientation as the video input device or source when streaming began.
|
static int[] |
SUPPORTED_AUDIO_SAMPLE_RATES
The supported audio sample rates.
|
Constructor and Description |
---|
WOWZMediaConfig()
The default constructor.
|
WOWZMediaConfig(WOWZMediaConfig other)
Creates and initializes an instance using the property values from the specified instance.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bitrateLabel(int bps)
Gets a human-readable representation of a bitrate value, for example, "800bps" or "1.5kbps."
|
int |
compareTo(WOWZMediaConfig other)
Compares the frame size of this instance with another instance.
|
boolean |
equals(java.lang.Object other)
Compares this instance with another to see if they use the same video frame size.
|
static WOWZMediaConfig[] |
fromFrameSizes(WOWZSize[] frameSizes)
Gets an array of media configurations from an array of video frame sizes.
|
int |
getAudioBitRate()
Gets the audio bitrate.
|
int |
getAudioChannels()
Gets the number of audio channels.
|
int |
getAudioSampleRate()
Gets the audio sample rate.
|
int |
getFrameBufferSizeMultiplier() |
int |
getFrameRateLowBandwidthSkipCount() |
java.lang.String |
getHLSBackupURL()
Gets the HLS playback URL.
|
java.lang.Boolean |
getIsPlayback()
Checks whether the config is used for playback.
|
java.lang.String |
getLabel(boolean withFrameSize,
boolean withPreset,
boolean withBitrate)
Deprecated.
|
java.lang.String |
getLabel(boolean withFrameSize,
boolean withPreset,
boolean withAspect,
boolean withBitrate)
Gets a configurable, human-readable representation of this configuration instance.
|
float |
getLowBandwidthScalingFactor() |
java.lang.String |
getPlayerExampleAutoconfig() |
java.lang.String |
getPresetLabel()
Gets the label for a preset configuration, for example, "1080p."
|
java.lang.String |
getPresetLabelByFrameSize()
Gets the label for a preset configuration, for example "1080p," that matches this instance's video frame size.
|
int |
getVideoBitRate()
Gets the video bitrate.
|
int |
getVideoFrameHeight()
Gets the video frame height.
|
int |
getVideoFramerate()
Gets the video frame rate.
|
WOWZSize |
getVideoFrameSize()
Gets the video frame size.
|
int |
getVideoFrameWidth()
Gets the video frame width.
|
int |
getVideoKeyFrameInterval()
Gets the keyframe interval, which is the number of frames between keyframes.
|
WOWZProfileLevel |
getVideoProfileLevel()
Gets the H.264 profile level.
|
int |
getVideoRotation()
Gets the rotation angle of the video source, with 0 being the natural landscape orientation and 90 being the natural portrait orientation.
|
boolean |
isABREnabled()
Checks whether adaptive bitrate (ABR) streaming is enabled.
|
boolean |
isAudioEnabled()
Checks whether audio streaming is enabled.
|
boolean |
isHLSEnabled()
Checks whether HLS playback is enabled.
|
static boolean |
isLandscape(int orientation)
Checks whether the specified orientation identifier matches one of the landscape identifiers.
|
static boolean |
isLandscapeRotation(int rotation)
Checks whether the rotation angle specifies landscape orientation.
|
static boolean |
isPortrait(int orientation)
Checks whether the specified orientation identifier matches one of the portrait identifiers.
|
static boolean |
isPortraitRotation(int rotation)
Checks whether the rotation angle specifies portrait orientation.
|
static boolean |
isValidScaleMode(int scaleMode)
Checks whether the specified value is a valid scale mode property value.
|
boolean |
isVideoEnabled()
Checks whether video streaming is enabled.
|
static int |
keyFrameIntervalFramesToSeconds(int frames,
int frameRate)
Converts between a number of frames to frames per second (fps), based on a specfied frame rate.
|
static java.lang.String |
orientationLabel(int orientation)
Gets a string representation of the specified orientation.
|
static int |
orientationToRotation(int orientation)
Converts an orientation specifier to a surface rotation angle.
|
static int |
orientationToSurfaceRotation(int orientation)
Deprecated.
Use
orientationToRotation(int) instead. |
void |
resetToDefaults() |
static int |
rotationToOrientation(int rotation)
Converts a surface rotation angle to an orientation identifier.
|
void |
set(WOWZMediaConfig other)
Updates the property values of this instance with the property values from the specified instance.
|
void |
setABREnabled(boolean abrEnabled)
Enables adaptive bitrate (ABR) streaming.
|
void |
setAudioBitRate(int audioBitRate)
Sets the audio bitrate.
|
void |
setAudioChannels(int audioChannels)
Sets the number of audio channels.
|
void |
setAudioEnabled(boolean audioEnabled)
Enables audio streaming.
|
int |
setAudioSampleRate(int audioSampleRate)
Sets the the audio sample rate.
|
void |
setFrameBufferSizeMultiplier(int frameBufferSizeMultiplier)
The value by which to multiply
the video frame rate to determine the number of
frames to buffer before the encoder starts to throttle bitrate
and/or frame rate.
|
void |
setFrameRateLowBandwidthSkipCount(int frameRateLowBandwidthSkipCount)
The number of frames to skip when the encoder can't keep up with the broadcaster.
|
void |
setHLSBackupURL(java.lang.String backupURL)
Specifies an Apple HLS URL to use for playback.
|
void |
setHLSEnabled(boolean useHLS)
Specifies primary playback over Apple HLS.
|
void |
setIsPlayback(boolean isPlayback)
Specifies whether the config is used for playback.
|
void |
setLowBandwidthScalingFactor(float lowBandwidthScalingFactor)
The factor by which to scale the bitrate in low-bandwidth conditions.
|
void |
setPlayerExampleAutoconfig(java.lang.String configName) |
void |
setVideoBitRate(int videoBitRate)
Sets the video bitrate.
|
void |
setVideoEnabled(boolean videoEnabled)
Enables video streaming.
|
void |
setVideoFrameHeight(int height)
Sets the video frame height; should be less than the frame width.
|
void |
setVideoFramerate(int videoFrameRate)
Sets the video frame rate.
|
void |
setVideoFrameSize(int width,
int height)
Sets the video frame size using the specified values.
|
void |
setVideoFrameSize(WOWZSize videoSize)
Sets the video frame size using the values from the specified instance.
|
void |
setVideoFrameWidth(int width)
Sets the video frame width; should be greater than the frame height.
|
void |
setVideoKeyFrameInterval(int videoKeyFrameInterval)
Sets the keyframe interval, which is the number of frames between keyframes.
|
void |
setVideoProfileLevel(int profile,
int level)
Sets the H.264 profile.
|
void |
setVideoProfileLevel(WOWZProfileLevel profileLevel)
Sets the H.264 profile.
|
void |
setVideoRotation(int videoRotation)
Sets the rotation angle of the video source, with 0 being the natural landscape orientation and 90 being the natural portrait orientation.
|
static int |
surfaceRotationToOrientation(int rotation)
Deprecated.
Use
rotationToOrientation(int) instead. |
WOWZDataMap |
toDataMap()
Gets a WOWZDataMap that contains the configuration properties.
|
WOWZDataMap |
toDataMap(WOWZDataMap dataMap)
Gets a WOWZDataMap that contains the configuration properties.
|
static WOWZSize[] |
toFrameSizes(WOWZMediaConfig[] mediaConfigs)
Gets an array of the video frame sizes contained in an array of media configuration instances.
|
java.lang.String |
toString() |
public static final int DEFAULT_VIDEO_FRAME_WIDTH
public static final int DEFAULT_VIDEO_FRAME_HEIGHT
public static final WOWZSize DEFAULT_VIDEO_FRAME_SIZE
public static final int DEFAULT_VIDEO_BITRATE
public static final int DEFAULT_VIDEO_FRAME_RATE
public static final int DEFAULT_VIDEO_KEYFRAME_INTERVAL
public static final int DEFAULT_AUDIO_SAMPLE_RATE
public static final int DEFAULT_AUDIO_BITRATE
public static final int[] SUPPORTED_AUDIO_SAMPLE_RATES
public static final int RESIZE_TO_ASPECT
public static final int CROP_TO_FRAME
RESIZE_TO_ASPECT
.public static final int FILL_VIEW
public static final int FILL_FRAME
FILL_VIEW
.public static final int DEFAULT_SCALE_MODE
public static final int ORIENTATION_LANDSCAPE
public static final int ORIENTATION_PORTRAIT
public static final int ORIENTATION_LANDSCAPE_INVERTED
public static final int ORIENTATION_PORTRAIT_INVERTED
public static final int ALWAYS_LANDSCAPE
public static final int ALWAYS_PORTRAIT
public static final int SAME_AS_SOURCE
public static final int AUDIO_CHANNELS_STEREO
public static final int AUDIO_CHANNELS_MONO
public static final WOWZMediaConfig FRAME_SIZE_176x144
public static final WOWZMediaConfig FRAME_SIZE_320x240
public static final WOWZMediaConfig FRAME_SIZE_352x288
public static final WOWZMediaConfig FRAME_SIZE_640x480
public static final WOWZMediaConfig FRAME_SIZE_960x540
public static final WOWZMediaConfig FRAME_SIZE_1280x720
public static final WOWZMediaConfig FRAME_SIZE_1440x1080
public static final WOWZMediaConfig FRAME_SIZE_1920x1080
public static final WOWZMediaConfig FRAME_SIZE_3840x2160
public static final WOWZMediaConfig[] PRESET_CONFIGS
public static final float DEFAULT_VIDEO_BITRATE_SCALING_FACTOR
public static final int DEFAULT_VIDEO_FRAME_BUFFER_MULTIPLIER
public static final int DEFAULT_VIDEO_FRAME_SKIP_COUNT
public WOWZMediaConfig()
public WOWZMediaConfig(WOWZMediaConfig other)
other
- The instance to use.public static boolean isValidScaleMode(int scaleMode)
scaleMode
- A scale mode property value.public static boolean isLandscape(int orientation)
orientation
- ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE_INVERTED, or ORIENTATION_PORTRAIT_INVERTED.public static boolean isLandscapeRotation(int rotation)
rotation
- The rotation angle, in degrees.public static java.lang.String orientationLabel(int orientation)
orientation
- ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE_INVERTED, or ORIENTATION_PORTRAIT_INVERTED.public static boolean isPortrait(int orientation)
orientation
- ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE_INVERTED, or ORIENTATION_PORTRAIT_INVERTED.public static boolean isPortraitRotation(int rotation)
rotation
- The rotation angle, in degrees.public static int rotationToOrientation(int rotation)
rotation
- A surface rotation angle, in degrees.public static int surfaceRotationToOrientation(int rotation)
rotationToOrientation(int)
instead.public static int orientationToRotation(int orientation)
orientation
- ORIENTATION_LANDSCAPE (0 degrees), ORIENTATION_PORTRAIT (90 degrees), ORIENTATION_LANDSCAPE_INVERTED (180 degrees), or ORIENTATION_PORTRAIT_INVERTED (270 degrees).public static int orientationToSurfaceRotation(int orientation)
orientationToRotation(int)
instead.public static int keyFrameIntervalFramesToSeconds(int frames, int frameRate)
frames
- The number of frames between keyframes.frameRate
- The frame rate.public static java.lang.String bitrateLabel(int bps)
bps
- A bitrate value.public static WOWZSize[] toFrameSizes(WOWZMediaConfig[] mediaConfigs)
mediaConfigs
- An array of media configuration instances.public static WOWZMediaConfig[] fromFrameSizes(WOWZSize[] frameSizes)
frameSizes
- An array of video frame sizes.public void setLowBandwidthScalingFactor(float lowBandwidthScalingFactor)
lowBandwidthScalingFactor
- The default is 0.75.public float getLowBandwidthScalingFactor()
public void setFrameRateLowBandwidthSkipCount(int frameRateLowBandwidthSkipCount)
frameRateLowBandwidthSkipCount
- The default is 4, which skips every fourth frame.public int getFrameRateLowBandwidthSkipCount()
public void setFrameBufferSizeMultiplier(int frameBufferSizeMultiplier)
frameBufferSizeMultiplier
- The default is 4.public int getFrameBufferSizeMultiplier()
public void setABREnabled(boolean abrEnabled)
abrEnabled
- True to have the video bitrate adjust automatically based on bandwidth constraints; false otherwise.public boolean isABREnabled()
public void resetToDefaults()
public int compareTo(WOWZMediaConfig other)
compareTo
in interface java.lang.Comparable<WOWZMediaConfig>
other
- The instance to use for comparison.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The instance to use for comparison.public void set(WOWZMediaConfig other)
other
- The instance with the property values to use.public WOWZSize getVideoFrameSize()
public void setVideoFrameSize(WOWZSize videoSize)
videoSize
- An instance with the property values to use.public void setVideoFrameSize(int width, int height)
width
- The width of the video frame, in pixels.height
- The height of the video frame, in pixels.public int getVideoFrameWidth()
public void setVideoFrameWidth(int width)
width
- The frame width, in pixels).public int getVideoFrameHeight()
public void setVideoFrameHeight(int height)
height
- The video height, in pixels.public int getVideoRotation()
public void setVideoRotation(int videoRotation)
videoRotation
- The rotation, in degrees, of the device's orientation.public int getVideoBitRate()
public void setVideoBitRate(int videoBitRate)
videoBitRate
- The video bitrate of the stream, in kbps.public int getVideoFramerate()
public void setVideoFramerate(int videoFrameRate)
videoFrameRate
- The video frame rate, in fps.public int getVideoKeyFrameInterval()
public void setVideoKeyFrameInterval(int videoKeyFrameInterval)
videoKeyFrameInterval
- The keyframe interval.public WOWZProfileLevel getVideoProfileLevel()
public void setVideoProfileLevel(int profile, int level)
profile
- The profile identifier.level
- The level identifier.public void setVideoProfileLevel(WOWZProfileLevel profileLevel)
profileLevel
- The profile level.public int getAudioChannels()
public void setAudioChannels(int audioChannels)
audioChannels
- The number of audio channels, AUDIO_CHANNELS_STEREO or AUDIO_CHANNELS_MONO.public int getAudioSampleRate()
public int setAudioSampleRate(int audioSampleRate)
SUPPORTED_AUDIO_SAMPLE_RATES
.
If an invalid rate is specified, the next-highest supported rate will be used instead.audioSampleRate
- The sample rate, in Hz.public int getAudioBitRate()
public void setAudioBitRate(int audioBitRate)
audioBitRate
- The bitrate of the audio stream, in kbps.public boolean isVideoEnabled()
public java.lang.String getHLSBackupURL()
public java.lang.Boolean getIsPlayback()
public void setIsPlayback(boolean isPlayback)
public void setHLSBackupURL(java.lang.String backupURL)
backupURL
- An Apple HLS URL.public java.lang.String getPlayerExampleAutoconfig()
public void setPlayerExampleAutoconfig(java.lang.String configName)
public boolean isHLSEnabled()
public void setHLSEnabled(boolean useHLS)
useHLS
- True to use HLS as the primary playback protocol; false to use HLS as the backup.public void setVideoEnabled(boolean videoEnabled)
videoEnabled
- True to enable video streaming; false otherwise.public boolean isAudioEnabled()
public void setAudioEnabled(boolean audioEnabled)
audioEnabled
- True to enable audio streaming; false otherwise.public java.lang.String getPresetLabel()
public java.lang.String getPresetLabelByFrameSize()
public java.lang.String getLabel(boolean withFrameSize, boolean withPreset, boolean withBitrate)
public java.lang.String getLabel(boolean withFrameSize, boolean withPreset, boolean withAspect, boolean withBitrate)
withFrameSize
- Indicates whether the frame size should be included.withPreset
- Indicates whether the preset label for the frame size should be included.withAspect
- Indicates whether the aspect ratio should be displayed with the frame size.withBitrate
- Indicates whether the video bitrate should be included.public java.lang.String toString()
toString
in class java.lang.Object
public WOWZDataMap toDataMap(WOWZDataMap dataMap)
dataMap
- A previously allocated data map in which to add the configuration properties.public WOWZDataMap toDataMap()
© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal