Package io.antmedia.datastore.db.types
Class Broadcast
java.lang.Object
io.antmedia.datastore.db.types.Broadcast
@Entity("broadcast")
@Index(fields=@Field(value="name",type=TEXT)) @Index(fields=@Field("streamId"),options=@IndexOptions(unique=true,name="streamId_unique_index")) @Index(fields=@Field("status"))
public class Broadcast
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate Stringprivate booleanprivate longprivate Stringprivate intCurrent playing index for play listsprivate intnumber of dash viewers of the streamprivate intprivate longdate when record is created in millisecondsprivate org.bson.types.ObjectIdprivate Stringdescription of the broadcastprivate intprivate intprivate longduration of the stream in millisecondsprivate intprivate List<EncoderSettings>private intThis is the expire time in milliseconds For instance if this value is 10000 then broadcast should be started in 10 seconds after it is created.private intprivate Broadcast.HLSParametersprivate intnumber of hls viewers of the streamprivate intprivate Stringprivate booleanIf this stream is a 360 degree videoprivate intprivate Stringprivate StringThis is the url that will be notified when stream is published, ended and muxing finished It sends some variables with POST UrlEncodedForm variables are "id" mandatory This is the id of the broadcast "action" mandatory This parameter defines what happened.private Stringprivate Stringprivate intThis parameter indicates the maximum idle time in seconds without updating the broadcast If broadcast is not updated as long as this value, webhook is firedprivate StringMeta data filed for the custom usageprivate intMp4 muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the streamprivate Stringname of the broadcastprivate StringThis is the origin address server broadcasting.private doubleprivate intprivate Stringprivate intNumber of audio and video packets that is being pending to be encoded in the queueprivate longPlanned end date unix timestamp in seconds This parameter is not mandatory, default parameter is null This feature is enabled in RTMP and WebRTC streams Streams are accepting when plannedEndDate is higher than now(Unix Timestamp)private longPlanned start date unix timestamp in seconds This parameter is not mandatory, default parameter is null This feature is enabled in RTMP and WebRTC streams Streams are accepting when plannedStartDate is lower than now(Unix Timestamp)private List<Broadcast.PlayListItem>private booleanThe flag to enable/disable looping playlist.private Stringprivate booleanis publicprivate booleanIt is a video filter for the service, this value is controlled by the user, default value is true in the dbprivate String"WebRTC", "RTMP", "Pull"private Stringprivate longprivate Stringprivate StringBroadcast role for selective playbackprivate StringRTMP URL where to publish live stream toprivate intprivate intprivate longInitial time to start playing.private doubleprivate longprivate String"finished", "broadcasting", "created"private Stringid of the broadcastprivate StringThis is the stream url for fetching stream.private Stringprivate intThe number of subtracks that is allowed to be created for the broadcast.private String"liveStream", "ipCamera", "streamSource", "VoD"private longUpdate time of the Broadcast object This parameter updates consistently according to broadcast statusprivate Stringprivate Stringprivate booleanIf this broadcast is a virtual or not.private intWebM muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the streamprivate intprivate intprivate intprivate booleanzombi It is true, if a broadcast that is not added to data store through rest service or management console It is false by default -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongintintintlonggetDate()org.bson.types.ObjectIdgetDbId()intintlongintintintintintintintintgetName()doubleintintlonglonglonggetRole()intintgetRttMs()longdoublegetSpeed()longintgetType()longintintintintgetWidth()booleanbooleanbooleanisIs360()booleanbooleanbooleanbooleanbooleanisZombi()voidvoidsetAbsoluteStartTimeMs(long absoluteStartTimeMs) voidsetAltitude(String altitude) voidsetAutoStartStopEnabled(boolean autoStartStopEnabled) voidsetBitrate(long bitrate) voidsetCategory(String category) voidsetCurrentPlayIndex(int currentPlayIndex) voidsetDashViewerCount(int dashViewerCount) voidsetDashViewerLimit(int dashViewerLimit) voidsetDate(long date) voidsetDbId(org.bson.types.ObjectId dbId) voidsetDescription(String description) voidsetDropFrameCountInEncoding(int dropFrameCountInEncoding) voidsetDropPacketCountInIngestion(int dropPacketCountInIngestion) voidsetDuration(Long duration) voidsetEncoderQueueSize(int encoderQueueSize) voidsetEncoderSettingsList(List<EncoderSettings> encoderSettingsList) voidsetEndPointList(List<Endpoint> endPointList) voidsetExpireDurationMS(int expireDurationMS) voidsetHeight(int height) voidsetHlsParameters(Broadcast.HLSParameters hlsParameters) voidsetHlsViewerCount(int hlsViewerCount) voidsetHlsViewerLimit(int hlsViewerLimit) voidvoidsetIs360(boolean is360) voidsetJitterMs(int jitterMs) voidsetLatitude(String latitude) voidsetListenerHookURL(String listenerHookURL) voidsetLongitude(String longitude) voidsetMainTrackStreamId(String mainTrackStreamId) voidsetMaxIdleTime(int maxIdleTime) voidsetMetaData(String metaData) voidsetMp4Enabled(int mp4Enabled) voidvoidsetOriginAdress(String originAdress) voidsetPacketLostRatio(double packetLostRatio) voidsetPacketsLost(int packetsLost) voidsetPassword(String password) voidsetPendingPacketSize(int pendingPacketSize) voidsetPlannedEndDate(long plannedEndDate) voidsetPlannedStartDate(long plannedStartDate) voidsetPlayListItemList(List<Broadcast.PlayListItem> playListItemList) voidsetPlaylistLoopEnabled(boolean playlistLoopEnabled) voidsetPlayListStatus(String playListStatus) voidsetPublicStream(boolean publicStream) voidsetPublish(boolean publish) voidsetPublishType(String publishType) voidsetQuality(String quality) voidsetReceivedBytes(long receivedBytes) voidsetRemoteIp(String remoteIp) voidvoidsetRtmpURL(String rtmpURL) voidsetRtmpViewerCount(int rtmpViewerCount) voidsetRttMs(int rttMs) voidsetSeekTimeInMs(long seekTimeInMs) voidsetSpeed(double speed) voidsetStartTime(long startTime) voidPay attention to the status field.voidsetStreamId(String id) voidsetStreamUrl(String streamUrl) voidsetSubFolder(String subFolder) voidsetSubtracksLimit(int subtracksLimit) voidvoidsetUpdateTime(long updateTime) voidsetUserAgent(String userAgent) voidsetUsername(String username) voidsetVirtual(boolean virtual) voidsetWebMEnabled(int webMEnabled) voidsetWebRTCViewerCount(int webRTCViewerCount) voidsetWebRTCViewerLimit(int webRTCViewerLimit) voidsetWidth(int width) voidsetZombi(boolean zombi)
-
Field Details
-
dbId
@Id private org.bson.types.ObjectId dbId -
streamId
id of the broadcast -
status
"finished", "broadcasting", "created" -
playListStatus
-
type
"liveStream", "ipCamera", "streamSource", "VoD" -
publishType
"WebRTC", "RTMP", "Pull" -
name
name of the broadcast -
description
description of the broadcast -
publish
private boolean publishIt is a video filter for the service, this value is controlled by the user, default value is true in the db -
date
private long datedate when record is created in milliseconds -
plannedStartDate
private long plannedStartDatePlanned start date unix timestamp in seconds This parameter is not mandatory, default parameter is null This feature is enabled in RTMP and WebRTC streams Streams are accepting when plannedStartDate is lower than now(Unix Timestamp) -
plannedEndDate
private long plannedEndDatePlanned end date unix timestamp in seconds This parameter is not mandatory, default parameter is null This feature is enabled in RTMP and WebRTC streams Streams are accepting when plannedEndDate is higher than now(Unix Timestamp) -
duration
private long durationduration of the stream in milliseconds -
endPointList
-
playListItemList
-
publicStream
private boolean publicStreamis public -
is360
private boolean is360If this stream is a 360 degree video -
listenerHookURL
This is the url that will be notified when stream is published, ended and muxing finished It sends some variables with POST UrlEncodedForm variables are "id" mandatory This is the id of the broadcast "action" mandatory This parameter defines what happened. Values can be "liveStreamStarted" this parameter is sent when stream is started "liveStreamEnded" this parameter is sent when stream is finished "vodReady" this parameter is sent when vod(mp4) file ready. It is typically a few seconds later after "liveStreamEnded" "vodName" It is sent with "vodReady" action. This is the name of the file physicall recorded file "streamName" optional It is sent with above parameters if stream name exists "category" optional It is sent if category exists -
category
-
ipAddr
-
username
-
password
-
quality
-
speed
private double speed -
streamUrl
This is the stream url for fetching stream. It has a value for IPCameras and streams in the cloud -
originAdress
This is the origin address server broadcasting. -
mp4Enabled
private int mp4EnabledMp4 muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the stream -
webMEnabled
private int webMEnabledWebM muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the stream -
seekTimeInMs
private long seekTimeInMsInitial time to start playing. It can be used in VoD file or stream sources that has seek support If it's a VoD file, it can seek to that time and start playing there -
subtracksLimit
private int subtracksLimitThe number of subtracks that is allowed to be created for the broadcast. It's useful for limiting number of conference attendees. Default value is -1 and -1 means no limit -
expireDurationMS
private int expireDurationMSThis is the expire time in milliseconds For instance if this value is 10000 then broadcast should be started in 10 seconds after it is created. If expire duration is 0, then stream will never expire -
rtmpURL
RTMP URL where to publish live stream to -
zombi
private boolean zombizombi It is true, if a broadcast that is not added to data store through rest service or management console It is false by default -
pendingPacketSize
private int pendingPacketSizeNumber of audio and video packets that is being pending to be encoded in the queue -
hlsViewerCount
private int hlsViewerCountnumber of hls viewers of the stream -
dashViewerCount
private int dashViewerCountnumber of dash viewers of the stream -
webRTCViewerCount
private int webRTCViewerCount -
rtmpViewerCount
private int rtmpViewerCount -
startTime
private long startTime -
receivedBytes
private long receivedBytes -
bitrate
private long bitrate -
width
private int width -
height
private int height -
encoderQueueSize
private int encoderQueueSize -
dropPacketCountInIngestion
private int dropPacketCountInIngestion -
dropFrameCountInEncoding
private int dropFrameCountInEncoding -
packetLostRatio
private double packetLostRatio -
packetsLost
private int packetsLost -
jitterMs
private int jitterMs -
rttMs
private int rttMs -
userAgent
-
remoteIp
-
latitude
-
longitude
-
altitude
-
mainTrackStreamId
-
absoluteStartTimeMs
private long absoluteStartTimeMs -
webRTCViewerLimit
private int webRTCViewerLimit -
hlsViewerLimit
private int hlsViewerLimit -
dashViewerLimit
private int dashViewerLimit -
subFolder
-
currentPlayIndex
private int currentPlayIndexCurrent playing index for play lists -
metaData
Meta data filed for the custom usage -
playlistLoopEnabled
private boolean playlistLoopEnabledThe flag to enable/disable looping playlist. If it's true, playlist will be loop infinitely. If it's false, playlist played once and finished. It's enable by default -
updateTime
private long updateTimeUpdate time of the Broadcast object This parameter updates consistently according to broadcast status -
role
Broadcast role for selective playback -
hlsParameters
-
autoStartStopEnabled
private boolean autoStartStopEnabled -
encoderSettingsList
-
virtual
private boolean virtualIf this broadcast is a virtual or not. For the conference calls, broadcasts are virtual. It means that they are not real streams but they are just a reference to the main stream. On the other hand, virtual streams can be real streams as well. -
maxIdleTime
private int maxIdleTimeThis parameter indicates the maximum idle time in seconds without updating the broadcast If broadcast is not updated as long as this value, webhook is fired
-
-
Constructor Details
-
Broadcast
public Broadcast() -
Broadcast
-
Broadcast
-
Broadcast
-
-
Method Details
-
getStreamId
-
setStreamId
- Throws:
Exception
-
getSpeed
public double getSpeed() -
setSpeed
public void setSpeed(double speed) -
getQuality
-
setQuality
-
getStatus
-
setStatus
Pay attention to the status field. Even if you set to BROADCASTING, it will check last update time to understand if it's really broadcasting Check thegetStatus()- Parameters:
status-
-
getName
-
setName
-
getDescription
-
setDescription
-
isPublish
public boolean isPublish() -
setPublish
public void setPublish(boolean publish) -
getDate
public long getDate() -
setDate
public void setDate(long date) -
getPlannedStartDate
public long getPlannedStartDate() -
setPlannedStartDate
public void setPlannedStartDate(long plannedStartDate) -
getPlannedEndDate
public long getPlannedEndDate() -
setPlannedEndDate
public void setPlannedEndDate(long plannedEndDate) -
getDuration
public long getDuration() -
setDuration
-
getEndPointList
-
setEndPointList
-
isIs360
public boolean isIs360() -
setIs360
public void setIs360(boolean is360) -
isPublicStream
public boolean isPublicStream() -
setPublicStream
public void setPublicStream(boolean publicStream) -
getListenerHookURL
-
setListenerHookURL
-
getCategory
-
setCategory
-
getType
-
setType
-
getIpAddr
-
setIpAddr
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getExpireDurationMS
public int getExpireDurationMS() -
setExpireDurationMS
public void setExpireDurationMS(int expireDurationMS) -
getRtmpURL
-
setRtmpURL
-
getDbId
public org.bson.types.ObjectId getDbId() -
setDbId
public void setDbId(org.bson.types.ObjectId dbId) -
isZombi
public boolean isZombi() -
setZombi
public void setZombi(boolean zombi) -
resetStreamId
public void resetStreamId() -
getStreamUrl
-
setStreamUrl
-
getHlsViewerCount
public int getHlsViewerCount() -
setHlsViewerCount
public void setHlsViewerCount(int hlsViewerCount) -
getWebRTCViewerCount
public int getWebRTCViewerCount() -
setWebRTCViewerCount
public void setWebRTCViewerCount(int webRTCViewerCount) -
getRtmpViewerCount
public int getRtmpViewerCount() -
setRtmpViewerCount
public void setRtmpViewerCount(int rtmpViewerCount) -
getPendingPacketSize
public int getPendingPacketSize() -
setPendingPacketSize
public void setPendingPacketSize(int pendingPacketSize) -
getOriginAdress
-
setOriginAdress
-
getMp4Enabled
public int getMp4Enabled() -
setMp4Enabled
public void setMp4Enabled(int mp4Enabled) -
getStartTime
public long getStartTime() -
setStartTime
public void setStartTime(long startTime) -
getReceivedBytes
public long getReceivedBytes() -
setReceivedBytes
public void setReceivedBytes(long receivedBytes) -
getBitrate
public long getBitrate() -
setBitrate
public void setBitrate(long bitrate) -
getUserAgent
-
setUserAgent
-
getLatitude
-
setLatitude
-
getLongitude
-
setLongitude
-
getAltitude
-
setAltitude
-
getMainTrackStreamId
-
setMainTrackStreamId
-
setAbsoluteStartTimeMs
public void setAbsoluteStartTimeMs(long absoluteStartTimeMs) -
getAbsoluteStartTimeMs
public long getAbsoluteStartTimeMs() -
getWebMEnabled
public int getWebMEnabled() -
setWebMEnabled
public void setWebMEnabled(int webMEnabled) -
getWebRTCViewerLimit
public int getWebRTCViewerLimit() -
setWebRTCViewerLimit
public void setWebRTCViewerLimit(int webRTCViewerLimit) -
getHlsViewerLimit
public int getHlsViewerLimit() -
setHlsViewerLimit
public void setHlsViewerLimit(int hlsViewerLimit) -
getPlayListItemList
-
setPlayListItemList
-
getCurrentPlayIndex
public int getCurrentPlayIndex() -
setCurrentPlayIndex
public void setCurrentPlayIndex(int currentPlayIndex) -
setPlayListStatus
-
getPlayListStatus
-
setSubFolder
-
getSubFolder
-
getPublishType
-
setPublishType
-
getMetaData
-
setMetaData
-
getDashViewerLimit
public int getDashViewerLimit() -
setDashViewerLimit
public void setDashViewerLimit(int dashViewerLimit) -
getDashViewerCount
public int getDashViewerCount() -
setDashViewerCount
public void setDashViewerCount(int dashViewerCount) -
getUpdateTime
public long getUpdateTime() -
setUpdateTime
public void setUpdateTime(long updateTime) -
getHlsParameters
-
setHlsParameters
-
isAnyoneWatching
public boolean isAnyoneWatching() -
isAutoStartStopEnabled
public boolean isAutoStartStopEnabled() -
setAutoStartStopEnabled
public void setAutoStartStopEnabled(boolean autoStartStopEnabled) -
getSeekTimeInMs
public long getSeekTimeInMs() -
setSeekTimeInMs
public void setSeekTimeInMs(long seekTimeInMs) -
getSubtracksLimit
public int getSubtracksLimit() -
setSubtracksLimit
public void setSubtracksLimit(int subtracksLimit) -
getEncoderSettingsList
-
setEncoderSettingsList
-
getRole
-
setRole
-
isPlaylistLoopEnabled
public boolean isPlaylistLoopEnabled() -
setPlaylistLoopEnabled
public void setPlaylistLoopEnabled(boolean playlistLoopEnabled) -
getWidth
public int getWidth()- Returns:
- the width
-
setWidth
public void setWidth(int width) - Parameters:
width- the width to set
-
getHeight
public int getHeight()- Returns:
- the height
-
setHeight
public void setHeight(int height) - Parameters:
height- the height to set
-
getEncoderQueueSize
public int getEncoderQueueSize()- Returns:
- the encoderQueueSize
-
setEncoderQueueSize
public void setEncoderQueueSize(int encoderQueueSize) - Parameters:
encoderQueueSize- the encoderQueueSize to set
-
getDropPacketCountInIngestion
public int getDropPacketCountInIngestion()- Returns:
- the dropPacketCountInIngestion
-
setDropPacketCountInIngestion
public void setDropPacketCountInIngestion(int dropPacketCountInIngestion) - Parameters:
dropPacketCountInIngestion- the dropPacketCountInIngestion to set
-
getDropFrameCountInEncoding
public int getDropFrameCountInEncoding()- Returns:
- the dropFrameCountInEncoding
-
setDropFrameCountInEncoding
public void setDropFrameCountInEncoding(int dropFrameCountInEncoding) - Parameters:
dropFrameCountInEncoding- the dropFrameCountInEncoding to set
-
getPacketLostRatio
public double getPacketLostRatio()- Returns:
- the packetLostRatio
-
setPacketLostRatio
public void setPacketLostRatio(double packetLostRatio) - Parameters:
packetLostRatio- the packetLostRatio to set
-
getJitterMs
public int getJitterMs()- Returns:
- the jitterMs
-
setJitterMs
public void setJitterMs(int jitterMs) - Parameters:
jitterMs- the jitterMs to set
-
getRttMs
public int getRttMs()- Returns:
- the rttMs
-
setRttMs
public void setRttMs(int rttMs) - Parameters:
rttMs- the rttMs to set
-
getPacketsLost
public int getPacketsLost()- Returns:
- the packetsLost
-
setPacketsLost
public void setPacketsLost(int packetsLost) - Parameters:
packetsLost- the packetsLost to set
-
getRemoteIp
- Returns:
- the remoteIp
-
setRemoteIp
- Parameters:
remoteIp- the remoteIp to set
-
isVirtual
public boolean isVirtual()- Returns:
- the virtual
-
setVirtual
public void setVirtual(boolean virtual) - Parameters:
virtual- the virtual to set
-
getMaxIdleTime
public int getMaxIdleTime() -
setMaxIdleTime
public void setMaxIdleTime(int maxIdleTime)
-