1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CAST_SENDER_PUBLIC_CAST_MEDIA_SOURCE_H_ 6 #define CAST_SENDER_PUBLIC_CAST_MEDIA_SOURCE_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "platform/base/error.h" 12 13 namespace openscreen { 14 namespace cast { 15 16 class CastMediaSource { 17 public: 18 static ErrorOr<CastMediaSource> From(const std::string& source); 19 20 CastMediaSource(std::string source, std::vector<std::string> app_ids); 21 CastMediaSource(const CastMediaSource& other); 22 CastMediaSource(CastMediaSource&& other); 23 ~CastMediaSource(); 24 25 CastMediaSource& operator=(const CastMediaSource& other); 26 CastMediaSource& operator=(CastMediaSource&& other); 27 28 bool ContainsAppId(const std::string& app_id) const; 29 bool ContainsAnyAppIdFrom(const std::vector<std::string>& app_ids) const; 30 source_id()31 const std::string& source_id() const { return source_id_; } app_ids()32 const std::vector<std::string>& app_ids() const { return app_ids_; } 33 34 private: 35 std::string source_id_; 36 std::vector<std::string> app_ids_; 37 }; 38 39 } // namespace cast 40 } // namespace openscreen 41 42 #endif // CAST_SENDER_PUBLIC_CAST_MEDIA_SOURCE_H_ 43