mirror of
https://github.com/mpromonet/v4l2rtspserver
synced 2024-11-02 03:40:13 +00:00
remove verbose parameter that is now manage though log4cpp level
This commit is contained in:
parent
d17d526d39
commit
cc7c76e2fd
@ -23,10 +23,10 @@ const char H264marker[] = {0,0,0,1};
|
||||
class H264_V4L2DeviceSource : public V4L2DeviceSource
|
||||
{
|
||||
public:
|
||||
static H264_V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread) ;
|
||||
static H264_V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread) ;
|
||||
|
||||
protected:
|
||||
H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread);
|
||||
H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread);
|
||||
virtual ~H264_V4L2DeviceSource();
|
||||
|
||||
unsigned char* extractFrame(unsigned char* frame, size_t size, size_t& outsize);
|
||||
|
@ -54,7 +54,7 @@ class V4L2DeviceSource: public FramedSource
|
||||
Stats(const std::string & msg) : m_fps(0), m_fps_sec(0), m_size(0), m_msg(msg) {};
|
||||
|
||||
public:
|
||||
int notify(int tv_sec, int framesize, int verbose);
|
||||
int notify(int tv_sec, int framesize);
|
||||
|
||||
protected:
|
||||
int m_fps;
|
||||
@ -64,11 +64,11 @@ class V4L2DeviceSource: public FramedSource
|
||||
};
|
||||
|
||||
public:
|
||||
static V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread) ;
|
||||
static V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread) ;
|
||||
std::string getAuxLine() { return m_auxLine; };
|
||||
|
||||
protected:
|
||||
V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread);
|
||||
V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread);
|
||||
virtual ~V4L2DeviceSource();
|
||||
|
||||
protected:
|
||||
@ -97,7 +97,6 @@ class V4L2DeviceSource: public FramedSource
|
||||
int m_outfd;
|
||||
V4l2Capture * m_device;
|
||||
unsigned int m_queueSize;
|
||||
int m_verbose;
|
||||
pthread_t m_thid;
|
||||
std::string m_auxLine;
|
||||
};
|
||||
|
@ -21,19 +21,19 @@
|
||||
// ---------------------------------
|
||||
// H264 V4L2 FramedSource
|
||||
// ---------------------------------
|
||||
H264_V4L2DeviceSource* H264_V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread)
|
||||
H264_V4L2DeviceSource* H264_V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||
{
|
||||
H264_V4L2DeviceSource* source = NULL;
|
||||
if (device)
|
||||
{
|
||||
source = new H264_V4L2DeviceSource(env, params, device, outputFd, queueSize, verbose, useThread);
|
||||
source = new H264_V4L2DeviceSource(env, params, device, outputFd, queueSize, useThread);
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
H264_V4L2DeviceSource::H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread)
|
||||
: V4L2DeviceSource(env, params, device, outputFd, queueSize, verbose,useThread)
|
||||
H264_V4L2DeviceSource::H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||
: V4L2DeviceSource(env, params, device, outputFd, queueSize,useThread)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
// ---------------------------------
|
||||
// V4L2 FramedSource Stats
|
||||
// ---------------------------------
|
||||
int V4L2DeviceSource::Stats::notify(int tv_sec, int framesize, int verbose)
|
||||
int V4L2DeviceSource::Stats::notify(int tv_sec, int framesize)
|
||||
{
|
||||
m_fps++;
|
||||
m_size+=framesize;
|
||||
@ -41,26 +41,25 @@ int V4L2DeviceSource::Stats::notify(int tv_sec, int framesize, int verbose)
|
||||
// ---------------------------------
|
||||
// V4L2 FramedSource
|
||||
// ---------------------------------
|
||||
V4L2DeviceSource* V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread)
|
||||
V4L2DeviceSource* V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||
{
|
||||
V4L2DeviceSource* source = NULL;
|
||||
if (device)
|
||||
{
|
||||
source = new V4L2DeviceSource(env, params, device, outputFd, queueSize, verbose, useThread);
|
||||
source = new V4L2DeviceSource(env, params, device, outputFd, queueSize, useThread);
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
V4L2DeviceSource::V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread)
|
||||
V4L2DeviceSource::V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||
: FramedSource(env),
|
||||
m_params(params),
|
||||
m_in("in"),
|
||||
m_out("out") ,
|
||||
m_outfd(outputFd),
|
||||
m_device(device),
|
||||
m_queueSize(queueSize),
|
||||
m_verbose(verbose)
|
||||
m_queueSize(queueSize)
|
||||
{
|
||||
m_eventTriggerId = envir().taskScheduler().createEventTrigger(V4L2DeviceSource::deliverFrameStub);
|
||||
if (m_device)
|
||||
@ -154,7 +153,7 @@ void V4L2DeviceSource::deliverFrame()
|
||||
Frame * frame = m_captureQueue.front();
|
||||
m_captureQueue.pop_front();
|
||||
|
||||
m_out.notify(fPresentationTime.tv_sec, frame->m_size, m_verbose);
|
||||
m_out.notify(fPresentationTime.tv_sec, frame->m_size);
|
||||
if (frame->m_size > fMaxSize)
|
||||
{
|
||||
fFrameSize = fMaxSize;
|
||||
@ -202,7 +201,7 @@ int V4L2DeviceSource::getNextFrame()
|
||||
gettimeofday(&tv, NULL);
|
||||
timeval diff;
|
||||
timersub(&tv,&ref,&diff);
|
||||
m_in.notify(tv.tv_sec, frameSize, m_verbose);
|
||||
m_in.notify(tv.tv_sec, frameSize);
|
||||
LOG(DEBUG) << "getNextFrame\ttimestamp:" << ref.tv_sec << "." << ref.tv_usec << "\tsize:" << frameSize <<"\tdiff" << (diff.tv_sec*1000+diff.tv_usec/1000) << "ms\tqueue:" << m_captureQueue.size();
|
||||
processFrame(buffer,frameSize,ref);
|
||||
}
|
||||
|
@ -239,14 +239,14 @@ int main(int argc, char** argv)
|
||||
|
||||
// Init capture
|
||||
LOG(NOTICE) << "Create V4L2 Source..." << dev_name;
|
||||
V4L2DeviceParameters param(dev_name,format,width,height,fps,verbose);
|
||||
V4L2DeviceParameters param(dev_name,format,width,height,fps);
|
||||
V4l2Capture* videoCapture = createVideoCapure(param, useMmap);
|
||||
if (videoCapture)
|
||||
{
|
||||
int outputFd = createOutput(outputFile, videoCapture->getFd());
|
||||
LOG(NOTICE) << "Start V4L2 Capture..." << dev_name;
|
||||
videoCapture->captureStart();
|
||||
V4L2DeviceSource* videoES = H264_V4L2DeviceSource::createNew(*env, param, videoCapture, outputFd, queueSize, verbose, useThread);
|
||||
V4L2DeviceSource* videoES = H264_V4L2DeviceSource::createNew(*env, param, videoCapture, outputFd, queueSize, useThread);
|
||||
if (videoES == NULL)
|
||||
{
|
||||
LOG(FATAL) << "Unable to create source for device " << dev_name;
|
||||
|
Loading…
Reference in New Issue
Block a user