MCPcopy Create free account
hub / github.com/WiVRn/WiVRn / ProcessCb

Method ProcessCb

server/encoder/video_encoder_x264.cpp:32–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30{
31
32void video_encoder_x264::ProcessCb(x264_t * h, x264_nal_t * nal, void * opaque)
33{
34 video_encoder_x264 * self = (video_encoder_x264 *)opaque;
35 std::vector<uint8_t> data(nal->i_payload * 3 / 2 + 5 + 64, 0);
36 x264_nal_encode(h, data.data(), nal);
37 data.resize(nal->i_payload);
38 switch (nal->i_type)
39 {
40 case NAL_SPS:
41 case NAL_PPS: {
42 self->SendData(data, false, self->control);
43 break;
44 }
45 case NAL_SLICE:
46 case NAL_SLICE_DPA:
47 case NAL_SLICE_DPB:
48 case NAL_SLICE_DPC:
49 case NAL_SLICE_IDR:
50 self->ProcessNal({nal->i_first_mb, nal->i_last_mb, std::move(data)});
51 }
52}
53
54void video_encoder_x264::ProcessNal(pending_nal && nal)
55{

Callers

nothing calls this directly

Calls 4

ProcessNalMethod · 0.95
SendDataMethod · 0.80
dataMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected