Shaka Packager SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
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 
15 class UdpOptions {
16  public:
17  ~UdpOptions() = default;
18 
22  static std::unique_ptr<UdpOptions> ParseFromString(base::StringPiece udp_url);
23 
24  const std::string& address() const { return address_; }
25  uint16_t port() const { return port_; }
26  bool reuse() const { return reuse_; }
27  const std::string& interface_address() const { return interface_address_; }
28  unsigned timeout_us() const { return timeout_us_; }
29 
30  private:
31  UdpOptions() = default;
32 
34  std::string address_;
35  uint16_t port_ = 0;
37  bool reuse_ = false;
38  // Address of the interface over which to receive UDP multicast streams.
39  std::string interface_address_;
41  unsigned timeout_us_ = 0;
42 };
43 
44 } // namespace shaka
static std::unique_ptr< UdpOptions > ParseFromString(base::StringPiece udp_url)
Definition: udp_options.cc:72
Options parsed from UDP url string of the form: udp://ip:port[?options].
Definition: udp_options.h:15