@@ -187,12 +187,12 @@ void* unicapture_run(void* data)
187
187
// Convert frame to suitable video formats
188
188
if (ui_frame .pixel_format != PIXFMT_INVALID ) {
189
189
converter_run (& ui_converter , & ui_frame , & ui_frame_converted ,
190
- target_format == PIXFMT_RGB ? PIXFMT_ARGB : PIXFMT_YUV420_SEMI_PLANAR );
190
+ ( target_format == PIXFMT_RGB || target_format == PIXFMT_ARGB ) ? PIXFMT_ARGB : PIXFMT_YUV420_SEMI_PLANAR );
191
191
}
192
192
193
193
if (video_frame .pixel_format != PIXFMT_INVALID ) {
194
194
converter_run (& video_converter , & video_frame , & video_frame_converted ,
195
- target_format == PIXFMT_RGB ? PIXFMT_ARGB : PIXFMT_YUV420_SEMI_PLANAR );
195
+ ( target_format == PIXFMT_RGB || target_format == PIXFMT_ARGB ) ? PIXFMT_ARGB : PIXFMT_YUV420_SEMI_PLANAR );
196
196
}
197
197
198
198
uint64_t frame_converted = getticks_us ();
@@ -204,7 +204,7 @@ void* unicapture_run(void* data)
204
204
const int width = video_frame_converted .width ;
205
205
const int height = video_frame_converted .height ;
206
206
207
- if (target_format == PIXFMT_RGB ) {
207
+ if (target_format == PIXFMT_RGB || target_format == PIXFMT_ARGB ) {
208
208
blended_frame .planes [0 ].buffer = realloc (blended_frame .planes [0 ].buffer , width * height * 4 );
209
209
blended_frame .planes [0 ].stride = width * 4 ;
210
210
blended_frame .pixel_format = PIXFMT_ARGB ;
@@ -266,6 +266,8 @@ void* unicapture_run(void* data)
266
266
FILE * fd = fopen (filename , "wb" );
267
267
if (target_format == PIXFMT_RGB )
268
268
fwrite (final_frame .planes [0 ].buffer , 3 * final_frame .width * final_frame .height , 1 , fd );
269
+ if (target_format == PIXFMT_ARGB )
270
+ fwrite (final_frame .planes [0 ].buffer , 4 * final_frame .width * final_frame .height , 1 , fd );
269
271
if (target_format == PIXFMT_YUV420_SEMI_PLANAR ) {
270
272
fwrite (final_frame .planes [0 ].buffer , final_frame .width * final_frame .height , 1 , fd );
271
273
fwrite (final_frame .planes [1 ].buffer , final_frame .width * final_frame .height / 2 , 1 , fd );
@@ -274,7 +276,7 @@ void* unicapture_run(void* data)
274
276
INFO ("Buffer dumped to: %s" , filename );
275
277
}
276
278
277
- if (this -> callback != NULL && target_format == PIXFMT_RGB ) {
279
+ if (this -> callback != NULL && ( target_format == PIXFMT_RGB || target_format == PIXFMT_ARGB ) ) {
278
280
this -> callback (this -> callback_data , final_frame .width , final_frame .height , final_frame .planes [0 ].buffer );
279
281
}
280
282
0 commit comments