const char *name;
size_t size;
const codec_profile_class_t *idclass;
- AVCodec *codec;
+ const AVCodec *codec;
const AVProfile *profiles;
int (*profile_init)(TVHCodecProfile *, htsmsg_t *conf);
void (*profile_destroy)(TVHCodecProfile *);
const char *
tvh_codec_profile_get_title(TVHCodecProfile *self);
-AVCodec *
+const AVCodec *
tvh_codec_profile_get_avcodec(TVHCodecProfile *self);
/* AVCodec ================================================================== */
static enum AVMediaType
-codec_get_type(AVCodec *self)
+codec_get_type(const AVCodec *self)
{
return self->type;
}
static const char *
-codec_get_type_string(AVCodec *self)
+codec_get_type_string(const AVCodec *self)
{
return av_get_media_type_string(self->type);
}
const char *
-codec_get_title(AVCodec *self)
+codec_get_title(const AVCodec *self)
{
static __thread char codec_title[TVH_TITLE_LEN];
/* TVHCodec ================================================================= */
static void
-tvh_codec_video_init(TVHVideoCodec *self, AVCodec *codec)
+tvh_codec_video_init(TVHVideoCodec *self, const AVCodec *codec)
{
if (!self->pix_fmts) {
self->pix_fmts = codec->pix_fmts;
}
static void
-tvh_codec_audio_init(TVHAudioCodec *self, AVCodec *codec)
+tvh_codec_audio_init(TVHAudioCodec *self, const AVCodec *codec)
{
static int default_sample_rates[] = {
44100, 48000, 96000, 192000, 0
static void
-tvh_codec_init(TVHCodec *self, AVCodec *codec)
+tvh_codec_init(TVHCodec *self, const AVCodec *codec)
{
if (!self->profiles) {
self->profiles = codec->profiles;
tvh_codec_register(TVHCodec *self)
{
static const size_t min_size = sizeof(TVHCodecProfile);
- AVCodec *codec = NULL;
+ const AVCodec *codec = NULL;
if (tvh_str_default(self->name, NULL) == NULL ||
self->size < min_size || !self->idclass) {
}
-AVCodec *
+const AVCodec *
tvh_codec_get_codec(TVHCodec *self)
{
return self->codec;
/* AVCodec ================================================================== */
const char *
-codec_get_title(AVCodec *self);
+codec_get_title(const AVCodec *self);
/* TVHCodec ================================================================= */
const char *
tvh_codec_get_type_string(TVHCodec *self);
-AVCodec *
+const AVCodec *
tvh_codec_get_codec(TVHCodec *self);
int
}
-AVCodec *
+const AVCodec *
tvh_codec_profile_get_avcodec(TVHCodecProfile *self)
{
TVHCodec *codec = tvh_codec_profile_get_codec(self);
{
const idclass_t *idclass = NULL;
const codec_profile_class_t *codec_profile_class = NULL;
- AVCodec *avcodec = NULL;
+ const AVCodec *avcodec = NULL;
tvh_sct_t out_type = SCT_UNKNOWN;
codec_profile_video_class_deinterlace_set(void *obj, const void *val)
{
TVHVideoCodecProfile *self = (TVHVideoCodecProfile *)obj;
- AVCodec *avcodec = NULL;
+ const AVCodec *avcodec = NULL;
if (self &&
(avcodec = tvh_codec_profile_get_avcodec((TVHCodecProfile *)self))) {
// creation
static AVCodecContext *
-tvh_context_alloc_avctx(TVHContext *context, AVCodec *avcodec)
+tvh_context_alloc_avctx(TVHContext *context, const AVCodec *avcodec)
{
AVCodecContext *avctx = NULL;
if ((avctx = avcodec_alloc_context3(avcodec))) {
avctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
- avctx->refcounted_frames = 1;
avctx->opaque = context;
}
return avctx;
static int
-tvh_context_setup(TVHContext *self, AVCodec *iavcodec, AVCodec *oavcodec)
+tvh_context_setup(TVHContext *self, const AVCodec *iavcodec, const AVCodec *oavcodec)
{
enum AVMediaType media_type = iavcodec->type;
const char *media_type_name = av_get_media_type_string(media_type);
TVHContext *
tvh_context_create(TVHStream *stream, TVHCodecProfile *profile,
- AVCodec *iavcodec, AVCodec *oavcodec, pktbuf_t *input_gh)
+ const AVCodec *iavcodec, const AVCodec *oavcodec, pktbuf_t *input_gh)
{
TVHContext *self = NULL;
TVHContext *
tvh_context_create(TVHStream *stream, TVHCodecProfile *profile,
- AVCodec *iavcodec, AVCodec *oavcodec, pktbuf_t *input_gh);
+ const AVCodec *iavcodec, const AVCodec *oavcodec, pktbuf_t *input_gh);
void
tvh_context_destroy(TVHContext *self);
tvh_stream_setup(TVHStream *self, TVHCodecProfile *profile, tvh_ssc_t *ssc)
{
enum AVCodecID icodec_id = streaming_component_type2codec_id(ssc->es_type);
- AVCodec *icodec = NULL, *ocodec = NULL;
+ const AVCodec *icodec = NULL, *ocodec = NULL;
if (icodec_id == AV_CODEC_ID_NONE) {
tvh_stream_log(self, LOG_ERR, "unknown decoder id for '%s'",