oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
+ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
gint have_data, len;
GST_LOG_OBJECT (ffmpegdec,
oclass->in_plugin) < 0)
GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
- if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
+ if ((oclass->in_plugin->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
ffmpegaudenc->compliance != GST_FFMPEG_EXPERIMENTAL) {
GST_ELEMENT_ERROR (ffmpegaudenc, LIBRARY, SETTINGS,
("Codec is experimental, but settings don't allow encoders to "
pkt->size, 0, pkt->size, pkt, gst_ffmpegaudenc_free_avpacket);
codec = ffmpegaudenc->context->codec;
- if ((codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
+ if ((codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
/* FIXME: Not really correct, as -1 means "all the samples we got
given so far", which may not be true depending on the codec,
but we have no way to know AFAICT */
oclass = (GstFFMpegAudEncClass *) (G_OBJECT_GET_CLASS (ffmpegaudenc));
- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
+ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
gint have_data, try = 0;
GST_LOG_OBJECT (ffmpegaudenc,
if (!ffmpeg_pass_type) {
static const GEnumValue ffmpeg_passes[] = {
{0, "Constant Bitrate Encoding", "cbr"},
- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
- {CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
- {CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
+ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
+ {AV_CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
+ {AV_CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
{0, NULL, NULL},
};
if (!ffmpeg_lim_pass_type) {
static const GEnumValue ffmpeg_lim_passes[] = {
{0, "Constant Bitrate Encoding", "cbr"},
- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
+ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
{0, NULL, NULL},
};
/* FIXME: This needs some serious resyncing with avcodec.h */
if (!ffmpeg_flags_type) {
static const GFlagsValue ffmpeg_flags[] = {
- {CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
- {CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
- {CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
+ {AV_CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
+ {AV_CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
+ {AV_CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
{CODEC_FLAG_GMC, "GMC", "gmc"},
{CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
- {CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
- {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
+ {AV_CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
+ {AV_CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
{CODEC_FLAG_NORMALIZE_AQP,
"Normalize Adaptive Quantization (masking, etc)", "aqp"},
- {CODEC_FLAG_GLOBAL_HEADER,
+ {AV_CODEC_FLAG_GLOBAL_HEADER,
"Global headers in extradata instead of every keyframe",
"global-headers"},
- {CODEC_FLAG_AC_PRED, "H263 Advanced Intra Coding / MPEG4 AC prediction",
+ {AV_CODEC_FLAG_AC_PRED,
+ "H263 Advanced Intra Coding / MPEG4 AC prediction",
"aic"},
- {CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
+ {AV_CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
{0, NULL, NULL},
};
if (encode && context) {
gst_caps_set_simple (caps,
- "annex-f", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_4MV,
- "annex-j", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_LOOP_FILTER,
- "annex-i", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
- "annex-t", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
+ "annex-f", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_4MV,
+ "annex-j", G_TYPE_BOOLEAN,
+ context->flags & AV_CODEC_FLAG_LOOP_FILTER,
+ "annex-i", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
+ "annex-t", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
NULL);
}
break;
{
const gchar *mime = gst_structure_get_name (str);
- context->flags |= CODEC_FLAG_4MV;
+ context->flags |= AV_CODEC_FLAG_4MV;
if (!strcmp (mime, "video/x-divx"))
context->codec_tag = GST_MAKE_FOURCC ('D', 'I', 'V', 'X');
profile = gst_structure_get_string (str, "profile");
if (profile) {
if (g_strcmp0 (profile, "advanced-simple") == 0)
- context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
+ context->flags |= CODEC_FLAG_GMC | AV_CODEC_FLAG_QPEL;
}
}
break;
gboolean val;
if (!gst_structure_get_boolean (str, "annex-f", &val) || val)
- context->flags |= CODEC_FLAG_4MV;
+ context->flags |= AV_CODEC_FLAG_4MV;
else
- context->flags &= ~CODEC_FLAG_4MV;
+ context->flags &= ~AV_CODEC_FLAG_4MV;
if ((!gst_structure_get_boolean (str, "annex-i", &val) || val) &&
(!gst_structure_get_boolean (str, "annex-t", &val) || val))
- context->flags |= CODEC_FLAG_AC_PRED;
+ context->flags |= AV_CODEC_FLAG_AC_PRED;
else
- context->flags &= ~CODEC_FLAG_AC_PRED;
+ context->flags &= ~AV_CODEC_FLAG_AC_PRED;
if (!gst_structure_get_boolean (str, "annex-j", &val) || val)
- context->flags |= CODEC_FLAG_LOOP_FILTER;
+ context->flags |= AV_CODEC_FLAG_LOOP_FILTER;
else
- context->flags &= ~CODEC_FLAG_LOOP_FILTER;
+ context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER;
break;
}
case AV_CODEC_ID_ADPCM_G726:
/*
* _formatid_get_codecids () can be used to get the codecIDs
- * (CODEC_ID_NONE-terminated list) that fit that specific
+ * (AV_CODEC_ID_NONE-terminated list) that fit that specific
* output format.
*/
ctx->width = width;
ctx->height = height;
ctx->pix_fmt = AV_PIX_FMT_NB;
- gst_ffmpeg_caps_with_codectype (CODEC_TYPE_VIDEO, caps, ctx);
+ gst_ffmpeg_caps_with_codectype (AV_CODEC_TYPE_VIDEO, caps, ctx);
if (ctx->pix_fmt == AV_PIX_FMT_NB) {
av_free (ctx);
return FALSE;
ctx->width = scale->in_width;
ctx->height = scale->in_height;
ctx->pix_fmt = AV_PIX_FMT_NB;
- gst_ffmpeg_caps_with_codectype (CODEC_TYPE_VIDEO, incaps, ctx);
+ gst_ffmpeg_caps_with_codectype (AV_CODEC_TYPE_VIDEO, incaps, ctx);
if (ctx->pix_fmt == AV_PIX_FMT_NB) {
av_free (ctx);
return FALSE;
DEFAULT_OUTPUT_CORRUPT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
caps = klass->in_plugin->capabilities;
- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
+ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
g_param_spec_int ("max-threads", "Maximum decode threads",
"Maximum number of worker threads to spawn. (0 = auto)",
oclass->in_plugin->name, oclass->in_plugin->id);
gst_ffmpegviddec_context_set_flags (ffmpegdec->context,
- CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
+ AV_CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
return TRUE;
gboolean is_live;
if (ffmpegdec->max_threads == 0) {
- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
+ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
else
ffmpegdec->context->thread_count = 0;
return FALSE;
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
- return ((oclass->in_plugin->capabilities & CODEC_CAP_DR1) == CODEC_CAP_DR1);
+ return ((oclass->in_plugin->capabilities & AV_CODEC_CAP_DR1) ==
+ AV_CODEC_CAP_DR1);
}
/* called when ffmpeg wants us to allocate a buffer to write the decoded frame
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
+ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
gint have_data, len;
GstFlowReturn ret;
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
caps = klass->in_plugin->capabilities;
- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
+ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
g_param_spec_int ("max-threads", "Maximum encode threads",
"Maximum number of worker threads to spawn. (0 = auto)",
ffmpegenc->bitrate, ffmpegenc->gop_size);
if (ffmpegenc->max_threads == 0) {
- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
+ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
ffmpegenc->context->thread_count = gst_ffmpeg_auto_max_threads ();
else
ffmpegenc->context->thread_count = 0;
if (ffmpegenc->interlaced) {
ffmpegenc->context->flags |=
- CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME;
+ AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME;
}
/* some other defaults */
ffmpegenc->context->flags |= ffmpegenc->pass;
switch (ffmpegenc->pass) {
/* some additional action depends on type of pass */
- case CODEC_FLAG_QSCALE:
+ case AV_CODEC_FLAG_QSCALE:
ffmpegenc->context->global_quality
= ffmpegenc->picture->quality = FF_QP2LAMBDA * ffmpegenc->quantizer;
break;
- case CODEC_FLAG_PASS1: /* need to prepare a stats file */
+ case AV_CODEC_FLAG_PASS1: /* need to prepare a stats file */
/* we don't close when changing caps, fingers crossed */
if (!ffmpegenc->file)
ffmpegenc->file = g_fopen (ffmpegenc->filename, "w");
if (!ffmpegenc->file)
goto open_file_err;
break;
- case CODEC_FLAG_PASS2:
+ case AV_CODEC_FLAG_PASS2:
{ /* need to read the whole stats file ! */
gsize size;