Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Jul 1, 2017
2 parents 66a3f05 + 63a3c57 commit d228e84
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion inc/ALSACapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ class ALSACapture
return pfds[0].fd;
}

unsigned long getBufferSize() { return m_bufferSize; };
virtual unsigned long getBufferSize() { return m_bufferSize; };
virtual int getWidth() {return -1;}
virtual int getHeight() {return -1;}

unsigned long getSampleRate() { return m_params.m_sampleRate; };
unsigned long getChannels () { return m_params.m_channels; };

Expand Down
6 changes: 6 additions & 0 deletions inc/V4l2DeviceSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class DeviceCapture
virtual size_t read(char* buffer, size_t bufferSize) = 0;
virtual int getFd() = 0;
virtual unsigned long getBufferSize() = 0;
virtual int getWidth() = 0;
virtual int getHeight() = 0;
virtual ~DeviceCapture() {};
};

Expand All @@ -43,6 +45,8 @@ class V4L2DeviceCapture : public DeviceCapture
virtual size_t read(char* buffer, size_t bufferSize) { return m_device->read(buffer, bufferSize); }
virtual int getFd() { return m_device->getFd(); }
virtual unsigned long getBufferSize() { return m_device->getBufferSize(); }
virtual int getWidth() { return m_device->getWidth(); }
virtual int getHeight() { return m_device->getHeight(); }

protected:
T* m_device;
Expand Down Expand Up @@ -87,6 +91,8 @@ class V4L2DeviceSource: public FramedSource
public:
static V4L2DeviceSource* createNew(UsageEnvironment& env, DeviceCapture * device, int outputFd, unsigned int queueSize, bool useThread) ;
std::string getAuxLine() { return m_auxLine; };
int getWidth() { return m_device->getWidth(); };
int getHeight() { return m_device->getHeight(); };

protected:
V4L2DeviceSource(UsageEnvironment& env, DeviceCapture * device, int outputFd, unsigned int queueSize, bool useThread);
Expand Down
1 change: 1 addition & 0 deletions src/HTTPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void HTTPServer::HTTPClientConnection::sendHeader(const char* contentType, unsig
"HTTP/1.1 200 OK\r\n"
"%s"
"Server: LIVE555 Streaming Media v%s\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Content-Type: %s\r\n"
"Content-Length: %d\r\n"
"\r\n",
Expand Down
7 changes: 6 additions & 1 deletion src/ServerMediaSubsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ char const* BaseServerMediaSubsession::getAuxLine(V4L2DeviceSource* source,unsig
std::ostringstream os;
os << "a=fmtp:" << int(rtpPayloadType) << " ";
os << source->getAuxLine();
os << "\r\n";
os << "\r\n";
int width = source->getWidth();
int height = source->getHeight();
if ( (width > 0) && (height>0) ) {
os << "a=x-dimensions:" << width << "," << height << "\r\n";
}
auxLine = strdup(os.str().c_str());
}
return auxLine;
Expand Down

0 comments on commit d228e84

Please sign in to comment.