mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-17 12:08:46 +00:00
Clippy fixes
This commit is contained in:
@ -5,7 +5,6 @@ use anyhow::Error;
|
|||||||
use bytes::{BufMut, Bytes};
|
use bytes::{BufMut, Bytes};
|
||||||
use ffmpeg_sys_next::*;
|
use ffmpeg_sys_next::*;
|
||||||
use ffmpeg_sys_next::AVMediaType::{AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_VIDEO};
|
use ffmpeg_sys_next::AVMediaType::{AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_VIDEO};
|
||||||
use log::warn;
|
|
||||||
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
|
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
|
||||||
use tokio::sync::mpsc::error::TryRecvError;
|
use tokio::sync::mpsc::error::TryRecvError;
|
||||||
use tokio::time::Instant;
|
use tokio::time::Instant;
|
||||||
|
@ -183,7 +183,7 @@ impl HlsEgress {
|
|||||||
av_packet_copy_props(pkt_clone, pkt);
|
av_packet_copy_props(pkt_clone, pkt);
|
||||||
self.packet_buffer.push_back(PipelinePayload::AvPacket(
|
self.packet_buffer.push_back(PipelinePayload::AvPacket(
|
||||||
pkt_clone,
|
pkt_clone,
|
||||||
AVPacketSource::Muxer(variant.clone()),
|
AVPacketSource::Muxer(*variant),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,10 +3,8 @@ use std::{fs, ptr};
|
|||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use ffmpeg_sys_next::{
|
use ffmpeg_sys_next::{
|
||||||
av_dict_set, av_dump_format, av_guess_format, av_interleaved_write_frame, av_malloc,
|
av_dump_format, av_interleaved_write_frame, av_opt_set, avformat_alloc_output_context2, avformat_free_context,
|
||||||
av_mallocz, av_opt_set, av_packet_rescale_ts, av_strdup, av_write_trailer,
|
avio_open2, AVFormatContext, AVPacket, AVIO_FLAG_WRITE,
|
||||||
avformat_alloc_context, avformat_alloc_output_context2, avformat_free_context, avio_open,
|
|
||||||
avio_open2, AVDictionary, AVFormatContext, AVPacket, AVIO_FLAG_WRITE, AV_DICT_APPEND,
|
|
||||||
};
|
};
|
||||||
use ffmpeg_sys_next::{
|
use ffmpeg_sys_next::{
|
||||||
avcodec_parameters_from_context, avformat_write_header, AVFMT_GLOBALHEADER,
|
avcodec_parameters_from_context, avformat_write_header, AVFMT_GLOBALHEADER,
|
||||||
@ -17,8 +15,7 @@ use tokio::sync::mpsc::UnboundedReceiver;
|
|||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::egress::{map_variants_to_streams, EgressConfig};
|
use crate::egress::{map_variants_to_streams, EgressConfig};
|
||||||
use crate::encode::{dump_pkt_info, set_encoded_pkt_timing};
|
use crate::pipeline::{PipelinePayload, PipelineProcessor};
|
||||||
use crate::pipeline::{AVPacketSource, PipelinePayload, PipelineProcessor};
|
|
||||||
use crate::utils::get_ffmpeg_error_msg;
|
use crate::utils::get_ffmpeg_error_msg;
|
||||||
use crate::variant::VariantStreamType;
|
use crate::variant::VariantStreamType;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ use crate::encode::set_encoded_pkt_timing;
|
|||||||
use crate::ipc::Rx;
|
use crate::ipc::Rx;
|
||||||
use crate::pipeline::{AVFrameSource, AVPacketSource, PipelinePayload, PipelineProcessor};
|
use crate::pipeline::{AVFrameSource, AVPacketSource, PipelinePayload, PipelineProcessor};
|
||||||
use crate::utils::get_ffmpeg_error_msg;
|
use crate::utils::get_ffmpeg_error_msg;
|
||||||
use crate::variant::{AudioVariant, VariantStream, VariantStreamType};
|
use crate::variant::{AudioVariant, VariantStreamType};
|
||||||
|
|
||||||
pub struct AudioEncoder<T> {
|
pub struct AudioEncoder<T> {
|
||||||
variant: AudioVariant,
|
variant: AudioVariant,
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
use ffmpeg_sys_next::{
|
use ffmpeg_sys_next::{
|
||||||
AV_NOPTS_VALUE, av_packet_rescale_ts, AV_PKT_FLAG_KEY, av_rescale_q, AVCodecContext, AVPacket,
|
AV_NOPTS_VALUE, av_packet_rescale_ts, AV_PKT_FLAG_KEY, AVCodecContext, AVPacket,
|
||||||
AVRational, AVStream,
|
AVRational,
|
||||||
};
|
};
|
||||||
use ffmpeg_sys_next::AVMediaType::{AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_VIDEO};
|
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
use crate::variant::VariantStreamType;
|
use crate::variant::VariantStreamType;
|
||||||
|
@ -10,7 +10,7 @@ use ffmpeg_sys_next::{
|
|||||||
use libc::EAGAIN;
|
use libc::EAGAIN;
|
||||||
use tokio::sync::mpsc::UnboundedSender;
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
|
|
||||||
use crate::encode::{dump_pkt_info, set_encoded_pkt_timing};
|
use crate::encode::set_encoded_pkt_timing;
|
||||||
use crate::ipc::Rx;
|
use crate::ipc::Rx;
|
||||||
use crate::pipeline::{AVFrameSource, AVPacketSource, PipelinePayload, PipelineProcessor};
|
use crate::pipeline::{AVFrameSource, AVPacketSource, PipelinePayload, PipelineProcessor};
|
||||||
use crate::utils::get_ffmpeg_error_msg;
|
use crate::utils::get_ffmpeg_error_msg;
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
use std::{ptr, slice};
|
use std::{ptr, slice};
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
use std::time::{Duration, SystemTime};
|
|
||||||
|
|
||||||
use ffmpeg_sys_next::{
|
use ffmpeg_sys_next::{
|
||||||
av_frame_alloc, av_frame_copy_props, av_frame_free, av_frame_get_buffer, av_packet_alloc,
|
av_frame_alloc, av_frame_copy_props, av_frame_free, av_frame_get_buffer, av_packet_alloc,
|
||||||
av_packet_free, AV_PROFILE_H264_MAIN, av_q2d, avcodec_alloc_context3, avcodec_find_encoder,
|
av_packet_free, AV_PROFILE_H264_MAIN, avcodec_alloc_context3, avcodec_find_encoder,
|
||||||
avcodec_open2, avcodec_receive_packet, avcodec_send_frame, AVERROR, AVRational,
|
avcodec_open2, avcodec_receive_packet, avcodec_send_frame, AVERROR, AVRational,
|
||||||
EAGAIN, SWS_BILINEAR, sws_getContext, sws_scale_frame,
|
EAGAIN, SWS_BILINEAR, sws_getContext, sws_scale_frame,
|
||||||
};
|
};
|
||||||
use ffmpeg_sys_next::AVCodecID::AV_CODEC_ID_H264;
|
use ffmpeg_sys_next::AVCodecID::AV_CODEC_ID_H264;
|
||||||
use ffmpeg_sys_next::AVColorSpace::{AVCOL_SPC_BT709, AVCOL_SPC_RGB};
|
use ffmpeg_sys_next::AVColorSpace::{AVCOL_SPC_BT709, AVCOL_SPC_RGB};
|
||||||
use ffmpeg_sys_next::AVPictureType::AV_PICTURE_TYPE_NONE;
|
use ffmpeg_sys_next::AVPictureType::AV_PICTURE_TYPE_NONE;
|
||||||
use ffmpeg_sys_next::AVPixelFormat::{AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV420P};
|
use ffmpeg_sys_next::AVPixelFormat::{AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV420P};
|
||||||
use fontdue::layout::{CoordinateSystem, Layout, TextStyle};
|
use fontdue::layout::{CoordinateSystem, Layout, TextStyle};
|
||||||
use libc::memcpy;
|
use libc::memcpy;
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use tokio::sync::mpsc::unbounded_channel;
|
use tokio::sync::mpsc::unbounded_channel;
|
||||||
use usvg::{Font, Node};
|
|
||||||
|
|
||||||
use crate::ingress::ConnectionInfo;
|
use crate::ingress::ConnectionInfo;
|
||||||
use crate::pipeline::builder::PipelineBuilder;
|
use crate::pipeline::builder::PipelineBuilder;
|
||||||
|
@ -126,7 +126,7 @@ impl Clone for PipelinePayload {
|
|||||||
PipelinePayload::AvFrame(new_frame, v.clone())
|
PipelinePayload::AvFrame(new_frame, v.clone())
|
||||||
},
|
},
|
||||||
PipelinePayload::SourceInfo(i) => PipelinePayload::SourceInfo(i.clone()),
|
PipelinePayload::SourceInfo(i) => PipelinePayload::SourceInfo(i.clone()),
|
||||||
PipelinePayload::EncoderInfo(v, s) => PipelinePayload::EncoderInfo(v.clone(), *s),
|
PipelinePayload::EncoderInfo(v, s) => PipelinePayload::EncoderInfo(*v, *s),
|
||||||
PipelinePayload::Flush => PipelinePayload::Flush,
|
PipelinePayload::Flush => PipelinePayload::Flush,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ use anyhow::Error;
|
|||||||
use tokio::sync::mpsc::UnboundedSender;
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
|
|
||||||
use crate::ipc::Rx;
|
use crate::ipc::Rx;
|
||||||
use crate::pipeline::{AVFrameSource, AVPacketSource, PipelinePayload, PipelineProcessor};
|
use crate::pipeline::{PipelinePayload, PipelineProcessor};
|
||||||
use crate::variant::{VariantStream, VariantStreamType};
|
use crate::variant::VariantStream;
|
||||||
|
|
||||||
pub struct TagFrame<TRecv> {
|
pub struct TagFrame<TRecv> {
|
||||||
variant: VariantStream,
|
variant: VariantStream,
|
||||||
|
@ -10,7 +10,6 @@ use ffmpeg_sys_next::{
|
|||||||
};
|
};
|
||||||
use ffmpeg_sys_next::AVChannelOrder::AV_CHANNEL_ORDER_NATIVE;
|
use ffmpeg_sys_next::AVChannelOrder::AV_CHANNEL_ORDER_NATIVE;
|
||||||
use ffmpeg_sys_next::AVCodecID::{AV_CODEC_ID_AAC, AV_CODEC_ID_H264};
|
use ffmpeg_sys_next::AVCodecID::{AV_CODEC_ID_AAC, AV_CODEC_ID_H264};
|
||||||
use ffmpeg_sys_next::AVColorRange::AVCOL_RANGE_MPEG;
|
|
||||||
use ffmpeg_sys_next::AVColorSpace::AVCOL_SPC_BT709;
|
use ffmpeg_sys_next::AVColorSpace::AVCOL_SPC_BT709;
|
||||||
use ffmpeg_sys_next::AVPixelFormat::AV_PIX_FMT_YUV420P;
|
use ffmpeg_sys_next::AVPixelFormat::AV_PIX_FMT_YUV420P;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
Reference in New Issue
Block a user