Skip to content

Commit

Permalink
add callback on session end
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Dec 29, 2024
1 parent bd5f554 commit 2166f6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/SessionSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SessionCallback

public:
virtual bool onNewSession(const char* id, const char* media, const char* codec, const char* sdp, unsigned int rtpfrequency, unsigned int channels) { return true; }
virtual void onCloseSession(const char* id) { }
virtual bool onData(const char* id, unsigned char* buffer, ssize_t size, struct timeval presentationTime) = 0;
virtual ssize_t onNewBuffer(const char* id, const char* mime, unsigned char* buffer, ssize_t size) {
ssize_t markerSize = 0;
Expand Down
1 change: 1 addition & 0 deletions src/SessionSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SessionSink::SessionSink(UsageEnvironment& env, SessionCallback* callback, size_

SessionSink::~SessionSink()
{
m_callback->onCloseSession(this->name());
delete [] m_buffer;
}

Expand Down

0 comments on commit 2166f6e

Please sign in to comment.