static void *codec_mutex;
static void *avformat_mutex;
-#if CONFIG_RAISE_MAJOR
-# define LIBNAME "LIBAVCODEC_155"
-#else
-# define LIBNAME "LIBAVCODEC_55"
-#endif
-
-#if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
-FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
-{
- return av_fast_realloc(ptr, size, min_size);
-}
-
-FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
-{
- av_fast_malloc(ptr, size, min_size);
-}
-#endif
-
static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
{
void **p = ptr;
case AV_PIX_FMT_GBRP12BE:
case AV_PIX_FMT_GBRP14LE:
case AV_PIX_FMT_GBRP14BE:
+ case AV_PIX_FMT_GBRP16LE:
+ case AV_PIX_FMT_GBRP16BE:
w_align = 16; //FIXME assume 16 pixel per macroblock
h_align = 16 * 2; // interlaced needs 2 macroblocks height
break;
FramePool *pool = s->internal->pool;
int i;
- if (pic->data[0] != NULL) {
+ if (pic->data[0]) {
av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n");
return -1;
}
memcpy(frame_sd->data, packet_sd, size);
}
+
+ /* copy the stereo3d format to the output frame */
+ packet_sd = av_packet_get_side_data(pkt, AV_PKT_DATA_STEREO3D, &size);
+ if (packet_sd) {
+ frame_sd = av_frame_new_side_data(frame, AV_FRAME_DATA_STEREO3D, size);
+ if (!frame_sd)
+ return AVERROR(ENOMEM);
+
+ memcpy(frame_sd->data, packet_sd, size);
+ }
} else {
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_pkt_pos (frame, -1);
}
frame->reordered_opaque = avctx->reordered_opaque;
-#if FF_API_AVFRAME_COLORSPACE
if (frame->color_primaries == AVCOL_PRI_UNSPECIFIED)
frame->color_primaries = avctx->color_primaries;
if (frame->color_trc == AVCOL_TRC_UNSPECIFIED)
av_frame_set_color_range(frame, avctx->color_range);
if (frame->chroma_location == AVCHROMA_LOC_UNSPECIFIED)
frame->chroma_location = avctx->chroma_sample_location;
-#endif
switch (avctx->codec->type) {
case AVMEDIA_TYPE_VIDEO:
goto free_and_end;
}
+#if FF_API_VISMV
+ if (avctx->debug_mv)
+ av_log(avctx, AV_LOG_WARNING, "The 'vismv' option is deprecated, "
+ "see the codecview filter instead.\n");
+#endif
+
if (av_codec_is_encoder(avctx->codec)) {
int i;
if (avctx->codec->sample_fmts) {
} else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
- if(avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
- avctx->codec_id != AV_CODEC_ID_PNG // For mplayer
- ) {
+ if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if (avctx->width <= 0 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "dimensions not set\n");
ret = AVERROR(EINVAL);
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s", av_get_sample_fmt_name(enc->sample_fmt));
}
+ if ( enc->bits_per_raw_sample > 0
+ && enc->bits_per_raw_sample != av_get_bytes_per_sample(enc->sample_fmt) * 8)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " (%d bit)", enc->bits_per_raw_sample);
break;
case AVMEDIA_TYPE_DATA:
if (av_log_get_level() >= AV_LOG_DEBUG) {
}
}
+ /* Fall back on using frame_size */
+ if (avctx->frame_size > 1 && frame_bytes)
+ return avctx->frame_size;
+
+ //For WMA we currently have no other means to calculate duration thus we
+ //do it here by assuming CBR, which is true for all known cases.
+ if (avctx->bit_rate>0 && frame_bytes>0 && avctx->sample_rate>0 && avctx->block_align>1) {
+ if (avctx->codec_id == AV_CODEC_ID_WMAV1 || avctx->codec_id == AV_CODEC_ID_WMAV2)
+ return (frame_bytes * 8LL * avctx->sample_rate) / avctx->bit_rate;
+ }
+
return 0;
}