-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attach VideoDecoder to depacketizer instead of source
- Loading branch information
1 parent
8bd61c0
commit 14c3c1a
Showing
2 changed files
with
12 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,13 @@ | ||
%{ | ||
%include "MediaFrame.i" | ||
|
||
class VideoDecoderFacade : public VideoDecoderWorker | ||
{ | ||
public: | ||
VideoDecoderFacade() = default; | ||
~VideoDecoderFacade() | ||
{ | ||
//Remove listener from old stream | ||
if (this->incoming) | ||
this->incoming->RemoveListener(this); | ||
} | ||
|
||
bool SetIncoming(const RTPIncomingMediaStream::shared& incoming) | ||
{ | ||
//If they are the same | ||
if (this->incoming==incoming) | ||
//DO nothing | ||
return false; | ||
//Remove listener from old stream | ||
if (this->incoming) | ||
this->incoming->RemoveListener(this); | ||
|
||
//Store stream and receiver | ||
this->incoming = incoming; | ||
//Double check | ||
if (this->incoming) | ||
//Add us as listeners | ||
this->incoming->AddListener(this); | ||
|
||
//OK | ||
return true; | ||
} | ||
|
||
int Stop() | ||
{ | ||
SetIncoming(nullptr); | ||
return VideoDecoderWorker::Stop(); | ||
} | ||
|
||
private: | ||
RTPIncomingMediaStream::shared incoming; | ||
}; | ||
|
||
|
||
%} | ||
|
||
%include "RTPIncomingMediaStream.i" | ||
|
||
struct VideoDecoderFacade | ||
struct VideoDecoderWorker | ||
{ | ||
int Start(); | ||
void AddVideoOutput(VideoOutput* ouput); | ||
void RemoveVideoOutput(VideoOutput* ouput); | ||
bool SetIncoming(const RTPIncomingMediaStreamShared& incoming); | ||
int Stop(); | ||
}; | ||
|
||
SHARED_PTR_BEGIN(VideoDecoderWorker) | ||
{ | ||
SHARED_PTR_TO(MediaFrameListener) | ||
} | ||
SHARED_PTR_END(VideoDecoderWorker) |