Commit 4bc4c023 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial. migrated from sourceforge

parents
Pipeline #956 canceled with stages
This is patch for live555 library, latest version (when this patch has created) 2007.11.18 from http://live555.com/liveMedia/public/
This patch provide the support in the JPEG RTP stream of the image dimensions - width and height - to have value more than 2040 (it's limitation of RTP JPEG standard), if a SDP stream description have a field "a=x-dimensions:width,height"
To apply it, download archive with the "live555" library, copy a file "jpeg_dimensions.patch" to the root directory with the sources, and run
patch -N -p0 < jpeg_dimensions.patch
diff -U 3 -H -d -r -N -- liveMedia/JPEGVideoRTPSource.cpp liveMedia/JPEGVideoRTPSource.cpp
--- liveMedia/JPEGVideoRTPSource.cpp 2007-11-18 02:27:55.000000000 +0200
+++ liveMedia/JPEGVideoRTPSource.cpp 2007-11-21 19:52:45.000000000 +0200
@@ -55,18 +55,20 @@
JPEGVideoRTPSource*
JPEGVideoRTPSource::createNew(UsageEnvironment& env, Groupsock* RTPgs,
unsigned char rtpPayloadFormat,
- unsigned rtpTimestampFrequency) {
+ unsigned rtpTimestampFrequency, int width, int height) {
return new JPEGVideoRTPSource(env, RTPgs, rtpPayloadFormat,
- rtpTimestampFrequency);
+ rtpTimestampFrequency, width, height);
}
JPEGVideoRTPSource::JPEGVideoRTPSource(UsageEnvironment& env,
Groupsock* RTPgs,
unsigned char rtpPayloadFormat,
- unsigned rtpTimestampFrequency)
+ unsigned rtpTimestampFrequency, int width, int height)
: MultiFramedRTPSource(env, RTPgs,
rtpPayloadFormat, rtpTimestampFrequency,
new JPEGBufferedPacketFactory) {
+ _width = width;
+ _height = height;
}
JPEGVideoRTPSource::~JPEGVideoRTPSource() {
@@ -340,8 +342,12 @@
unsigned type = Type & 1;
unsigned Q = (unsigned)headerStart[5];
unsigned width = (unsigned)headerStart[6] * 8;
- if (width == 0) width = 256*8; // special case
unsigned height = (unsigned)headerStart[7] * 8;
+ if ((width == 0 || height == 0) && _width != 0 && _height != 0) {
+ width = _width;
+ height = _height;
+ }
+ if (width == 0) width = 256*8; // special case
if (height == 0) height = 256*8; // special case
if (Type > 63) {
diff -U 3 -H -d -r -N -- liveMedia/MediaSession.cpp liveMedia/MediaSession.cpp
--- liveMedia/MediaSession.cpp 2007-11-18 02:27:55.000000000 +0200
+++ liveMedia/MediaSession.cpp 2007-11-21 19:55:12.000000000 +0200
@@ -745,7 +745,9 @@
fReadSource = fRTPSource
= JPEGVideoRTPSource::createNew(env(), fRTPSocket,
fRTPPayloadFormat,
- fRTPTimestampFrequency);
+ fRTPTimestampFrequency,
+ videoWidth(),
+ videoHeight());
} else if (strcmp(fCodecName, "X-QT") == 0
|| strcmp(fCodecName, "X-QUICKTIME") == 0) {
// Generic QuickTime streams, as defined in
diff -U 3 -H -d -r -N -- liveMedia/include/JPEGVideoRTPSource.hh liveMedia/include/JPEGVideoRTPSource.hh
--- liveMedia/include/JPEGVideoRTPSource.hh 2007-11-18 02:27:54.000000000 +0200
+++ liveMedia/include/JPEGVideoRTPSource.hh 2007-11-21 19:57:36.000000000 +0200
@@ -32,7 +32,7 @@
static JPEGVideoRTPSource*
createNew(UsageEnvironment& env, Groupsock* RTPgs,
unsigned char rtpPayloadFormat = 26,
- unsigned rtpPayloadFrequency = 90000);
+ unsigned rtpPayloadFrequency = 90000, int width = 0, int height = 0);
protected:
virtual ~JPEGVideoRTPSource();
@@ -40,9 +40,13 @@
private:
JPEGVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
unsigned char rtpPayloadFormat,
- unsigned rtpTimestampFrequency);
+ unsigned rtpTimestampFrequency, int width,int height);
// called only by createNew()
+ // Image dimensions from the SDP description, if any
+ int _width;
+ int _height;
+
private:
// redefined virtual functions:
virtual Boolean processSpecialHeader(BufferedPacket* packet,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment