@@ -38,6 +38,7 @@ class FFMPEG_API_DLL Recorder {
3838 * @return true if initialization is successful, false otherwise.
3939 */
4040 geode::Result<> init (const RenderSettings& settings);
41+
4142 /* *
4243 * @brief Stops the recording process and finalizes the output file.
4344 *
@@ -75,24 +76,29 @@ class FFMPEG_API_DLL Recorder {
7576 geode::Result<> filterFrame (AVFrame* inputFrame, AVFrame* outputFrame);
7677
7778private:
78- AVFormatContext* m_formatContext = nullptr ;
79- const AVCodec* m_codec = nullptr ;
80- AVStream* m_videoStream = nullptr ;
81- AVCodecContext* m_codecContext = nullptr ;
82- AVBufferRef* m_hwDevice = nullptr ;
83- AVFrame* m_frame = nullptr ;
84- AVFrame* m_convertedFrame = nullptr ;
85- AVFrame* m_filteredFrame = nullptr ;
86- AVPacket* m_packet = nullptr ;
87- SwsContext* m_swsCtx = nullptr ;
88- AVFilterGraph* m_filterGraph = nullptr ;
89- AVFilterContext* m_buffersrcCtx = nullptr ;
90- AVFilterContext* m_buffersinkCtx = nullptr ;
91- AVFilterContext* m_colorspaceCtx = nullptr ;
92- AVFilterContext* m_vflipCtx = nullptr ;
79+ class Impl {
80+ public:
81+ AVFormatContext* m_formatContext = nullptr ;
82+ const AVCodec* m_codec = nullptr ;
83+ AVStream* m_videoStream = nullptr ;
84+ AVCodecContext* m_codecContext = nullptr ;
85+ AVBufferRef* m_hwDevice = nullptr ;
86+ AVFrame* m_frame = nullptr ;
87+ AVFrame* m_convertedFrame = nullptr ;
88+ AVFrame* m_filteredFrame = nullptr ;
89+ AVPacket* m_packet = nullptr ;
90+ SwsContext* m_swsCtx = nullptr ;
91+ AVFilterGraph* m_filterGraph = nullptr ;
92+ AVFilterContext* m_buffersrcCtx = nullptr ;
93+ AVFilterContext* m_buffersinkCtx = nullptr ;
94+ AVFilterContext* m_colorspaceCtx = nullptr ;
95+ AVFilterContext* m_vflipCtx = nullptr ;
96+
97+ size_t m_frameCount = 0 ;
98+ bool m_init = false ;
99+ };
93100
94- size_t m_frameCount = 0 ;
95- bool m_init = false ;
101+ std::unique_ptr<Impl> m_impl = nullptr ;
96102};
97103
98104END_FFMPEG_NAMESPACE_V
0 commit comments