@@ -453,12 +453,25 @@ static struct janus_plugin_result *_plugin_handle_message(
453
453
454
454
} else if (!strcmp (request_str , "watch" )) {
455
455
bool with_audio = false;
456
+ uint video_orient = 0 ;
456
457
{
457
458
json_t * const params = json_object_get (msg , "params" );
458
459
if (params != NULL ) {
459
- json_t * const audio = json_object_get (params , "audio" );
460
- if (audio != NULL && json_is_boolean (audio )) {
461
- with_audio = (_g_rtpa != NULL && json_boolean_value (audio ));
460
+ {
461
+ json_t * const obj = json_object_get (params , "audio" );
462
+ if (obj != NULL && json_is_boolean (obj )) {
463
+ with_audio = (_g_rtpa != NULL && json_boolean_value (obj ));
464
+ }
465
+ }
466
+ {
467
+ json_t * const obj = json_object_get (params , "orientation" );
468
+ if (obj != NULL && json_is_integer (obj )) {
469
+ video_orient = json_integer_value (obj );
470
+ switch (video_orient ) {
471
+ case 90 : case 180 : case 270 : break ;
472
+ default : video_orient = 0 ; break ;
473
+ }
474
+ }
462
475
}
463
476
}
464
477
}
@@ -498,6 +511,7 @@ static struct janus_plugin_result *_plugin_handle_message(
498
511
US_LIST_ITERATE (_g_clients , client , {
499
512
if (client -> session == session ) {
500
513
atomic_store (& client -> transmit_audio , with_audio );
514
+ atomic_store (& client -> video_orient , video_orient );
501
515
}
502
516
has_listeners = (has_listeners || atomic_load (& client -> transmit_audio ));
503
517
});
0 commit comments