mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
由于frame merge时已经过滤无效帧,所以移除多余代码
This commit is contained in:
parent
59131e3b0a
commit
03addaf0b7
@ -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) {
|
||||||
|
@ -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){
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user