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"
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;
55 DISALLOW_COPY_AND_ASSIGN(
UdpFile);
Define an abstract file interface.
Implements UdpFile, which receives UDP unicast and multicast streams.
bool Seek(uint64_t position) override
int64_t Write(const void *buffer, uint64_t length) override
bool Tell(uint64_t *position) override
int64_t Read(void *buffer, uint64_t length) override
bool Open() override
Internal open. Should not be used directly.
UdpFile(const char *address_and_port)
All the methods that are virtual are virtual for mocking.