Skip to content

Commit

Permalink
Merge pull request #7 from andyx96/master
Browse files Browse the repository at this point in the history
Bump to 2016.06.22
  • Loading branch information
Roman Gaufman committed Jun 25, 2016
2 parents d9e97d7 + bd01e55 commit eda27a2
Show file tree
Hide file tree
Showing 41 changed files with 218 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef _BASICUSAGEENVIRONMENT_VERSION_HH
#define _BASICUSAGEENVIRONMENT_VERSION_HH

#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2016.01.29"
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1454025600
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2016.06.23"
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1466640000

#endif
8 changes: 4 additions & 4 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999

Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
Expand Down
4 changes: 2 additions & 2 deletions UsageEnvironment/include/UsageEnvironment_version.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef _USAGEENVIRONMENT_VERSION_HH
#define _USAGEENVIRONMENT_VERSION_HH

#define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2016.01.29"
#define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1454025600
#define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2016.06.23"
#define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1466640000

#endif
2 changes: 1 addition & 1 deletion WindowsAudioInputDevice/WindowsAudioInputDevice.mak
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ UI_OPTS = $(guilflags) $(guilibsdll)
CONSOLE_UI_OPTS = $(conlflags) $(conlibsdll)
CPU=i386

TOOLS32 = I:\Program Files\DevStudio\Vc
TOOLS32 = c:\Program Files\DevStudio\Vc
COMPILE_OPTS = $(INCLUDES) $(cdebug) $(cflags) $(cvarsdll) -I. -I"$(TOOLS32)\include"
C = c
C_COMPILER = "$(TOOLS32)\bin\cl"
Expand Down
6 changes: 3 additions & 3 deletions config.linux-with-shared-libraries
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# At least one interface changes, or is removed => CURRENT += 1; REVISION = 0; AGE = 0
# One or more interfaces were added, but no existing interfaces were changed or removed => CURRENT += 1; REVISION = 0; AGE += 1

libliveMedia_VERSION_CURRENT=51
libliveMedia_VERSION_REVISION=8
libliveMedia_VERSION_AGE=1
libliveMedia_VERSION_CURRENT=54
libliveMedia_VERSION_REVISION=0
libliveMedia_VERSION_AGE=2
libliveMedia_LIB_SUFFIX=so.$(shell expr $(libliveMedia_VERSION_CURRENT) - $(libliveMedia_VERSION_AGE)).$(libliveMedia_VERSION_AGE).$(libliveMedia_VERSION_REVISION)

libBasicUsageEnvironment_VERSION_CURRENT=1
Expand Down
44 changes: 9 additions & 35 deletions genMakefiles
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,16 @@ then
usage $*
fi

cd liveMedia
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../groupsock
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../UsageEnvironment
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../BasicUsageEnvironment
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../testProgs
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../mediaServer
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile

cd ../proxyServer
/bin/rm -f Makefile
cat Makefile.head ../config.$1 Makefile.tail > Makefile
chmod a-w Makefile
platform=$1
subdirs="liveMedia groupsock UsageEnvironment BasicUsageEnvironment testProgs mediaServer proxyServer"

for subdir in $subdirs
do
/bin/rm -f $subdir/Makefile
cat $subdir/Makefile.head config.$platform $subdir/Makefile.tail > $subdir/Makefile
chmod a-w $subdir/Makefile
done

cd ..
/bin/rm -f Makefile
cat Makefile.head config.$1 Makefile.tail > Makefile
chmod a-w Makefile
5 changes: 3 additions & 2 deletions groupsock/GroupsockHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ along with this library; if not, write to the Free Software Foundation, Inc.,

#include "GroupsockHelper.hh"

#if defined(__WIN32__) || defined(_WIN32)
#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
#include <time.h>
extern "C" int initializeWinsockIfNecessary();
#else
#include <stdarg.h>
#include <time.h>
#include <sys/time.h>
#include <fcntl.h>
#define initializeWinsockIfNecessary() 1
#endif
Expand Down Expand Up @@ -752,7 +753,7 @@ char const* timestampString() {
return (char const*)&timeString;
}

