Skip to content

Commit

Permalink
updated ss4s
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jun 11, 2023
1 parent 4f7dfc6 commit fc1cbf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions app/backend/stream/stream_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ stream_media_session_t *stream_media_create(stream_manager_t *manager) {
media_session->manager = manager;
media_session->lock = SDL_CreateMutex();
media_session->player = SS4S_PlayerOpen();
SS4S_PlayerSetWaitAudioVideoReady(media_session->player, true);

SS4S_GetVideoCapabilities(&media_session->video_cap);
return media_session;
Expand Down Expand Up @@ -123,7 +124,7 @@ const IHS_StreamVideoCallbacks *stream_media_video_callbacks() {
static int audio_start(IHS_Session *session, const IHS_StreamAudioConfig *config, void *context) {
(void) session;
commons_log_info("Media", "Audio start. codec=%u, channels=%u, sampleRate=%u", config->codec,
config->channels, config->frequency);
config->channels, config->frequency);
if (config->codec != IHS_StreamAudioCodecOpus) {
return -1;
}
Expand Down Expand Up @@ -182,7 +183,8 @@ static int video_start(IHS_Session *session, const IHS_StreamVideoConfig *config
}
stream_media_session_t *media_session = (stream_media_session_t *) context;
SDL_LockMutex(media_session->lock);
commons_log_info("Media", "Video start. codec=%u, width=%u, height=%u", config->codec, config->width, config->height);
commons_log_info("Media", "Video start. codec=%u, width=%u, height=%u", config->codec, config->width,
config->height);
SS4S_VideoInfo info = {
.codec = codec,
.width = (int) config->width,
Expand Down Expand Up @@ -219,7 +221,7 @@ static int video_submit(IHS_Session *session, IHS_Buffer *data, IHS_StreamVideoF
}
default: {
commons_log_fatal("Media", "Unexpected video codec %s!!",
SS4S_VideoCodecName(media_session->video_info.codec));
SS4S_VideoCodecName(media_session->video_info.codec));
abort();
}
}
Expand All @@ -230,8 +232,8 @@ static int video_submit(IHS_Session *session, IHS_Buffer *data, IHS_StreamVideoF
if (dimension_parsed && (dimension.width != media_session->video_info.width ||
dimension.height != media_session->video_info.height)) {
commons_log_info("Media", "Size change detected by NAL header. (%d*%d)=>(%d*%d)",
media_session->video_info.width, media_session->video_info.height, dimension.width,
dimension.height);
media_session->video_info.width, media_session->video_info.height, dimension.width,
dimension.height);
media_session->video_info.width = dimension.width;
media_session->video_info.height = dimension.height;
SS4S_PlayerVideoSizeChanged(media_session->player, dimension.width, dimension.height);
Expand Down
4 changes: 2 additions & 2 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) {

#if IHSPLAY_FEATURE_LIBCEC
cec_sdl_ctx_t cec;
cec_sdl_init(&cec);
cec_sdl_init(&cec, "IHSplay");
#endif

while (app->running) {
Expand Down Expand Up @@ -181,7 +181,7 @@ static void process_events() {
}

static void logging_init() {
commons_logging_init();
commons_logging_init("ihsplay");
lv_log_register_print_cb(app_lv_log);
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
SDL_LogSetOutputFunction(app_sdl_log, NULL);
Expand Down

0 comments on commit fc1cbf1

Please sign in to comment.