Add planar audio support, improve test output
- Add planar audio support. FFmpeg and libav use planar audio for many encoders, so it was somewhat necessary to add support in libobs itself. - Improve/adjust FFmpeg test output plugin. The exports were somewhat messed up (making me rethink how exports should be done). Not yet functional; it handles video properly, but it still does not handle audio properly. - Improve planar video code. The planar video code was not properly accounting for row sizes for each plane. Specifying row sizes for each plane has now been added. This will also make it more compatible with FFmpeg/libav. - Fixed a bug where callbacks wouldn't create properly in audio-io and video-io code. - Implement 'blogva' function to allow for va_list usage with libobs logging.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <util/c99defs.h>
|
||||
#include <media-io/audio-io.h>
|
||||
#include <media-io/video-io.h>
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
@@ -31,12 +32,13 @@ struct ffmpeg_data {
|
||||
AVFormatContext *output;
|
||||
struct SwsContext *swscale;
|
||||
|
||||
AVFrame *vframe;
|
||||
AVPicture src_picture;
|
||||
AVPicture dst_picture;
|
||||
AVFrame *vframe;
|
||||
int total_frames;
|
||||
|
||||
uint8_t *samples[MAX_AUDIO_PLANES];
|
||||
AVFrame *aframe;
|
||||
uint8_t **samples;
|
||||
int total_samples;
|
||||
|
||||
bool initialized;
|
||||
};
|
||||
@@ -49,12 +51,12 @@ struct ffmpeg_output {
|
||||
|
||||
EXPORT const char *ffmpeg_output_getname(const char *locale);
|
||||
|
||||
EXPORT struct ffmpeg_output *ffmpeg_output_create(obs_data_t settings,
|
||||
EXPORT struct ffmpeg_output *ffmpeg_output_create(const char *settings,
|
||||
obs_output_t output);
|
||||
EXPORT void ffmpeg_output_destroy(struct ffmpeg_output *data);
|
||||
|
||||
EXPORT void ffmpeg_output_update(struct ffmpeg_output *data,
|
||||
obs_data_t settings);
|
||||
const char *settings);
|
||||
|
||||
EXPORT bool ffmpeg_output_start(struct ffmpeg_output *data);
|
||||
EXPORT void ffmpeg_output_stop(struct ffmpeg_output *data);
|
||||
|
Reference in New Issue
Block a user