DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
udp_options.h
1 // Copyright 2016 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 #include <memory>
8 #include <string>
9 
10 #include "packager/base/strings/string_piece.h"
11 
12 namespace shaka {
13 namespace media {
14 
16 class UdpOptions {
17  public:
18  ~UdpOptions() = default;
19 
23  static std::unique_ptr<UdpOptions> ParseFromString(base::StringPiece udp_url);
24 
25  const std::string& address() const { return address_; }
26  uint16_t port() const { return port_; }
27  bool reuse() const { return reuse_; }
28  const std::string& interface_address() const { return interface_address_; }
29  unsigned timeout_us() const { return timeout_us_; }
30 
31  private:
32  UdpOptions() = default;
33 
35  std::string address_;
36  uint16_t port_ = 0;
38  bool reuse_ = false;
39  // Address of the interface over which to receive UDP multicast streams.
40  std::string interface_address_;
42  unsigned timeout_us_ = 0;
43 };
44 
45 } // namespace media
46 } // namespace shaka
Options parsed from UDP url string of the form: udp://ip:port[?options].
Definition: udp_options.h:16
static std::unique_ptr< UdpOptions > ParseFromString(base::StringPiece udp_url)
Definition: udp_options.cc:73