Commit c1ce97c0 authored by François Grisez's avatar François Grisez
Browse files

Add private attributes in FuAggregatorInterface and ApSpliterInterface

parent 0c088b68
......@@ -25,25 +25,16 @@ namespace mediastreamer {
class H264FuaAggregator: public NalUnpacker::FuAggregatorInterface {
public:
~H264FuaAggregator() {if (_m) freemsg(_m);}
mblk_t *feed(mblk_t *im) override;
bool isAggregating() const override {return _m != nullptr;}
void reset() override;
mblk_t *completeAggregation() override;
private:
mblk_t *_m = nullptr;
};
class H264StapaSpliter: public NalUnpacker::ApSpliterInterface {
public:
H264StapaSpliter() {ms_queue_init(&_q);}
~H264StapaSpliter() {ms_queue_flush(&_q);}
void feed(mblk_t *im) override;
MSQueue *getNalus() override {return &_q;}
private:
MSQueue _q;
};
class H264NalUnpacker: public NalUnpacker {
......
......@@ -30,26 +30,16 @@ public:
private:
class FuAggregator: public NalUnpacker::FuAggregatorInterface {
public:
~FuAggregator() {if (_m != nullptr) freemsg(_m);}
mblk_t *feed(mblk_t *packet) override;
bool isAggregating() const override {return _m != nullptr;}
void reset() override;
mblk_t *completeAggregation() override;
private:
mblk_t *_m = nullptr;
};
class ApSpliter: public NalUnpacker::ApSpliterInterface {
public:
ApSpliter() {ms_queue_init(&_q);}
~ApSpliter() {ms_queue_flush(&_q);}
void feed(mblk_t *packet) override;
MSQueue *getNalus() override {return &_q;}
private:
MSQueue _q;
};
};
......
......@@ -39,24 +39,29 @@ public:
class FuAggregatorInterface {
public:
virtual ~FuAggregatorInterface() = default;
virtual ~FuAggregatorInterface() {if (_m) freemsg(_m);}
virtual mblk_t *feed(mblk_t *packet) = 0;
virtual bool isAggregating() const = 0;
virtual void reset() = 0;
virtual mblk_t *completeAggregation() = 0;
protected:
mblk_t *_m = nullptr;
};
class ApSpliterInterface {
public:
virtual ~ApSpliterInterface() = default;
ApSpliterInterface() {ms_queue_init(&_q);}
virtual ~ApSpliterInterface() {ms_queue_flush(&_q);}
virtual void feed(mblk_t *packet) = 0;
virtual MSQueue *getNalus() = 0;
protected:
MSQueue _q;
};
NalUnpacker(FuAggregatorInterface *aggregator, ApSpliterInterface *spliter);
virtual ~NalUnpacker() {
ms_queue_flush(&_q);
}
virtual ~NalUnpacker() {ms_queue_flush(&_q);}
/**
* Process incoming rtp data and output NALUs, whenever possible.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment