#include "modules/video_capture/linux/video_capture_pipewire.h"
#include <spa/param/format.h>
#include <spa/param/video/format-utils.h>
#include <spa/pod/builder.h>
#include <spa/utils/result.h>
#include <vector>
#include "common_video/libyuv/include/webrtc_libyuv.h"
#include "modules/portal/pipewire_utils.h"
#include "rtc_base/logging.h"
#include "rtc_base/sanitizer.h"
#include "rtc_base/string_to_number.h"
namespace webrtc {
namespace videocapturemodule {
struct { … } constexpr kSupportedFormats[] = …;
VideoType VideoCaptureModulePipeWire::PipeWireRawFormatToVideoType(
uint32_t spa_format) { … }
VideoCaptureModulePipeWire::VideoCaptureModulePipeWire(
VideoCaptureOptions* options)
: … { … }
VideoCaptureModulePipeWire::~VideoCaptureModulePipeWire() { … }
int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) { … }
static spa_pod* BuildFormat(spa_pod_builder* builder,
uint32_t format,
uint32_t width,
uint32_t height,
float frame_rate) { … }
RTC_NO_SANITIZE("cfi-icall")
int32_t VideoCaptureModulePipeWire::StartCapture(
const VideoCaptureCapability& capability) { … }
int32_t VideoCaptureModulePipeWire::StopCapture() { … }
bool VideoCaptureModulePipeWire::CaptureStarted() { … }
int32_t VideoCaptureModulePipeWire::CaptureSettings(
VideoCaptureCapability& settings) { … }
void VideoCaptureModulePipeWire::OnStreamParamChanged(
void* data,
uint32_t id,
const struct spa_pod* format) { … }
RTC_NO_SANITIZE("cfi-icall")
void VideoCaptureModulePipeWire::OnFormatChanged(const struct spa_pod* format) { … }
void VideoCaptureModulePipeWire::OnStreamStateChanged(
void* data,
pw_stream_state old_state,
pw_stream_state state,
const char* error_message) { … }
void VideoCaptureModulePipeWire::OnStreamProcess(void* data) { … }
static VideoRotation VideorotationFromPipeWireTransform(uint32_t transform) { … }
RTC_NO_SANITIZE("cfi-icall")
void VideoCaptureModulePipeWire::ProcessBuffers() { … }
}
}