X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=kaeru.cpp;h=b3a9bb3e43f92e09501198cd54c190d3a5579538;hp=10f1e9394b2a5c0ddab4e42a226b0ff7af4ccc73;hb=817fffe1ef3bd87f2387395f49487cf5255d8daf;hpb=330ca2f0052b06d91004c6ceb73cd57ab95e7fe1 diff --git a/kaeru.cpp b/kaeru.cpp index 10f1e93..b3a9bb3 100644 --- a/kaeru.cpp +++ b/kaeru.cpp @@ -31,6 +31,8 @@ BasicStats *global_basic_stats = nullptr; QuittableSleeper should_quit; MuxMetrics stream_mux_metrics; +namespace { + int write_packet(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time) { static bool seen_sync_markers = false; @@ -47,13 +49,15 @@ int write_packet(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType ty if (type == AVIO_DATA_MARKER_HEADER) { stream_mux_header.append((char *)buf, buf_size); - httpd->set_header(stream_mux_header); + httpd->set_header(HTTPD::MAIN_STREAM, stream_mux_header); } else { - httpd->add_data((char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 }); + httpd->add_data(HTTPD::MAIN_STREAM, (char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 }); } return buf_size; } +} // namespace + unique_ptr create_mux(HTTPD *httpd, AVOutputFormat *oformat, X264Encoder *x264_encoder, AudioEncoder *audio_encoder) { AVFormatContext *avctx = avformat_alloc_context();