#if defined(__WIN32__) || defined(_WIN32)
#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
// For Windoze, we need to implement our own gettimeofday()

// used to make sure that static variables in gettimeofday() aren't initialized simultaneously by multiple threads
Expand Down
4 changes: 3 additions & 1 deletion groupsock/include/GroupsockHelper.hh
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ _groupsockPriv* groupsockPriv(UsageEnvironment& env); // allocates it if necessa
void reclaimGroupsockPriv(UsageEnvironment& env);


#if defined(__WIN32__) || defined(_WIN32)
#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
// For Windoze, we need to implement our own gettimeofday()
extern int gettimeofday(struct timeval*, int*);
#else
#include <sys/time.h>
#endif

// The following are implemented in inet.c:
Expand Down
4 changes: 2 additions & 2 deletions groupsock/include/groupsock_version.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef _GROUPSOCK_VERSION_HH
#define _GROUPSOCK_VERSION_HH

#define GROUPSOCK_LIBRARY_VERSION_STRING "2016.01.29"
#define GROUPSOCK_LIBRARY_VERSION_INT 1454025600
#define GROUPSOCK_LIBRARY_VERSION_STRING "2016.06.23"
#define GROUPSOCK_LIBRARY_VERSION_INT 1466640000

#endif
2 changes: 2 additions & 0 deletions liveMedia/GenericMediaServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ void GenericMediaServer::ClientSession::noteLiveness() {
fprintf(stderr, "Client session (id \"%08X\", stream name \"%s\"): Liveness indication\n",
fOurSessionId, streamName);
#endif
if (fOurServerMediaSession != NULL) fOurServerMediaSession->noteLiveness();

if (fOurServer.fReclamationSeconds > 0) {
envir().taskScheduler().rescheduleDelayedTask(fLivenessCheckTask,
fOurServer.fReclamationSeconds*1000000,
Expand Down
4 changes: 2 additions & 2 deletions liveMedia/H264or5VideoStreamFramer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Boolean H264or5VideoStreamParser::usuallyBeginsAccessUnit(u_int8_t nal_unit_type

void H264or5VideoStreamParser
::removeEmulationBytes(u_int8_t* nalUnitCopy, unsigned maxSize, unsigned& nalUnitCopySize) {
u_int8_t* nalUnitOrig = fStartOfFrame + fOutputStartCodeSize;
u_int8_t const* nalUnitOrig = fStartOfFrame + fOutputStartCodeSize;
unsigned const numBytesInNALunit = fTo - nalUnitOrig;
nalUnitCopySize
= removeH264or5EmulationBytes(nalUnitCopy, maxSize, nalUnitOrig, numBytesInNALunit);
Expand Down Expand Up @@ -1161,7 +1161,7 @@ unsigned H264or5VideoStreamParser::parse() {
}

unsigned removeH264or5EmulationBytes(u_int8_t* to, unsigned toMaxSize,
u_int8_t* from, unsigned fromSize) {
u_int8_t const* from, unsigned fromSize) {
unsigned toSize = 0;
unsigned i = 0;
while (i < fromSize && toSize+1 < toMaxSize) {
Expand Down
9 changes: 5 additions & 4 deletions liveMedia/MPEG2TransportStreamFromESSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ along with this library; if not, write to the Free Software Foundation, Inc.,

#include "MPEG2TransportStreamFromESSource.hh"

#define MAX_INPUT_ES_FRAME_SIZE 100000
#define SIMPLE_PES_HEADER_SIZE 14
#define LOW_WATER_MARK 1000 // <= MAX_INPUT_ES_FRAME_SIZE
#define INPUT_BUFFER_SIZE (SIMPLE_PES_HEADER_SIZE + 2*MAX_INPUT_ES_FRAME_SIZE)
#define INPUT_BUFFER_SIZE (SIMPLE_PES_HEADER_SIZE + 2*MPEG2TransportStreamFromESSource::maxInputESFrameSize)
#define LOW_WATER_MARK 1000 // <= MPEG2TransportStreamFromESSource::maxInputESFrameSize

////////// InputESSourceRecord definition //////////

Expand Down Expand Up @@ -74,6 +73,8 @@ class InputESSourceRecord {

////////// MPEG2TransportStreamFromESSource implementation //////////

unsigned MPEG2TransportStreamFromESSource::maxInputESFrameSize = 100000; // bytes

MPEG2TransportStreamFromESSource* MPEG2TransportStreamFromESSource
::createNew(UsageEnvironment& env) {
return new MPEG2TransportStreamFromESSource(env);
Expand Down Expand Up @@ -236,7 +237,7 @@ void InputESSourceRecord
::afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes,
struct timeval presentationTime) {
if (numTruncatedBytes > 0) {
fParent.envir() << "MPEG2TransportStreamFromESSource: input buffer too small; increase \"MAX_INPUT_ES_FRAME_SIZE\" in \"MPEG2TransportStreamFromESSource\" by at least "
fParent.envir() << "MPEG2TransportStreamFromESSource: input buffer too small; increase \"MPEG2TransportStreamFromESSource::maxInputESFrameSize\" by at least "
<< numTruncatedBytes << " bytes!\n";
}

Expand Down
2 changes: 1 addition & 1 deletion liveMedia/MPEG4VideoStreamFramer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ unsigned MPEG4VideoStreamParser::parseVideoObjectLayer() {
// don't support:
u_int32_t next4Bytes = get4Bytes();
if (!isVideoObjectLayerStartCode(next4Bytes)) {
usingSource()->envir() << "MPEG4VideoStreamParser::parseVideoObjectLayer(): This appears to be a 'short video header', which we current don't support\n";
usingSource()->envir() << "MPEG4VideoStreamParser::parseVideoObjectLayer(): This appears to be a 'short video header', which we currently don't support\n";
}

// Now, copy all bytes that we see, up until we reach
Expand Down
4 changes: 3 additions & 1 deletion liveMedia/MatroskaFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ ::createRTPSinkForTrackNumber(unsigned trackNumber, Groupsock* rtpGroupsock,
MatroskaTrack* track = lookup(trackNumber);
if (track == NULL) break;

if (strcmp(track->mimeType, "audio/MPEG") == 0) {
if (strcmp(track->mimeType, "audio/L16") == 0) {
result = SimpleRTPSink::createNew(envir(), rtpGroupsock,rtpPayloadTypeIfDynamic, track->samplingFrequency, "audio", "L16", track->numChannels);
} else if (strcmp(track->mimeType, "audio/MPEG") == 0) {
result = MPEG1or2AudioRTPSink::createNew(envir(), rtpGroupsock);
} else if (strcmp(track->mimeType, "audio/AAC") == 0) {
// The Matroska file's 'Codec Private' data is assumed to be the AAC configuration
Expand Down
4 changes: 3 additions & 1 deletion liveMedia/MatroskaFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ Boolean MatroskaFileParser::parseTrack() {
delete[] track->codecID; track->codecID = codecID;

// Also set the track's "mimeType" field, if we can deduce it from the "codecID":
if (strncmp(codecID, "A_MPEG", 6) == 0) {
if (strcmp(codecID, "A_PCM/INT/BIG") == 0) {
track->mimeType = "audio/L16";
} else if (strncmp(codecID, "A_MPEG", 6) == 0) {
track->mimeType = "audio/MPEG";
} else if (strncmp(codecID, "A_AAC", 5) == 0) {
track->mimeType = "audio/AAC";
Expand Down
2 changes: 1 addition & 1 deletion liveMedia/MediaSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ Boolean MediaSubsession::initiate(int useSpecialRTPoffset) {
// Port numbers were not specified in advance, so we use ephemeral port numbers.
// Create sockets until we get a port-number pair (even: RTP; even+1: RTCP).
// (However, if we're multiplexing RTCP with RTP, then we create only one socket,
// and the port number can be even or odd.)
// and the port number can be even or odd.)
// We need to make sure that we don't keep trying to use the same bad port numbers over
// and over again, so we store bad sockets in a table, and delete them all when we're done.
HashTable* socketHashTable = HashTable::create(ONE_WORD_HASH_KEYS);
Expand Down
27 changes: 17 additions & 10 deletions liveMedia/MultiFramedRTPSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ void MultiFramedRTPSink::setPacketSizes(unsigned preferredPacketSize,
fOurMaxPacketSize = maxPacketSize; // save value, in case subclasses need it
}

#ifndef RTP_PAYLOAD_MAX_SIZE
#define RTP_PAYLOAD_MAX_SIZE 1456
// Default max packet size (1500, minus allowance for IP, UDP, UMTP headers)
// (Also, make it a multiple of 4 bytes, just in case that matters.)
#endif
#ifndef RTP_PAYLOAD_PREFERRED_SIZE
#define RTP_PAYLOAD_PREFERRED_SIZE ((RTP_PAYLOAD_MAX_SIZE) < 1000 ? (RTP_PAYLOAD_MAX_SIZE) : 1000)
#endif

MultiFramedRTPSink::MultiFramedRTPSink(UsageEnvironment& env,
Groupsock* rtpGS,
unsigned char rtpPayloadType,
Expand All @@ -44,9 +53,7 @@ MultiFramedRTPSink::MultiFramedRTPSink(UsageEnvironment& env,
rtpPayloadFormatName, numChannels),
fOutBuf(NULL), fCurFragmentationOffset(0), fPreviousFrameEndedFragmentation(False),
fOnSendErrorFunc(NULL), fOnSendErrorData(NULL) {
setPacketSizes(1000, 1456);
// Default max packet size (1500, minus allowance for IP, UDP, UMTP headers)
// (Also, make it a multiple of 4 bytes, just in case that matters.)
setPacketSizes((RTP_PAYLOAD_PREFERRED_SIZE), (RTP_PAYLOAD_MAX_SIZE));
}

MultiFramedRTPSink::~MultiFramedRTPSink() {
Expand Down Expand Up @@ -194,7 +201,13 @@ void MultiFramedRTPSink::buildAndSendPacket(Boolean isFirstPacket) {
void MultiFramedRTPSink::packFrame() {
// Get the next frame.

// First, see if we have an overflow frame that was too big for the last pkt
// First, skip over the space we'll use for any frame-specific header:
fCurFrameSpecificHeaderPosition = fOutBuf->curPacketSize();
fCurFrameSpecificHeaderSize = frameSpecificHeaderSize();
fOutBuf->skipBytes(fCurFrameSpecificHeaderSize);
fTotalFrameSpecificHeaderSizes += fCurFrameSpecificHeaderSize;

// See if we have an overflow frame that was too big for the last pkt
if (fOutBuf->haveOverflowData()) {
// Use this frame before reading a new one from the source
unsigned frameSize = fOutBuf->overflowDataSize();
Expand All @@ -206,12 +219,6 @@ void MultiFramedRTPSink::packFrame() {
} else {
// Normal case: we need to read a new frame from the source
if (fSource == NULL) return;

fCurFrameSpecificHeaderPosition = fOutBuf->curPacketSize();
fCurFrameSpecificHeaderSize = frameSpecificHeaderSize();
fOutBuf->skipBytes(fCurFrameSpecificHeaderSize);
fTotalFrameSpecificHeaderSizes += fCurFrameSpecificHeaderSize;

fSource->getNextFrame(fOutBuf->curPtr(), fOutBuf->totalBytesAvailable(),
afterGettingFrame, this, ourHandleClosure, this);
}
Expand Down
2 changes: 1 addition & 1 deletion liveMedia/MultiFramedRTPSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ::MultiFramedRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
fReorderingBuffer = new ReorderingPacketBuffer(packetFactory);

// Try to use a big receive buffer for RTP:
increaseReceiveBufferTo(env, RTPgs->socketNum(), 2000000);
increaseReceiveBufferTo(env, RTPgs->socketNum(), 50*1024);
}

void MultiFramedRTPSource::reset() {
Expand Down
Loading

0 comments on commit eda27a2

Please sign in to comment.