(API Change) Remove pointers from all typedefs

Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
This commit is contained in:
jp9000
2014-09-25 17:44:05 -07:00
parent 4a06960188
commit c9df41c1e2
146 changed files with 3105 additions and 3079 deletions

View File

@@ -26,7 +26,7 @@
#include "obs-ffmpeg-compat.h"
struct aac_encoder {
obs_encoder_t encoder;
obs_encoder_t *encoder;
AVCodec *aac;
AVCodecContext *context;
@@ -109,7 +109,7 @@ static bool initialize_codec(struct aac_encoder *enc)
return true;
}
static void init_sizes(struct aac_encoder *enc, audio_t audio)
static void init_sizes(struct aac_encoder *enc, audio_t *audio)
{
const struct audio_output_info *aoi;
enum audio_format format;
@@ -121,11 +121,11 @@ static void init_sizes(struct aac_encoder *enc, audio_t audio)
enc->audio_size = get_audio_size(format, aoi->speakers, 1);
}
static void *aac_create(obs_data_t settings, obs_encoder_t encoder)
static void *aac_create(obs_data_t *settings, obs_encoder_t *encoder)
{
struct aac_encoder *enc;
int bitrate = (int)obs_data_get_int(settings, "bitrate");
audio_t audio = obs_encoder_audio(encoder);
audio_t *audio = obs_encoder_audio(encoder);
if (!bitrate) {
aac_warn("aac_create", "Invalid bitrate specified");
@@ -235,14 +235,14 @@ static bool aac_encode(void *data, struct encoder_frame *frame,
return do_aac_encode(enc, packet, received_packet);
}
static void aac_defaults(obs_data_t settings)
static void aac_defaults(obs_data_t *settings)
{
obs_data_set_default_int(settings, "bitrate", 128);
}
static obs_properties_t aac_properties(void)
static obs_properties_t *aac_properties(void)
{
obs_properties_t props = obs_properties_create();
obs_properties_t *props = obs_properties_create();
obs_properties_add_int(props, "bitrate",
obs_module_text("Bitrate"), 32, 320, 32);

View File

@@ -70,7 +70,7 @@ struct ffmpeg_data {
};
struct ffmpeg_output {
obs_output_t output;
obs_output_t *output;
volatile bool active;
struct ffmpeg_data ff_data;
@@ -80,8 +80,8 @@ struct ffmpeg_output {
bool write_thread_active;
pthread_mutex_t write_mutex;
pthread_t write_thread;
os_sem_t write_sem;
os_event_t stop_event;
os_sem_t *write_sem;
os_event_t *stop_event;
DARRAY(AVPacket) packets;
};
@@ -415,7 +415,7 @@ static void ffmpeg_log_callback(void *param, int level, const char *format,
UNUSED_PARAMETER(param);
}
static void *ffmpeg_output_create(obs_data_t settings, obs_output_t output)
static void *ffmpeg_output_create(obs_data_t *settings, obs_output_t *output)
{
struct ffmpeg_output *data = bzalloc(sizeof(struct ffmpeg_output));
pthread_mutex_init_value(&data->write_mutex);
@@ -714,7 +714,7 @@ static void *write_thread(void *data)
static bool try_connect(struct ffmpeg_output *output)
{
const char *filename_test;
obs_data_t settings;
obs_data_t *settings;
int audio_bitrate, video_bitrate;
int width, height;
int ret;