Notify on source and sink create and destroy.

This commit is contained in:
Peter Johnson
2016-11-18 08:49:20 -08:00
parent 154ae5dcbf
commit b245725941
5 changed files with 30 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
#include "SinkImpl.h"
#include "SourceImpl.h"
#include "Handle.h"
#include "Notifier.h"
using namespace cs;
@@ -341,7 +342,11 @@ void ReleaseSource(CS_Source source, CS_Status* status) {
*status = CS_INVALID_HANDLE;
return;
}
if (data->refCount-- == 0) inst.Free(source);
if (data->refCount-- == 0) {
Notifier::GetInstance().NotifySource(data->source->GetName(), source,
CS_SOURCE_DESTROYED);
inst.Free(source);
}
}
//
@@ -450,7 +455,11 @@ void ReleaseSink(CS_Sink sink, CS_Status* status) {
*status = CS_INVALID_HANDLE;
return;
}
if (data->refCount-- == 0) inst.Free(sink);
if (data->refCount-- == 0) {
Notifier::GetInstance().NotifySink(data->sink->GetName(), sink,
CS_SINK_DESTROYED);
inst.Free(sink);
}
}
//