7 #ifndef MEDIA_FILE_UDP_FILE_H_
8 #define MEDIA_FILE_UDP_FILE_H_
14 #include "packager/base/compiler_specific.h"
15 #include "packager/file/file.h"
21 #endif // defined(OS_WIN)
30 explicit UdpFile(
const char* address_and_port);
34 bool Close()
override;
35 int64_t
Read(
void* buffer, uint64_t length)
override;
36 int64_t
Write(
const void* buffer, uint64_t length)
override;
37 int64_t
Size()
override;
38 bool Flush()
override;
39 bool Seek(uint64_t position)
override;
40 bool Tell(uint64_t* position)
override;
52 bool wsa_started_ =
false;
53 #endif // defined(OS_WIN)
55 DISALLOW_COPY_AND_ASSIGN(
UdpFile);
60 #endif // MEDIA_FILE_UDP_FILE_H_
UdpFile(const char *address_and_port)
All the methods that are virtual are virtual for mocking.
bool Open() override
Internal open. Should not be used directly.
Implements UdpFile, which receives UDP unicast and multicast streams.
bool Seek(uint64_t position) override
Define an abstract file interface.
bool Tell(uint64_t *position) override
int64_t Read(void *buffer, uint64_t length) override
int64_t Write(const void *buffer, uint64_t length) override