Skip to content

Commit

Permalink
Format update
Browse files Browse the repository at this point in the history
  • Loading branch information
mondain committed Jan 6, 2025
1 parent 0ba3ab0 commit f9de7e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
17 changes: 8 additions & 9 deletions io/src/main/java/org/red5/codec/AVCVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ public boolean addData(IoBuffer data, int timestamp) {
if (enhanced) {
// get the packet type
packetType = VideoPacketType.valueOf(flg & IoConstants.MASK_VIDEO_CODEC);
if(frameType.getValue() < 5 && packetType.getPacketType() < 5 ) {
if (frameType.getValue() < 5 && packetType.getPacketType() < 5) {
// get the fourcc
fourcc = data.getInt();
fourcc = data.getInt();
result = (codec.getFourcc() == fourcc);
if(!result) {
if (!result) {
data.reset();
return result;
}
Expand Down Expand Up @@ -184,9 +184,8 @@ public boolean addData(IoBuffer data, int timestamp) {
// not handled
break;
}


} else if((flg & IoConstants.MASK_VIDEO_CODEC) == codec.getId()){

} else if ((flg & IoConstants.MASK_VIDEO_CODEC) == codec.getId()) {
result = true;
// get the codecs frame type
byte avcType = data.get();
Expand All @@ -196,11 +195,11 @@ public boolean addData(IoBuffer data, int timestamp) {
log.debug("AVC type: {}", avcType);
}
switch (avcType) {
case 1: // VCL video coding layer,
case 1: // VCL video coding layer,
frameType = VideoFrameType.valueOf((flg & IoConstants.MASK_VIDEO_FRAMETYPE) >> 4);
switch (frameType) {
case KEYFRAME: // keyframe

if (isDebug) {
log.debug("Keyframe - keyframeTimestamp: {}", keyframeTimestamp);
}
Expand Down Expand Up @@ -236,7 +235,7 @@ public boolean addData(IoBuffer data, int timestamp) {
//log.trace("Interframes: {}", interframes.size());
}
break;
}
}
break;
case 0: // configuration
if (isDebug) {
Expand Down
10 changes: 5 additions & 5 deletions io/src/main/java/org/red5/codec/AbstractVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ public boolean addData(IoBuffer data, int timestamp) {
if (multitrackType != AvMultitrackType.ManyTracksManyCodecs) {
// The tracks are encoded with the same codec identified by the FOURCC
trackCodec = getTrackCodec(data);
}
}else {
}
} else {
trackCodec = getTrackCodec(data);
}
log.debug("Multitrack: {} multitrackType: {} packetType: {}", multitrack, multitrackType, packetType);
Expand Down Expand Up @@ -248,10 +248,10 @@ public boolean addData(IoBuffer data, int timestamp) {
// break out of the loop
break;
}
if(command != null && trackCodec == null) {
if (command != null && trackCodec == null) {
result = true;
}else {
result = multitrack?true:codec == trackCodec.getCodec();
} else {
result = multitrack ? true : codec == trackCodec.getCodec();
}
} else {
// read the first byte verify the codec matches
Expand Down

0 comments on commit f9de7e7

Please sign in to comment.