Merge pull request #18043 from gustavotrott/graphql-camera-as-content

refactor (graphql-server): Provide data introduced for "camera as content"
This commit is contained in:
Gustavo Trott 2023-05-30 10:04:07 -03:00 committed by GitHub
commit 22cd5e5f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.db
import org.bigbluebutton.core.apps.ScreenshareModel
import org.bigbluebutton.core.apps.ScreenshareModel.{ getHasAudio, getRTMPBroadcastingUrl, getScreenshareConf, getScreenshareVideoHeight, getScreenshareVideoWidth, getVoiceConf }
import org.bigbluebutton.core.apps.ScreenshareModel.{ getContentType, getHasAudio, getRTMPBroadcastingUrl, getScreenshareConf, getScreenshareVideoHeight, getScreenshareVideoWidth, getVoiceConf }
import org.bigbluebutton.core.util.RandomStringGenerator
import slick.jdbc.PostgresProfile.api._
import slick.lifted.ProvenShape
@ -14,12 +14,13 @@ case class ScreenshareDbModel(
meetingId: String,
voiceConf: String,
screenshareConf: String,
contentType: String,
stream: String,
vidWidth: Int,
vidHeight: Int,
hasAudio: Boolean,
startedAt: java.sql.Timestamp = new java.sql.Timestamp(System.currentTimeMillis()),
stoppedAt: Option[java.sql.Timestamp],
hasAudio: Boolean
stoppedAt: Option[java.sql.Timestamp]
)
class ScreenshareDbTableDef(tag: Tag) extends Table[ScreenshareDbModel](tag, "screenshare") {
@ -27,13 +28,14 @@ class ScreenshareDbTableDef(tag: Tag) extends Table[ScreenshareDbModel](tag, "sc
val meetingId = column[String]("meetingId")
val voiceConf = column[String]("voiceConf")
val screenshareConf = column[String]("screenshareConf")
val contentType = column[String]("contentType")
val stream = column[String]("stream")
val vidWidth = column[Int]("vidWidth")
val vidHeight = column[Int]("vidHeight")
val hasAudio = column[Boolean]("hasAudio")
val startedAt = column[java.sql.Timestamp]("startedAt")
val stoppedAt = column[Option[java.sql.Timestamp]]("stoppedAt")
val hasAudio = column[Boolean]("hasAudio")
override def * : ProvenShape[ScreenshareDbModel] = (screenshareId, meetingId, voiceConf, screenshareConf, stream, vidWidth, vidHeight, startedAt, stoppedAt, hasAudio) <> (ScreenshareDbModel.tupled, ScreenshareDbModel.unapply)
override def * : ProvenShape[ScreenshareDbModel] = (screenshareId, meetingId, voiceConf, screenshareConf, contentType, stream, vidWidth, vidHeight, hasAudio, startedAt, stoppedAt) <> (ScreenshareDbModel.tupled, ScreenshareDbModel.unapply)
}
object ScreenshareDAO {
@ -45,12 +47,13 @@ object ScreenshareDAO {
meetingId = meetingId,
voiceConf = getVoiceConf(screenshareModel),
screenshareConf = getScreenshareConf(screenshareModel),
contentType = getContentType(screenshareModel),
stream = getRTMPBroadcastingUrl(screenshareModel),
vidWidth = getScreenshareVideoWidth(screenshareModel),
vidHeight = getScreenshareVideoHeight(screenshareModel),
hasAudio = getHasAudio(screenshareModel),
startedAt = new java.sql.Timestamp(System.currentTimeMillis()),
stoppedAt = None,
hasAudio = getHasAudio(screenshareModel)
stoppedAt = None
)
)
).onComplete {

View File

@ -933,12 +933,14 @@ create table "screenshare"(
"meetingId" varchar(100) REFERENCES "meeting"("meetingId") ON DELETE CASCADE,
"voiceConf" varchar(50),
"screenshareConf" varchar(50),
"contentType" varchar(50),
"stream" varchar(100),
"vidWidth" integer,
"vidHeight" integer,
"hasAudio" boolean,
"startedAt" timestamp,
"stoppedAt" timestamp,
"hasAudio" boolean
"stoppedAt" timestamp
);
create index "screenshare_meetingId" on "screenshare"("meetingId");
create index "screenshare_meetingId_current" on "screenshare"("meetingId") WHERE "stoppedAt" IS NULL;