由于frame merge时已经过滤无效帧,所以移除多余代码

This commit is contained in:
ziyue 2021-07-07 11:37:22 +08:00
parent 59131e3b0a
commit 03addaf0b7
3 changed files with 3 additions and 21 deletions

View File

@ -86,13 +86,7 @@ void MP4MuxerInterface::inputFrame(const Frame::Ptr &frame) {
int64_t dts_out, pts_out; int64_t dts_out, pts_out;
switch (frame->getCodecId()) { switch (frame->getCodecId()) {
case CodecH264: { case CodecH264:
int type = H264_TYPE(*((uint8_t *)frame->data() + frame->prefixSize()));
if(type == H264Frame::NAL_SEI){
break;
}
}
case CodecH265: { case CodecH265: {
//这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理 //这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理
_frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) { _frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) {

View File

@ -94,13 +94,7 @@ void TsMuxer::inputFrame(const Frame::Ptr &frame) {
int64_t dts_out, pts_out; int64_t dts_out, pts_out;
_is_idr_fast_packet = !_have_video; _is_idr_fast_packet = !_have_video;
switch (frame->getCodecId()){ switch (frame->getCodecId()){
case CodecH264: { case CodecH264:
int type = H264_TYPE(*((uint8_t *) frame->data() + frame->prefixSize()));
if (type == H264Frame::NAL_SEI) {
break;
}
}
case CodecH265: { case CodecH265: {
//这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理 //这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理
_frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr){ _frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr){

View File

@ -117,13 +117,7 @@ void PSEncoder::inputFrame(const Frame::Ptr &frame) {
auto &track_info = it->second; auto &track_info = it->second;
int64_t dts_out, pts_out; int64_t dts_out, pts_out;
switch (frame->getCodecId()) { switch (frame->getCodecId()) {
case CodecH264: { case CodecH264:
int type = H264_TYPE(*((uint8_t *) frame->data() + frame->prefixSize()));
if (type == H264Frame::NAL_SEI) {
break;
}
}
case CodecH265: { case CodecH265: {
//这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理 //这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理
_frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) { _frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) {