aboutsummaryrefslogtreecommitdiff
path: root/graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp
diff options
context:
space:
mode:
authorDima Panov <fluffy@FreeBSD.org>2025-07-21 11:55:53 +0000
committerDima Panov <fluffy@FreeBSD.org>2025-07-21 11:59:27 +0000
commit3b84553e70c09adf08cd16ac0ad5b8897a5189df (patch)
tree9f4127e803eae0850803adb8f026cb36681e48fd /graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp
parent06475261fd6657c01efda21826f6eed146f6474f (diff)
Diffstat (limited to 'graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp')
-rw-r--r--graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp b/graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp
new file mode 100644
index 000000000000..59d4ef26d5ff
--- /dev/null
+++ b/graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegDecoderVideo.hpp
@@ -0,0 +1,62 @@
+--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp.orig 2022-12-01 18:17:31 UTC
++++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
+@@ -1,4 +1,3 @@
+-
+ #ifndef HEADER_GUARD_OSGFFMPEG_FFMPEG_DECODER_VIDEO_H
+ #define HEADER_GUARD_OSGFFMPEG_FFMPEG_DECODER_VIDEO_H
+
+@@ -15,11 +14,11 @@ class FramePtr
+
+ class FramePtr
+ {
+- public:
++ public:
+
+ typedef AVFrame T;
+
+- explicit FramePtr() : _ptr(0) {}
++ explicit FramePtr() : _ptr(nullptr) {}
+ explicit FramePtr(T* ptr) : _ptr(ptr) {}
+
+ ~FramePtr()
+@@ -43,14 +42,11 @@ class FramePtr
+
+ void cleanup()
+ {
+- if (_ptr) av_free(_ptr);
+- _ptr = 0;
++ if (_ptr) av_frame_free(&_ptr);
++ _ptr = nullptr;
+ }
+
+-
+-
+ protected:
+-
+ T* _ptr;
+ };
+
+@@ -88,12 +84,11 @@ class FFmpegDecoderVideo : public OpenThreads::Thread
+ void findAspectRatio();
+ void publishFrame(double delay, bool audio_disabled);
+ double synchronizeVideo(double pts);
+- void yuva420pToRgba(AVPicture *dst, AVPicture *src, int width, int height);
++ void yuva420pToRgba(AVFrame* dst, AVFrame* src, int width, int height);
+
+- int convert(AVPicture *dst, int dst_pix_fmt, AVPicture *src,
++ int convert(AVFrame* dst, int dst_pix_fmt, AVFrame* src,
+ int src_pix_fmt, int src_width, int src_height);
+
+-
+ static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
+ static void freeBuffer(void * opaque, uint8_t *data);
+
+@@ -101,7 +96,7 @@ class FFmpegDecoderVideo : public OpenThreads::Thread
+ FFmpegClocks & m_clocks;
+ AVStream * m_stream;
+ AVCodecContext * m_context;
+- AVCodec * m_codec;
++ const AVCodec* m_codec;
+ const uint8_t * m_packet_data;
+ int m_bytes_remaining;
+ int64_t m_packet_pts;