From: Jaroslav Kysela Date: Mon, 4 Sep 2017 15:14:37 +0000 (+0200) Subject: transcode: try to tidy typedef/struct X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa052acbe8cc3873bf9ed2c64dbc953124bcda16;p=thirdparty%2Ftvheadend.git transcode: try to tidy typedef/struct --- diff --git a/src/transcoding/codec.h b/src/transcoding/codec.h index 148dfd304..06d581839 100644 --- a/src/transcoding/codec.h +++ b/src/transcoding/codec.h @@ -37,11 +37,11 @@ #define tvh_sct_t streaming_component_type_t -struct tvh_codec_t; -typedef struct tvh_codec_t TVHCodec; +struct tvh_codec; +typedef struct tvh_codec TVHCodec; -struct tvh_codec_profile_t; -typedef struct tvh_codec_profile_t TVHCodecProfile; +struct tvh_codec_profile; +typedef struct tvh_codec_profile TVHCodecProfile; /* codec_profile_class ====================================================== */ @@ -60,17 +60,17 @@ typedef struct { /* TVHCodec ================================================================= */ -typedef struct tvh_codec_t { +struct tvh_codec { const char *name; size_t size; const codec_profile_class_t *idclass; AVCodec *codec; const AVProfile *profiles; int (*profile_init)(TVHCodecProfile *, htsmsg_t *conf); - SLIST_ENTRY(tvh_codec_t) link; -} TVHCodec; + SLIST_ENTRY(tvh_codec) link; +}; -SLIST_HEAD(TVHCodecs, tvh_codec_t); +SLIST_HEAD(TVHCodecs, tvh_codec); extern struct TVHCodecs tvh_codecs; const idclass_t * @@ -87,7 +87,7 @@ tvh_codec_get_title(TVHCodec *self); extern const codec_profile_class_t codec_profile_class; -typedef struct tvh_codec_profile_t { +struct tvh_codec_profile { idnode_t idnode; TVHCodec *codec; const char *name; @@ -97,10 +97,10 @@ typedef struct tvh_codec_profile_t { double qscale; int profile; char *device; // for hardware acceleration - LIST_ENTRY(tvh_codec_profile_t) link; -} TVHCodecProfile; + LIST_ENTRY(tvh_codec_profile) link; +}; -LIST_HEAD(TVHCodecProfiles, tvh_codec_profile_t); +LIST_HEAD(TVHCodecProfiles, tvh_codec_profile); extern struct TVHCodecProfiles tvh_codec_profiles; int diff --git a/src/transcoding/transcode/context.c b/src/transcoding/transcode/context.c index 24cd6adf5..c346756f0 100644 --- a/src/transcoding/transcode/context.c +++ b/src/transcoding/transcode/context.c @@ -33,7 +33,7 @@ extern TVHContextType TVHVideoContext; extern TVHContextType TVHAudioContext; -SLIST_HEAD(TVHContextTypes, tvh_context_type_t); +SLIST_HEAD(TVHContextTypes, tvh_context_type); static struct TVHContextTypes tvh_context_types; diff --git a/src/transcoding/transcode/helpers.c b/src/transcoding/transcode/helpers.c index be67c074e..8e6ef714d 100644 --- a/src/transcoding/transcode/helpers.c +++ b/src/transcoding/transcode/helpers.c @@ -26,7 +26,7 @@ #include "parsers/parser_hevc.h" -SLIST_HEAD(TVHContextHelpers, tvh_context_helper_t); +SLIST_HEAD(TVHContextHelpers, tvh_context_helper); static struct TVHContextHelpers tvh_decoder_helpers; static struct TVHContextHelpers tvh_encoder_helpers; diff --git a/src/transcoding/transcode/internals.h b/src/transcoding/transcode/internals.h index 2abdac5c1..256ed6558 100644 --- a/src/transcoding/transcode/internals.h +++ b/src/transcoding/transcode/internals.h @@ -42,20 +42,20 @@ extern TVHCodecProfile *tvh_codec_profile_copy; -struct tvh_transcoder_t; -typedef struct tvh_transcoder_t TVHTranscoder; +struct tvh_transcoder; +typedef struct tvh_transcoder TVHTranscoder; -struct tvh_stream_t; -typedef struct tvh_stream_t TVHStream; +struct tvh_stream; +typedef struct tvh_stream TVHStream; -struct tvh_context_type_t; -typedef struct tvh_context_type_t TVHContextType; +struct tvh_context_type; +typedef struct tvh_context_type TVHContextType; -struct tvh_context_t; -typedef struct tvh_context_t TVHContext; +struct tvh_context; +typedef struct tvh_context TVHContext; -struct tvh_context_helper_t; -typedef struct tvh_context_helper_t TVHContextHelper; +struct tvh_context_helper; +typedef struct tvh_context_helper TVHContextHelper; // post phase _MUST_ be == phase + 1 typedef enum { @@ -68,16 +68,16 @@ typedef enum { /* TVHTranscoder ============================================================ */ -SLIST_HEAD(TVHStreams, tvh_stream_t); +SLIST_HEAD(TVHStreams, tvh_stream); -typedef struct tvh_transcoder_t { +struct tvh_transcoder { tvh_st_t input; struct TVHStreams streams; uint32_t id; tvh_st_t *output; TVHCodecProfile *profiles[AVMEDIA_TYPE_NB]; char *src_codecs[AVMEDIA_TYPE_NB]; -} TVHTranscoder; +}; int tvh_transcoder_deliver(TVHTranscoder *self, th_pkt_t *pkt); @@ -93,14 +93,14 @@ tvh_transcoder_destroy(TVHTranscoder *self); /* TVHStream ================================================================ */ -typedef struct tvh_stream_t { +struct tvh_stream { TVHTranscoder *transcoder; int id; int index; tvh_sct_t type; TVHContext *context; - SLIST_ENTRY(tvh_stream_t) link; -} TVHStream; + SLIST_ENTRY(tvh_stream) link; +}; void tvh_stream_stop(TVHStream *self, int flush); @@ -128,7 +128,7 @@ typedef int (*tvh_context_ship_meth)(TVHContext *, AVPacket *); typedef int (*tvh_context_wrap_meth)(TVHContext *, AVPacket *, th_pkt_t *); typedef void (*tvh_context_close_meth)(TVHContext *); -typedef struct tvh_context_type_t { +struct tvh_context_type { enum AVMediaType media_type; tvh_context_open_meth open; tvh_context_decode_meth decode; @@ -136,8 +136,8 @@ typedef struct tvh_context_type_t { tvh_context_ship_meth ship; tvh_context_wrap_meth wrap; tvh_context_close_meth close; - SLIST_ENTRY(tvh_context_type_t) link; -} TVHContextType; + SLIST_ENTRY(tvh_context_type) link; +}; void tvh_context_types_register(void); @@ -148,7 +148,7 @@ tvh_context_types_forget(void); /* TVHContext =============================================================== */ -typedef struct tvh_context_t { +struct tvh_context { TVHStream *stream; TVHCodecProfile *profile; TVHContextType *type; @@ -173,7 +173,7 @@ typedef struct tvh_context_t { AVBufferRef *hw_device_ref; void *hw_accel_ictx; AVBufferRef *hw_device_octx; -} TVHContext; +}; int tvh_context_get_int_opt(AVDictionary **opts, const char *key, int *value); @@ -211,14 +211,14 @@ typedef int (*tvh_context_helper_open_meth)(TVHContext *, AVDictionary **); typedef th_pkt_t *(*tvh_context_helper_pack_meth)(TVHContext *, AVPacket *); typedef int (*tvh_context_helper_meta_meth)(TVHContext *, AVPacket *, th_pkt_t *); -typedef struct tvh_context_helper_t { +struct tvh_context_helper { enum AVMediaType type; enum AVCodecID id; tvh_context_helper_open_meth open; tvh_context_helper_pack_meth pack; tvh_context_helper_meta_meth meta; - SLIST_ENTRY(tvh_context_helper_t) link; -} TVHContextHelper; + SLIST_ENTRY(tvh_context_helper) link; +}; TVHContextHelper * tvh_decoder_helper_find(const AVCodec *avcodec);