Skip to content

Commit 13628f6

Browse files
updated badges and fixed deprecation warnings (#36)
* updated badges and fixed deprecation warnings * only use AV_FRAME_FLAG_KEY when available
1 parent ab76dd8 commit 13628f6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ To extract e.g. frames or an mp4 file from a recorded bag, have a look at the
2222
Continuous integration is tested under Ubuntu with the following ROS2 distros:
2323

2424
[![Build Status](https://build.ros2.org/buildStatus/icon?job=Hdev__ffmpeg_image_transport__ubuntu_jammy_amd64&subject=Humble)](https://build.ros2.org/job/Hdev__ffmpeg_image_transport__ubuntu_jammy_amd64/)
25-
[![Build Status](https://build.ros2.org/buildStatus/icon?job=Idev__ffmpeg_image_transport__ubuntu_jammy_amd64&subject=Iron)](https://build.ros2.org/job/Idev__ffmpeg_image_transport__ubuntu_jammy_amd64/)
26-
[![Build Status](https://build.ros2.org/buildStatus/icon?job=Rdev__ffmpeg_image_transport__ubuntu_jammy_amd64&subject=Rolling)](https://build.ros2.org/job/Rdev__ffmpeg_image_transport__ubuntu_jammy_amd64/)
25+
[![Build Status](https://build.ros2.org/buildStatus/icon?job=Jdev__ffmpeg_image_transport__ubuntu_noble_amd6464&subject=Jazzy)](https://build.ros2.org/job/Jdev__ffmpeg_image_transport__ubuntu_noble_amd64/)
26+
[![Build Status](https://build.ros2.org/buildStatus/icon?job=Rdev__ffmpeg_image_transport__ubuntu_noble_amd64&subject=Rolling)](https://build.ros2.org/job/Rdev__ffmpeg_image_transport__ubuntu_noble_amd64/)
2727

2828

2929
## Installation

src/ffmpeg_decoder.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ bool FFMPEGDecoder::decodePacket(const FFMPEGPacketConstPtr & msg)
259259
image->header = msg->header;
260260
image->header.stamp = it->second;
261261
ptsToStamp_.erase(it);
262-
callback_(image, decodedFrame_->key_frame == 1); // deliver callback
262+
// deliver callback
263+
#ifdef AV_FRAME_FLAG_KEY
264+
const bool isKeyFrame = (decodedFrame_->flags & AV_FRAME_FLAG_KEY) != 0;
265+
#else
266+
const bool isKeyFrame = decodedFrame_->key_frame == 1;
267+
#endif
268+
callback_(image, isKeyFrame);
263269
}
264270
}
265271
av_packet_unref(packet);

0 commit comments

Comments
 (0)