add padd pl emements
git-svn-id: http://192.168.1.226/svn/proxy@29 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | uint8_t buffer[1920*1080*4];
|
| | | size_t buffSize;
|
| | | size_t buffSizeMax;
|
| | | |
| | | AVFormatContext* pAVFormatContext;//#todo delete
|
| | |
|
| | | bool payError;
|
| | |
|
| | | PL_AVFrameBGRA_Internal() :
|
| | | buffSize(0), buffSizeMax(sizeof(buffer)),
|
| | | pAVFormatContext(nullptr), payError(true)
|
| | | payError(true)
|
| | | {
|
| | | }
|
| | |
|
| | |
| | | PL_AVFrameBGRA_Internal* in = (PL_AVFrameBGRA_Internal*)internal;
|
| | | in->reset();
|
| | |
|
| | | in->pAVFormatContext = avformat_alloc_context();
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
New file |
| | |
| | | #include "PL_SensetimeFaceDetect.h"
|
| | |
|
| | | struct PL_SensetimeFaceDetect_Internal
|
| | | {
|
| | | uint8_t buffer[1920*1080*4];
|
| | | size_t buffSize;
|
| | | size_t buffSizeMax;
|
| | |
|
| | | bool payError;
|
| | | |
| | | PL_SensetimeFaceDetect_Internal() : |
| | | buffSize(0), buffSizeMax(sizeof(buffer)), |
| | | payError(true)
|
| | | {
|
| | | }
|
| | | |
| | | ~PL_SensetimeFaceDetect_Internal()
|
| | | {
|
| | | }
|
| | | |
| | | void reset()
|
| | | {
|
| | | buffSize = 0;
|
| | | payError = true;
|
| | | }
|
| | | };
|
| | |
|
| | | PipeLineElem* create_PL_SensetimeFaceDetect()
|
| | | {
|
| | | return new PL_SensetimeFaceDetect;
|
| | | }
|
| | |
|
| | | PL_SensetimeFaceDetect::PL_SensetimeFaceDetect() : internal(new PL_SensetimeFaceDetect_Internal)
|
| | | {
|
| | | }
|
| | |
|
| | | PL_SensetimeFaceDetect::~PL_SensetimeFaceDetect()
|
| | | {
|
| | | delete (PL_SensetimeFaceDetect_Internal*)internal;
|
| | | internal= nullptr;
|
| | | }
|
| | |
|
| | | bool PL_SensetimeFaceDetect::init(void* args)
|
| | | {
|
| | | PL_SensetimeFaceDetect_Internal* in = (PL_SensetimeFaceDetect_Internal*)internal;
|
| | | in->reset();
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
| | | void PL_SensetimeFaceDetect::finit()
|
| | | {
|
| | | PL_SensetimeFaceDetect_Internal* in = (PL_SensetimeFaceDetect_Internal*)internal;
|
| | | |
| | | }
|
| | |
|
| | | bool PL_SensetimeFaceDetect::pay(const PipeMaterial& pm)
|
| | | {
|
| | | PL_SensetimeFaceDetect_Internal* in = (PL_SensetimeFaceDetect_Internal*)internal;
|
| | |
|
| | | //in->buffer readly
|
| | |
|
| | | //static size_t f=0;
|
| | | //char fname[50];
|
| | | //sprintf(fname, "%u.bgra", ++f);
|
| | | //FILE * pFile = fopen (fname,"wb");
|
| | | //fwrite (in->buffer , sizeof(char), in->buffSize, pFile);
|
| | | //fclose(pFile);
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | bool PL_SensetimeFaceDetect::gain(PipeMaterial& pm)
|
| | | {
|
| | | PL_SensetimeFaceDetect_Internal* in = (PL_SensetimeFaceDetect_Internal*)internal;
|
| | |
|
| | | pm.buffer = in->buffer;
|
| | | pm.buffSize = in->buffSize;
|
| | | pm.former = this;
|
| | | return true;
|
| | | }
|
New file |
| | |
| | | #ifndef _PL_PL_SENSETIMEFACEDETECT_H_
|
| | | #define _PL_PL_SENSETIMEFACEDETECT_H_
|
| | |
|
| | | #include "PipeLine.h"
|
| | |
|
| | | class PL_SensetimeFaceDetect : public PipeLineElem
|
| | | {
|
| | | public:
|
| | | PL_SensetimeFaceDetect();
|
| | | virtual ~PL_SensetimeFaceDetect();
|
| | |
|
| | | virtual bool init(void* args);
|
| | | virtual void finit();
|
| | |
|
| | | virtual bool pay(const PipeMaterial& pm);
|
| | | virtual bool gain(PipeMaterial& pm);
|
| | | |
| | | private:
|
| | | void* internal;
|
| | | };
|
| | |
|
| | | PipeLineElem* create_PL_SensetimeFaceDetect();
|
| | |
|
| | | #endif
|
New file |
| | |
| | | #include "PL_StaticJpegSource.h"
|
| | |
|
| | | extern "C"
|
| | | {
|
| | | #include <libyuv.h>
|
| | | }
|
| | |
|
| | | struct PL_StaticJpegSource_Internal
|
| | | {
|
| | | uint8_t buffer[1920*1080*4];
|
| | | size_t buffSize;
|
| | | size_t buffSizeMax;
|
| | |
|
| | | bool payError;
|
| | | |
| | | PL_StaticJpegSource_Internal() : |
| | | buffSize(0), buffSizeMax(sizeof(buffer)), |
| | | payError(true)
|
| | | {
|
| | | }
|
| | | |
| | | ~PL_StaticJpegSource_Internal()
|
| | | {
|
| | | }
|
| | | |
| | | void reset()
|
| | | {
|
| | | buffSize = 0;
|
| | | payError = true;
|
| | | }
|
| | | };
|
| | |
|
| | | PipeLineElem* create_PL_StaticJpegSource()
|
| | | {
|
| | | return new PL_StaticJpegSource;
|
| | | }
|
| | |
|
| | | PL_StaticJpegSource::PL_StaticJpegSource() : internal(new PL_StaticJpegSource_Internal)
|
| | | {
|
| | | }
|
| | |
|
| | | PL_StaticJpegSource::~PL_StaticJpegSource()
|
| | | {
|
| | | delete (PL_StaticJpegSource_Internal*)internal;
|
| | | internal= nullptr;
|
| | | }
|
| | |
|
| | | bool PL_StaticJpegSource::init(void* args)
|
| | | {
|
| | | PL_StaticJpegSource_Internal* in = (PL_StaticJpegSource_Internal*)internal;
|
| | | in->reset();
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | void PL_StaticJpegSource::finit()
|
| | | {
|
| | | PL_StaticJpegSource_Internal* in = (PL_StaticJpegSource_Internal*)internal;
|
| | | |
| | | }
|
| | |
|
| | | bool PL_StaticJpegSource::pay(const PipeMaterial& pm)
|
| | | {
|
| | | PL_StaticJpegSource_Internal* in = (PL_StaticJpegSource_Internal*)internal;
|
| | | |
| | | //in->buffer readly
|
| | |
|
| | | //static size_t f=0;
|
| | | //char fname[50];
|
| | | //sprintf(fname, "%u.bgra", ++f);
|
| | | //FILE * pFile = fopen (fname,"wb");
|
| | | //fwrite (in->buffer , sizeof(char), in->buffSize, pFile);
|
| | | //fclose(pFile);
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | bool PL_StaticJpegSource::gain(PipeMaterial& pm)
|
| | | {
|
| | | PL_StaticJpegSource_Internal* in = (PL_StaticJpegSource_Internal*)internal;
|
| | |
|
| | | pm.buffer = in->buffer;
|
| | | pm.buffSize = in->buffSize;
|
| | | pm.former = this;
|
| | | return true;
|
| | | }
|
New file |
| | |
| | | #ifndef _PL_PL_StaticJpegSource_H_
|
| | | #define _PL_PL_StaticJpegSource_H_
|
| | |
|
| | | #include "PipeLine.h"
|
| | |
|
| | | class PL_StaticJpegSource : public PipeLineElem
|
| | | {
|
| | | public:
|
| | | PL_StaticJpegSource();
|
| | | virtual ~PL_StaticJpegSource();
|
| | |
|
| | | virtual bool init(void* args);
|
| | | virtual void finit();
|
| | |
|
| | | virtual bool pay(const PipeMaterial& pm);
|
| | | virtual bool gain(PipeMaterial& pm);
|
| | | |
| | | private:
|
| | | void* internal;
|
| | | };
|
| | |
|
| | | PipeLineElem* create_PL_StaticJpegSource();
|
| | |
|
| | | #endif
|
| | |
| | | #include "PipeLine.h"
|
| | | #include "PL_RTSPClient.h"
|
| | | #include "PL_H264Decoder.h"
|
| | | #include "PL_AVFrameBGRA.h"
|
| | | #include "PL_AVFrameYUV420.h"
|
| | |
|
| | | #include <iostream>
|
| | | using namespace std;
|
| | |
| | |
|
| | | pipeLine.register_elem_creator("PL_RTSPClient", create_PL_RTSPClient);
|
| | | pipeLine.register_elem_creator("PL_H264Decoder", create_PL_H264Decoder);
|
| | | pipeLine.register_elem_creator("PL_AVFrameBGRA", create_PL_AVFrameBGRA);
|
| | | pipeLine.register_elem_creator("PL_AVFrameYUV420", create_PL_AVFrameYUV420);
|
| | |
|
| | | PL_RTSPClient* rtspClient = (PL_RTSPClient*)pipeLine.push_elem("PL_RTSPClient");
|
| | | RTSPConfig rtspConfig;
|
| | |
| | | PL_H264Decoder* h264Decoder = (PL_H264Decoder*)pipeLine.push_elem("PL_H264Decoder");
|
| | | h264Decoder->init(nullptr);
|
| | |
|
| | | PL_AVFrameBGRA* avFrameBGRA = (PL_AVFrameBGRA*)pipeLine.push_elem("PL_AVFrameBGRA");
|
| | | avFrameBGRA->init(nullptr);
|
| | | PL_AVFrameYUV420* avFrameYUV420 = (PL_AVFrameYUV420*)pipeLine.push_elem("PL_AVFrameYUV420");
|
| | | avFrameYUV420->init(nullptr);
|
| | |
|
| | | while(true)
|
| | | {
|