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
122
breadcast-caststream-sys/vendor/openscreen/cast/streaming/public/answer_messages.h
vendored
Normal file
122
breadcast-caststream-sys/vendor/openscreen/cast/streaming/public/answer_messages.h
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
// Copyright 2019 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CAST_STREAMING_PUBLIC_ANSWER_MESSAGES_H_
|
||||
#define CAST_STREAMING_PUBLIC_ANSWER_MESSAGES_H_
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "cast/streaming/resolution.h"
|
||||
#include "cast/streaming/ssrc.h"
|
||||
#include "json/value.h"
|
||||
#include "platform/base/error.h"
|
||||
#include "util/simple_fraction.h"
|
||||
|
||||
namespace openscreen::cast {
|
||||
|
||||
// For each of the below classes, though a number of methods are shared, the use
|
||||
// of a shared base class has intentionally been avoided. This is to improve
|
||||
// readability of the structs provided in this file by cutting down on the
|
||||
// amount of obscuring boilerplate code. For each of the following struct
|
||||
// definitions, the following method definitions are shared:
|
||||
// (1) TryParse. Shall return a boolean indicating whether the out
|
||||
// parameter is in a valid state after checking bounds and restrictions.
|
||||
// (2) ToJson. Should return a proper JSON object. Assumes that IsValid()
|
||||
// has been called already, OSP_CHECKs if not IsValid().
|
||||
// (3) IsValid. Used by both TryParse and ToJson to ensure that the
|
||||
// object is in a good state.
|
||||
struct AudioConstraints {
|
||||
static ErrorOr<AudioConstraints> TryParse(const Json::Value& value);
|
||||
Json::Value ToJson() const;
|
||||
bool IsValid() const;
|
||||
|
||||
int max_sample_rate = 0;
|
||||
int max_channels = 0;
|
||||
int min_bit_rate = 0; // optional
|
||||
int max_bit_rate = 0;
|
||||
std::optional<std::chrono::milliseconds> max_delay = {};
|
||||
};
|
||||
|
||||
struct VideoConstraints {
|
||||
static ErrorOr<VideoConstraints> TryParse(const Json::Value& value);
|
||||
Json::Value ToJson() const;
|
||||
bool IsValid() const;
|
||||
|
||||
std::optional<double> max_pixels_per_second = {};
|
||||
std::optional<Dimensions> min_resolution = {};
|
||||
Dimensions max_dimensions = {};
|
||||
int min_bit_rate = 0; // optional
|
||||
int max_bit_rate = 0;
|
||||
std::optional<std::chrono::milliseconds> max_delay = {};
|
||||
};
|
||||
|
||||
struct Constraints {
|
||||
static ErrorOr<Constraints> TryParse(const Json::Value& value);
|
||||
Json::Value ToJson() const;
|
||||
bool IsValid() const;
|
||||
|
||||
AudioConstraints audio;
|
||||
VideoConstraints video;
|
||||
};
|
||||
|
||||
// Decides whether the Sender scales and letterboxes content to 16:9, or if
|
||||
// it may send video frames of any arbitrary size and the Receiver must
|
||||
// handle the presentation details.
|
||||
enum class AspectRatioConstraint : uint8_t { kVariable = 0, kFixed };
|
||||
|
||||
struct AspectRatio {
|
||||
static ErrorOr<AspectRatio> TryParse(const Json::Value& value);
|
||||
bool IsValid() const;
|
||||
|
||||
bool operator==(const AspectRatio& other) const {
|
||||
return width == other.width && height == other.height;
|
||||
}
|
||||
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
};
|
||||
|
||||
struct DisplayDescription {
|
||||
static ErrorOr<DisplayDescription> TryParse(const Json::Value& value);
|
||||
Json::Value ToJson() const;
|
||||
bool IsValid() const;
|
||||
|
||||
// May exceed, be the same, or less than those mentioned in the
|
||||
// video constraints.
|
||||
std::optional<Dimensions> dimensions;
|
||||
std::optional<AspectRatio> aspect_ratio = {};
|
||||
std::optional<AspectRatioConstraint> aspect_ratio_constraint = {};
|
||||
};
|
||||
|
||||
struct Answer {
|
||||
static ErrorOr<Answer> TryParse(const Json::Value& value);
|
||||
Json::Value ToJson() const;
|
||||
bool IsValid() const;
|
||||
|
||||
int udp_port = 0;
|
||||
std::vector<int> send_indexes;
|
||||
std::vector<Ssrc> ssrcs;
|
||||
|
||||
// Constraints and display descriptions are optional fields, and maybe null in
|
||||
// the valid case.
|
||||
std::optional<Constraints> constraints;
|
||||
std::optional<DisplayDescription> display;
|
||||
std::vector<int> receiver_rtcp_event_log;
|
||||
std::vector<int> receiver_rtcp_dscp;
|
||||
|
||||
// RTP extensions should be empty, but not null.
|
||||
std::vector<std::vector<std::string>> rtp_extensions = {};
|
||||
};
|
||||
|
||||
} // namespace openscreen::cast
|
||||
|
||||
#endif // CAST_STREAMING_PUBLIC_ANSWER_MESSAGES_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue