Reverting back a few style changes for better review.
This commit is contained in:
parent
f522c01ed8
commit
d5d376cb0a
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "packager/base/synchronization/waitable_event.h"
|
#include "packager/base/synchronization/waitable_event.h"
|
||||||
#include "packager/file/file.h"
|
#include "packager/file/file.h"
|
||||||
#include "packager/file/file_closer.h"
|
#include "packager/file/file_closer.h"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// IP_MULTICAST_ALL has been supported since kernel version 2.6.31 but we may be
|
// IP_MULTICAST_ALL has been supported since kernel version 2.6.31 but we may be
|
||||||
// building on a machine that is older than that.
|
// building on a machine that is older than that.
|
||||||
#ifndef IP_MULTICAST_ALL
|
#ifndef IP_MULTICAST_ALL
|
||||||
#define IP_MULTICAST_ALL 49
|
#define IP_MULTICAST_ALL 49
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
@ -205,20 +205,24 @@ bool UdpFile::Open() {
|
||||||
struct ip_mreq_source source_multicast_group;
|
struct ip_mreq_source source_multicast_group;
|
||||||
|
|
||||||
source_multicast_group.imr_multiaddr = local_in_addr;
|
source_multicast_group.imr_multiaddr = local_in_addr;
|
||||||
if (inet_pton(AF_INET, options->interface_address().c_str(),
|
if (inet_pton(AF_INET,
|
||||||
|
options->interface_address().c_str(),
|
||||||
&source_multicast_group.imr_interface) != 1) {
|
&source_multicast_group.imr_interface) != 1) {
|
||||||
LOG(ERROR) << "Malformed IPv4 interface address "
|
LOG(ERROR) << "Malformed IPv4 interface address "
|
||||||
<< options->interface_address();
|
<< options->interface_address();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (inet_pton(AF_INET, options->source_address().c_str(),
|
if (inet_pton(AF_INET,
|
||||||
|
options->source_address().c_str(),
|
||||||
&source_multicast_group.imr_sourceaddr) != 1) {
|
&source_multicast_group.imr_sourceaddr) != 1) {
|
||||||
LOG(ERROR) << "Malformed IPv4 source specific multicast address "
|
LOG(ERROR) << "Malformed IPv4 source specific multicast address "
|
||||||
<< options->source_address();
|
<< options->source_address();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(new_socket.get(), IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP,
|
if (setsockopt(new_socket.get(),
|
||||||
|
IPPROTO_IP,
|
||||||
|
IP_ADD_SOURCE_MEMBERSHIP,
|
||||||
reinterpret_cast<const char*>(&source_multicast_group),
|
reinterpret_cast<const char*>(&source_multicast_group),
|
||||||
sizeof(source_multicast_group)) < 0) {
|
sizeof(source_multicast_group)) < 0) {
|
||||||
LOG(ERROR) << "Failed to join multicast group, error = "
|
LOG(ERROR) << "Failed to join multicast group, error = "
|
||||||
|
@ -245,7 +249,7 @@ bool UdpFile::Open() {
|
||||||
<< GetSocketErrorCode();
|
<< GetSocketErrorCode();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
// Disable IP_MULTICAST_ALL to avoid interference caused when two sockets
|
// Disable IP_MULTICAST_ALL to avoid interference caused when two sockets
|
||||||
|
|
|
@ -50,7 +50,7 @@ const uint8_t kNaluLengthSize = 1;
|
||||||
const bool kIsEncrypted = false;
|
const bool kIsEncrypted = false;
|
||||||
|
|
||||||
const uint8_t kAnyData[] = {
|
const uint8_t kAnyData[] = {
|
||||||
0x01, 0x0F, 0x3C,
|
0x01, 0x0F, 0x3C,
|
||||||
};
|
};
|
||||||
|
|
||||||
class MockPesPacketGenerator : public PesPacketGenerator {
|
class MockPesPacketGenerator : public PesPacketGenerator {
|
||||||
|
@ -349,9 +349,7 @@ TEST_F(TsSegmenterTest, EncryptedSample) {
|
||||||
ON_CALL(*mock_pes_packet_generator_, Flush()).WillByDefault(Return(true));
|
ON_CALL(*mock_pes_packet_generator_, Flush()).WillByDefault(Return(true));
|
||||||
|
|
||||||
const uint8_t kAnyData[] = {
|
const uint8_t kAnyData[] = {
|
||||||
0x01,
|
0x01, 0x0F, 0x3C,
|
||||||
0x0F,
|
|
||||||
0x3C,
|
|
||||||
};
|
};
|
||||||
std::shared_ptr<MediaSample> sample1 =
|
std::shared_ptr<MediaSample> sample1 =
|
||||||
MediaSample::CopyFrom(kAnyData, arraysize(kAnyData), kIsKeyFrame);
|
MediaSample::CopyFrom(kAnyData, arraysize(kAnyData), kIsKeyFrame);
|
||||||
|
|
Loading…
Reference in New Issue