Files
Piik/native/capture/windows/adaptive_encoder.h
T
AAA 1332473513 feat: rename product and runtime to Piik
Rename the active product, Go module, binaries, configuration, protocols and documentation to Piik while retaining the TV mascot and existing media/room behavior.

Use one current private contract without old-name aliases. Preserve SQLite authority and copy compatible local settings once; other settings start fresh. Git-message cleanup and the infrastructure name cutover are coordinated with this phase, with original history and deployment data archived externally.

Validated locally with Web and Go checks, Windows capture compilation, matched Client/Server builds, packaged Client control handshake and history-rewrite integrity checks. Skip duplicate hosted CI for this owner-authorized local release.

[skip ci]
2026-09-10 11:10:12 +08:00

40 lines
1.1 KiB
C++

#pragma once
#include "h264_encoder.h"
#include <functional>
#include <memory>
namespace piik::capture::windows {
struct AdaptiveAccessUnit final {
EncodedAccessUnit access_unit;
UINT32 width = 0;
UINT32 height = 0;
UINT64 duration100ns = 0;
};
// One complete WebRTC encoding/adaptation pipeline for one shared output.
class AdaptiveEncoder final {
public:
using Factory = std::function<std::unique_ptr<VideoEncoder>(const VideoProfile&)>;
using FrameProducer = std::function<ComPtr<ID3D11Texture2D>(UINT32, UINT32)>;
AdaptiveEncoder(OutputKind kind, VideoProfile ceiling, ID3D11Device* device,
Factory create, std::unique_ptr<VideoEncoder> initial = nullptr,
int output_index = -1);
~AdaptiveEncoder();
AdaptiveEncoder(const AdaptiveEncoder&) = delete;
AdaptiveEncoder& operator=(const AdaptiveEncoder&) = delete;
std::optional<AdaptiveAccessUnit> Encode(
FrameProducer produce, UINT32 source_width, UINT32 source_height,
UINT64 timestamp100ns, bool key_frame, UINT32 bitrate);
private:
class Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace piik::capture::windows