DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs
udp_file.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_FILE_UDP_FILE_H_
8 #define MEDIA_FILE_UDP_FILE_H_
9 
10 #include <stdint.h>
11 
12 #include <string>
13 
14 #include "packager/base/compiler_specific.h"
15 #include "packager/media/file/file.h"
16 
17 namespace edash_packager {
18 namespace media {
19 
21 class UdpFile : public File {
22  public:
25  explicit UdpFile(const char* address_and_port);
26 
29  virtual bool Close() OVERRIDE;
30  virtual int64_t Read(void* buffer, uint64_t length) OVERRIDE;
31  virtual int64_t Write(const void* buffer, uint64_t length) OVERRIDE;
32  virtual int64_t Size() OVERRIDE;
33  virtual bool Flush() OVERRIDE;
34  virtual bool Seek(uint64_t position) OVERRIDE;
35  virtual bool Tell(uint64_t* position) OVERRIDE;
37 
38  protected:
39  virtual ~UdpFile();
40 
41  virtual bool Open() OVERRIDE;
42 
43  private:
44  int socket_;
45 
46  DISALLOW_COPY_AND_ASSIGN(UdpFile);
47 };
48 
49 } // namespace media
50 } // namespace edash_packager
51 
52 #endif // MEDIA_FILE_UDP_FILE_H_
UdpFile(const char *address_and_port)
Implements UdpFile, which receives UDP unicast and multicast streams.
Definition: udp_file.h:21
Define an abstract file interface.
Definition: file.h:22
virtual bool Flush() OVERRIDE
virtual bool Open() OVERRIDE
Internal open. Should not be used directly.
virtual bool Tell(uint64_t *position) OVERRIDE
virtual int64_t Write(const void *buffer, uint64_t length) OVERRIDE
virtual int64_t Read(void *buffer, uint64_t length) OVERRIDE
virtual int64_t Size() OVERRIDE
virtual bool Close() OVERRIDE
virtual bool Seek(uint64_t position) OVERRIDE