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
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private String
private boolean
private long
private String
private String
Deprecated, for removal: This API element is subject to removal in a future version.It's created for backward compatibility.private int
Current playing index for play listsprivate int
number of dash viewers of the streamprivate int
private long
date when record is created in millisecondsprivate org.bson.types.ObjectId
private String
description of the broadcastprivate int
private int
private long
duration of the stream in millisecondsprivate int
private List<EncoderSettings>
private int
This 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 int
private Broadcast.HLSParameters
private int
number of hls viewers of the streamprivate int
private String
private boolean
If this stream is a 360 degree videoprivate int
private String
private String
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.private static final org.slf4j.Logger
private String
private String
private String
Meta data filed for the custom usageprivate int
Mp4 muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the streamprivate String
name of the broadcastprivate String
This is the origin address server broadcasting.private double
private int
private String
private int
Number of audio and video packets that is being pending to be encoded in the queueprivate long
Planned 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 long
Planned 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 boolean
The flag to enable/disable looping playlist.private String
private boolean
is publicprivate boolean
It 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 String
private long
private String
private String
Broadcast role for selective playbackprivate String
RTMP URL where to publish live stream toprivate int
private int
private long
Initial time to start playing.private double
private long
private String
"finished", "broadcasting", "created"private String
id of the broadcastprivate String
This is the stream url for fetching stream.private String
private int
The number of subtracks that is allowed to be created for the broadcast.Deprecated, for removal: This API element is subject to removal in a future version.private String
"liveStream", "ipCamera", "streamSource", "VoD"private long
Update time of the Broadcast object This parameter updates consistently according to broadcast statusprivate String
private String
private boolean
If this broadcast is a virtual or not.private int
WebM muxing is enabled or not for the stream 1 means enabled, -1 means disabled, 0 means no settings for the streamprivate int
private int
private int
private boolean
zombi 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
-
Method Summary
Modifier and TypeMethodDescriptionlong
long
int
int
int
long
getDate()
org.bson.types.ObjectId
getDbId()
int
int
long
int
int
int
int
int
int
int
getName()
double
int
int
long
long
long
getRole()
int
int
getRttMs()
long
double
getSpeed()
long
int
Deprecated, for removal: This API element is subject to removal in a future version.get the subtracks directly from databasegetType()
long
int
int
int
int
getWidth()
boolean
boolean
boolean
isIs360()
boolean
boolean
boolean
boolean
boolean
isZombi()
void
void
setAbsoluteStartTimeMs
(long absoluteStartTimeMs) void
setAltitude
(String altitude) void
setAutoStartStopEnabled
(boolean autoStartStopEnabled) void
setBitrate
(long bitrate) void
setCategory
(String category) void
setConferenceMode
(String conferenceMode) void
setCurrentPlayIndex
(int currentPlayIndex) void
setDashViewerCount
(int dashViewerCount) void
setDashViewerLimit
(int dashViewerLimit) void
setDate
(long date) void
setDbId
(org.bson.types.ObjectId dbId) void
setDescription
(String description) void
setDropFrameCountInEncoding
(int dropFrameCountInEncoding) void
setDropPacketCountInIngestion
(int dropPacketCountInIngestion) void
setDuration
(Long duration) void
setEncoderQueueSize
(int encoderQueueSize) void
setEncoderSettingsList
(List<EncoderSettings> encoderSettingsList) void
setEndPointList
(List<Endpoint> endPointList) void
setExpireDurationMS
(int expireDurationMS) void
setHeight
(int height) void
setHlsParameters
(Broadcast.HLSParameters hlsParameters) void
setHlsViewerCount
(int hlsViewerCount) void
setHlsViewerLimit
(int hlsViewerLimit) void
void
setIs360
(boolean is360) void
setJitterMs
(int jitterMs) void
setLatitude
(String latitude) void
setListenerHookURL
(String listenerHookURL) void
setLongitude
(String longitude) void
setMainTrackStreamId
(String mainTrackStreamId) void
setMetaData
(String metaData) void
setMp4Enabled
(int mp4Enabled) void
void
setOriginAdress
(String originAdress) void
setPacketLostRatio
(double packetLostRatio) void
setPacketsLost
(int packetsLost) void
setPassword
(String password) void
setPendingPacketSize
(int pendingPacketSize) void
setPlannedEndDate
(long plannedEndDate) void
setPlannedStartDate
(long plannedStartDate) void
setPlayListItemList
(List<Broadcast.PlayListItem> playListItemList) void
setPlaylistLoopEnabled
(boolean playlistLoopEnabled) void
setPlayListStatus
(String playListStatus) void
setPublicStream
(boolean publicStream) void
setPublish
(boolean publish) void
setPublishType
(String publishType) void
setQuality
(String quality) void
setReceivedBytes
(long receivedBytes) void
setRemoteIp
(String remoteIp) void
void
setRtmpURL
(String rtmpURL) void
setRtmpViewerCount
(int rtmpViewerCount) void
setRttMs
(int rttMs) void
setSeekTimeInMs
(long seekTimeInMs) void
setSpeed
(double speed) void
setStartTime
(long startTime) void
Pay attention to the status field.void
setStreamId
(String id) void
setStreamUrl
(String streamUrl) void
setSubFolder
(String subFolder) void
setSubtracksLimit
(int subtracksLimit) void
setSubTrackStreamIds
(List<String> subTrackStreamIds) Deprecated, for removal: This API element is subject to removal in a future version.get the subtracks directly from databasevoid
void
setUpdateTime
(long updateTime) void
setUserAgent
(String userAgent) void
setUsername
(String username) void
setVirtual
(boolean virtual) void
setWebMEnabled
(int webMEnabled) void
setWebRTCViewerCount
(int webRTCViewerCount) void
setWebRTCViewerLimit
(int webRTCViewerLimit) void
setWidth
(int width) void
setZombi
(boolean zombi)
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
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 -
conferenceMode
Deprecated, for removal: This API element is subject to removal in a future version.It's created for backward compatibility. It will be deleted.Conference mode of the stream. -
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
-
subTrackStreamIds
Deprecated, for removal: This API element is subject to removal in a future version. -
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.
-
-
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
-
getSubTrackStreamIds
Deprecated, for removal: This API element is subject to removal in a future version.get the subtracks directly from database- Returns:
-
setSubTrackStreamIds
@Deprecated(forRemoval=true, since="2.10.1") public void setSubTrackStreamIds(List<String> subTrackStreamIds) Deprecated, for removal: This API element is subject to removal in a future version.get the subtracks directly from database- Parameters:
subTrackStreamIds
-
-
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) -
getConferenceMode
-
setConferenceMode
-
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
-