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.
75 lines
2 KiB
C++
75 lines
2 KiB
C++
// Copyright 2022 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef PLATFORM_API_TRACE_EVENT_H_
|
|
#define PLATFORM_API_TRACE_EVENT_H_
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "platform/api/time.h"
|
|
#include "platform/base/error.h"
|
|
#include "platform/base/trace_logging_activation.h"
|
|
#include "platform/base/trace_logging_types.h"
|
|
|
|
namespace openscreen {
|
|
|
|
// A collection of common properties of trace events.
|
|
struct TraceEvent {
|
|
// Constructor with only the required fields.
|
|
TraceEvent(TraceCategory category,
|
|
Clock::time_point start_time,
|
|
const char* name,
|
|
const char* file_name,
|
|
uint32_t line_number);
|
|
|
|
TraceEvent();
|
|
TraceEvent(TraceEvent&&) noexcept;
|
|
TraceEvent(const TraceEvent&);
|
|
TraceEvent& operator=(TraceEvent&&);
|
|
TraceEvent& operator=(const TraceEvent&);
|
|
~TraceEvent();
|
|
|
|
std::string ToString() const;
|
|
|
|
// May be called to truncate all std::strings on this object.
|
|
static const size_t kMaxStringLength = 1024;
|
|
void TruncateStrings();
|
|
|
|
// The category of this event.
|
|
TraceCategory category;
|
|
|
|
// Timestamp for when the event was created.
|
|
Clock::time_point start_time;
|
|
|
|
// Name of this operation.
|
|
const char* name = nullptr;
|
|
|
|
// Name of the file the log was generated in.
|
|
const char* file_name = nullptr;
|
|
|
|
// Line number the log was generated on.
|
|
uint32_t line_number = 0;
|
|
|
|
// The trace ids of this event and its ancestors.
|
|
TraceIdHierarchy ids;
|
|
|
|
// Flow IDs associated with this event.
|
|
std::vector<uint64_t> flow_ids;
|
|
|
|
// Optional result of the trace event.
|
|
Error::Code result = Error::Code::kNone;
|
|
|
|
// Optional list of arguments. May contain 0, 1, or 2 arguments.
|
|
// Excess arguments will remain unused.
|
|
using Argument = std::pair<const char*, std::string>;
|
|
std::vector<Argument> arguments;
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& out, const TraceEvent& event);
|
|
|
|
} // namespace openscreen
|
|
|
|
#endif // PLATFORM_API_TRACE_EVENT_H_
|