houxiao
2016-12-30 a88698ced8bcd58f0f1918b10380bc66b0bfcbbc
RtspFace/main.cpp
@@ -6,14 +6,15 @@
#include "PL_AVFrameYUV420.h"
#include "PL_AVFrameBGRA.h"
#include "PL_Queue.h"
#include "PL_Scale.h"
#include "PL_SensetimeFaceDetect.h"
#include "PL_SensetimeFaceTrack.h"
#include "logger.h"
int main(int argc, char** argv)
{
   initLogger(2);
   initLogger(LV_DEBUG);
   PipeLine pipeLine;
   
@@ -23,8 +24,9 @@
   pipeLine.register_elem_creator("PL_AVFrameYUV420", create_PL_AVFrameYUV420);
   pipeLine.register_elem_creator("PL_H264Encoder", create_PL_H264Encoder);
   pipeLine.register_elem_creator("PL_Queue", create_PL_Queue);
   pipeLine.register_elem_creator("PL_Scale", create_PL_Scale);
   
   pipeLine.register_elem_creator("PL_SensetimeFaceDetect", create_PL_SensetimeFaceDetect);
   pipeLine.register_elem_creator("PL_SensetimeFaceTrack", create_PL_SensetimeFaceTrack);
   
   {
      PL_RTSPClient* rtspClient = (PL_RTSPClient*)pipeLine.push_elem("PL_RTSPClient");
@@ -45,18 +47,41 @@
   {
      PL_H264Decoder* h264Decoder = (PL_H264Decoder*)pipeLine.push_elem("PL_H264Decoder");
      h264Decoder->init(nullptr);
      bool ret = h264Decoder->init(nullptr);
      if (!ret)
      {
         LOG_ERROR << "PL_H264Decoder.init error";
         exit(EXIT_FAILURE);
      }
   }
   {
      PL_AVFrameYUV420* avFrameYUV420 = (PL_AVFrameYUV420*)pipeLine.push_elem("PL_AVFrameYUV420");
      avFrameYUV420->init(nullptr);
      bool ret = avFrameYUV420->init(nullptr);
      if (!ret)
      {
         LOG_ERROR << "PL_AVFrameYUV420.init error";
         exit(EXIT_FAILURE);
      }
   }
   {
      SensetimeFaceDetectConfig config;
      PL_SensetimeFaceDetect* stFaceDetect = (PL_SensetimeFaceDetect*)pipeLine.push_elem("PL_SensetimeFaceDetect");
      stFaceDetect->init(&config);
      PL_Scale_Config config;
      config.toWidth = 800;
      config.toHeight = 600;
      PL_Scale* pl = (PL_Scale*)pipeLine.push_elem("PL_Scale");
      bool ret = pl->init(&config);
      if (!ret)
      {
         LOG_ERROR << "PL_Scale.init error";
         exit(EXIT_FAILURE);
      }
   }
   {
      SensetimeFaceTrackConfig config;
      PL_SensetimeFaceTrack* pl = (PL_SensetimeFaceTrack*)pipeLine.push_elem("PL_SensetimeFaceTrack");
      pl->init(&config);
   }
   //{//#todo queue should support deep copy
@@ -72,7 +97,12 @@
   {
      PL_H264Encoder* h264Encoder = (PL_H264Encoder*)pipeLine.push_elem("PL_H264Encoder");
      h264Encoder->init(nullptr);
      bool ret = h264Encoder->init(nullptr);
      if (!ret)
      {
         LOG_ERROR << "PL_H264Encoder.init error";
         exit(EXIT_FAILURE);
      }
   }
   
   {