Implement Cast Streaming mirroring, DLNA casting, daemon+GUI, and breadd integration
Some checks failed
dev release / build (push) Failing after 12s
Some checks failed
dev release / build (push) Failing after 12s
Builds out the full v1 scope: a vendored+patched openscreen subset for low-latency Cast Streaming (Mirroring receiver 0F5096E8) alongside the existing Cast V2/HLS and new DLNA/AVTransport casting paths, breadcastd's Idle/Casting state machine with a private IPC socket, the breadcast GTK4 popup as a thin IPC client, and bread.cast.*/bread.command.cast.* breadd integration (device discovery, start/stop, mirroring lifecycle events). Also adds bakery/systemd/Forgejo CI packaging. Validated end-to-end against a real Chromecast/Google TV: negotiated Cast Streaming session, live pipeline playback, and daemon+GUI click-to-cast/ stop through the actual popup.
This commit is contained in:
parent
887c29002f
commit
8c745d18e0
283 changed files with 36788 additions and 0 deletions
73
breadcast-caststream-sys/vendor/openscreen/util/simple_fraction.h
vendored
Normal file
73
breadcast-caststream-sys/vendor/openscreen/util/simple_fraction.h
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
// Copyright 2020 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef UTIL_SIMPLE_FRACTION_H_
|
||||
#define UTIL_SIMPLE_FRACTION_H_
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "platform/base/error.h"
|
||||
|
||||
namespace openscreen {
|
||||
|
||||
// SimpleFraction is used to represent simple (or "common") fractions, composed
|
||||
// of a rational number written a/b where a and b are both integers.
|
||||
// Some helpful notes on SimpleFraction assumptions/limitations:
|
||||
// 1. SimpleFraction does not perform reductions. 2/4 != 1/2, and -1/-1 != 1/1.
|
||||
// 2. denominator = 0 is considered undefined.
|
||||
// 3. numerator = saturates range to int min or int max
|
||||
// 4. A SimpleFraction is "positive" if and only if it is defined and at least
|
||||
// equal to zero. Since reductions are not performed, -1/-1 is negative.
|
||||
class SimpleFraction {
|
||||
public:
|
||||
static ErrorOr<SimpleFraction> FromString(std::string_view value);
|
||||
std::string ToString() const;
|
||||
|
||||
constexpr SimpleFraction() = default;
|
||||
constexpr SimpleFraction(int numerator) // NOLINT
|
||||
: numerator_(numerator) {}
|
||||
constexpr SimpleFraction(int numerator, int denominator)
|
||||
: numerator_(numerator), denominator_(denominator) {}
|
||||
|
||||
constexpr SimpleFraction(const SimpleFraction&) = default;
|
||||
constexpr SimpleFraction(SimpleFraction&&) noexcept = default;
|
||||
constexpr SimpleFraction& operator=(const SimpleFraction&) = default;
|
||||
constexpr SimpleFraction& operator=(SimpleFraction&&) = default;
|
||||
~SimpleFraction() = default;
|
||||
|
||||
constexpr bool operator==(const SimpleFraction& other) const {
|
||||
return numerator_ == other.numerator_ && denominator_ == other.denominator_;
|
||||
}
|
||||
|
||||
constexpr bool operator!=(const SimpleFraction& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
constexpr bool is_defined() const { return denominator_ != 0; }
|
||||
|
||||
constexpr bool is_positive() const {
|
||||
return (numerator_ >= 0) && (denominator_ > 0);
|
||||
}
|
||||
|
||||
constexpr explicit operator double() const {
|
||||
if (denominator_ == 0) {
|
||||
return nan("");
|
||||
}
|
||||
return static_cast<double>(numerator_) / static_cast<double>(denominator_);
|
||||
}
|
||||
|
||||
constexpr int numerator() const { return numerator_; }
|
||||
constexpr int denominator() const { return denominator_; }
|
||||
|
||||
private:
|
||||
int numerator_ = 0;
|
||||
int denominator_ = 1;
|
||||
};
|
||||
|
||||
} // namespace openscreen
|
||||
|
||||
#endif // UTIL_SIMPLE_FRACTION_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue