Skip to content

Commit

Permalink
call: add a getter for local stream directions
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 12, 2024
1 parent b83dc0a commit 2e42cba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/baresip.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ const struct list *call_get_custom_hdrs(const struct call *call);
void call_set_media_direction(struct call *call, enum sdp_dir a,
enum sdp_dir v);
void call_set_mdir(struct call *call, enum sdp_dir a, enum sdp_dir v);
void call_get_mdir(struct call *call, enum sdp_dir *ap, enum sdp_dir *vp);
void call_set_media_estdir(struct call *call, enum sdp_dir a, enum sdp_dir v);
void call_start_answtmr(struct call *call, uint32_t ms);
bool call_supported(struct call *call, uint16_t tags);
Expand Down
24 changes: 24 additions & 0 deletions src/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -3050,6 +3050,30 @@ void call_set_mdir(struct call *call, enum sdp_dir a, enum sdp_dir v)
}


/**
* Returns local audio and video directions
*
* @param call Call object
* @param ap Pointer for returning local audio direction
* @param vp Pointer for returning local video direction
*/
void call_get_mdir(struct call *call, enum sdp_dir *ap, enum sdp_dir *vp)
{
struct stream *strm;

if (!call)
return;

strm = audio_strm(call_audio(call));
if (strm && ap)
*ap = stream_ldir(strm);

strm = video_strm(call_video(call));
if (strm && vp)
*vp = stream_ldir(strm);
}


/**
* Set audio/video direction during pre-established for the established state
*
Expand Down

0 comments on commit 2e42cba

Please sign in to comment.