mirror of
https://github.com/mpromonet/v4l2rtspserver
synced 2024-11-19 15:25:34 +00:00
remove useless V4L2DeviceParameters in V4L2DeviceSource
This commit is contained in:
parent
f8de2847a8
commit
df4a49d881
@ -24,10 +24,10 @@ const char H264shortmarker[] = {0,0,1};
|
|||||||
class H264_V4L2DeviceSource : public V4L2DeviceSource
|
class H264_V4L2DeviceSource : public V4L2DeviceSource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static H264_V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker) ;
|
static H264_V4L2DeviceSource* createNew(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker);
|
H264_V4L2DeviceSource(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker);
|
||||||
virtual ~H264_V4L2DeviceSource();
|
virtual ~H264_V4L2DeviceSource();
|
||||||
|
|
||||||
unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize);
|
unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize);
|
||||||
|
@ -64,11 +64,11 @@ class V4L2DeviceSource: public FramedSource
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread) ;
|
static V4L2DeviceSource* createNew(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread) ;
|
||||||
std::string getAuxLine() { return m_auxLine; };
|
std::string getAuxLine() { return m_auxLine; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread);
|
V4L2DeviceSource(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread);
|
||||||
virtual ~V4L2DeviceSource();
|
virtual ~V4L2DeviceSource();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -90,7 +90,6 @@ class V4L2DeviceSource: public FramedSource
|
|||||||
virtual void doStopGettingFrames();
|
virtual void doStopGettingFrames();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
V4L2DeviceParameters m_params;
|
|
||||||
std::list<Frame*> m_captureQueue;
|
std::list<Frame*> m_captureQueue;
|
||||||
Stats m_in;
|
Stats m_in;
|
||||||
Stats m_out;
|
Stats m_out;
|
||||||
|
@ -21,19 +21,19 @@
|
|||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// H264 V4L2 FramedSource
|
// H264 V4L2 FramedSource
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
H264_V4L2DeviceSource* H264_V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker)
|
H264_V4L2DeviceSource* H264_V4L2DeviceSource::createNew(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker)
|
||||||
{
|
{
|
||||||
H264_V4L2DeviceSource* source = NULL;
|
H264_V4L2DeviceSource* source = NULL;
|
||||||
if (device)
|
if (device)
|
||||||
{
|
{
|
||||||
source = new H264_V4L2DeviceSource(env, params, device, outputFd, queueSize, useThread, repeatConfig, keepMarker);
|
source = new H264_V4L2DeviceSource(env, device, outputFd, queueSize, useThread, repeatConfig, keepMarker);
|
||||||
}
|
}
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
H264_V4L2DeviceSource::H264_V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker)
|
H264_V4L2DeviceSource::H264_V4L2DeviceSource(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread, bool repeatConfig, bool keepMarker)
|
||||||
: V4L2DeviceSource(env, params, device, outputFd, queueSize,useThread), m_repeatConfig(repeatConfig), m_keepMarker(keepMarker), m_frameType(0)
|
: V4L2DeviceSource(env, device, outputFd, queueSize,useThread), m_repeatConfig(repeatConfig), m_keepMarker(keepMarker), m_frameType(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,20 +37,19 @@ int V4L2DeviceSource::Stats::notify(int tv_sec, int framesize)
|
|||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// V4L2 FramedSource
|
// V4L2 FramedSource
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
V4L2DeviceSource* V4L2DeviceSource::createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
V4L2DeviceSource* V4L2DeviceSource::createNew(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||||
{
|
{
|
||||||
V4L2DeviceSource* source = NULL;
|
V4L2DeviceSource* source = NULL;
|
||||||
if (device)
|
if (device)
|
||||||
{
|
{
|
||||||
source = new V4L2DeviceSource(env, params, device, outputFd, queueSize, useThread);
|
source = new V4L2DeviceSource(env, device, outputFd, queueSize, useThread);
|
||||||
}
|
}
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
V4L2DeviceSource::V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
V4L2DeviceSource::V4L2DeviceSource(UsageEnvironment& env, V4l2Capture * device, int outputFd, unsigned int queueSize, bool useThread)
|
||||||
: FramedSource(env),
|
: FramedSource(env),
|
||||||
m_params(params),
|
|
||||||
m_in("in"),
|
m_in("in"),
|
||||||
m_out("out") ,
|
m_out("out") ,
|
||||||
m_outfd(outputFd),
|
m_outfd(outputFd),
|
||||||
|
@ -97,13 +97,13 @@ RTSPServer* createRTSPServer(UsageEnvironment& env, unsigned short rtspPort, uns
|
|||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// create FramedSource server
|
// create FramedSource server
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
FramedSource* createFramedSource(UsageEnvironment* env, const V4L2DeviceParameters& param, V4l2Capture* videoCapture, int outfd, int queueSize, bool useThread, bool repeatConfig, bool muxTS)
|
FramedSource* createFramedSource(UsageEnvironment* env, V4l2Capture* videoCapture, int outfd, int queueSize, bool useThread, bool repeatConfig, bool muxTS)
|
||||||
{
|
{
|
||||||
FramedSource* source = NULL;
|
FramedSource* source = NULL;
|
||||||
int format = videoCapture->getFormat();
|
int format = videoCapture->getFormat();
|
||||||
if (format == V4L2_PIX_FMT_H264)
|
if (format == V4L2_PIX_FMT_H264)
|
||||||
{
|
{
|
||||||
source = H264_V4L2DeviceSource::createNew(*env, param, videoCapture, outfd, queueSize, useThread, repeatConfig, muxTS);
|
source = H264_V4L2DeviceSource::createNew(*env, videoCapture, outfd, queueSize, useThread, repeatConfig, muxTS);
|
||||||
if (muxTS)
|
if (muxTS)
|
||||||
{
|
{
|
||||||
MPEG2TransportStreamFromESSource* muxer = MPEG2TransportStreamFromESSource::createNew(*env);
|
MPEG2TransportStreamFromESSource* muxer = MPEG2TransportStreamFromESSource::createNew(*env);
|
||||||
@ -113,7 +113,7 @@ FramedSource* createFramedSource(UsageEnvironment* env, const V4L2DeviceParamete
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
source = V4L2DeviceSource::createNew(*env, param, videoCapture, outfd, queueSize, useThread);
|
source = V4L2DeviceSource::createNew(*env, videoCapture, outfd, queueSize, useThread);
|
||||||
}
|
}
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
@ -366,7 +366,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
LOG(NOTICE) << "Create Source ..." << deviceName;
|
LOG(NOTICE) << "Create Source ..." << deviceName;
|
||||||
std::string rtpFormat(getRtpFormat(format, muxTS));
|
std::string rtpFormat(getRtpFormat(format, muxTS));
|
||||||
FramedSource* videoSource = createFramedSource(env, param, videoCapture, outfd, queueSize, useThread, repeatConfig, muxTS);
|
FramedSource* videoSource = createFramedSource(env, videoCapture, outfd, queueSize, useThread, repeatConfig, muxTS);
|
||||||
if (videoSource == NULL)
|
if (videoSource == NULL)
|
||||||
{
|
{
|
||||||
LOG(FATAL) << "Unable to create source for device " << deviceName;
|
LOG(FATAL) << "Unable to create source for device " << deviceName;
|
||||||
|
Loading…
Reference in New Issue
Block a user