mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Snapshot 2007-05-09
This commit is contained in:
@@ -6,6 +6,15 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
// default class: best effort
|
||||
#define DSCP_BE 0
|
||||
// gold class (video): assured forwarding 4 with lowest drop precedence
|
||||
#define DSCP_AF41 34 << 2
|
||||
// premium class (voip): expedited forwarding
|
||||
#define DSCP_EF 46 << 2
|
||||
// actual DSCP value used
|
||||
#define STREAMDEV_DSCP DSCP_AF41
|
||||
|
||||
cTBSocket::cTBSocket(int Type) {
|
||||
memset(&m_LocalAddr, 0, sizeof(m_LocalAddr));
|
||||
memset(&m_RemoteAddr, 0, sizeof(m_RemoteAddr));
|
||||
@@ -141,3 +150,8 @@ bool cTBSocket::Shutdown(int how) {
|
||||
|
||||
return ::shutdown(*this, how) != -1;
|
||||
}
|
||||
|
||||
bool cTBSocket::SetDSCP(void) {
|
||||
int dscp = STREAMDEV_DSCP;
|
||||
return ::setsockopt(*this, SOL_IP, IP_TOS, &dscp, sizeof(dscp)) != -1;
|
||||
}
|
||||
|
@@ -68,6 +68,9 @@ public:
|
||||
an appropriate value. */
|
||||
virtual bool Accept(const cTBSocket &Listener);
|
||||
|
||||
/* Sets DSCP sockopt */
|
||||
bool SetDSCP(void);
|
||||
|
||||
/* LocalPort() returns the port number this socket is connected to locally.
|
||||
The result is undefined for a non-open socket. */
|
||||
int LocalPort(void) const { return ntohs(m_LocalAddr.sin_port); }
|
||||
|
@@ -110,7 +110,7 @@ bool cTBSource::SafeWrite(const void *Buffer, size_t Length) {
|
||||
|
||||
ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq,
|
||||
uint TimeoutMs) {
|
||||
int seqlen, ms;
|
||||
int ms;
|
||||
size_t len;
|
||||
cTBSelect sel;
|
||||
|
||||
|
Reference in New Issue
Block a user