2012-12-11 17:27:34 +00:00
|
|
|
#ifndef MPV_LAVC_H
|
|
|
|
#define MPV_LAVC_H
|
|
|
|
|
2012-12-11 23:43:50 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2012-12-11 17:27:34 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
|
2013-03-09 19:50:06 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2012-12-11 17:27:34 +00:00
|
|
|
#include "demux/stheader.h"
|
|
|
|
#include "video/mp_image.h"
|
|
|
|
|
|
|
|
typedef struct ffmpeg_ctx {
|
|
|
|
AVCodecContext *avctx;
|
|
|
|
AVFrame *pic;
|
|
|
|
struct hwdec *hwdec;
|
|
|
|
enum PixelFormat pix_fmt;
|
2013-03-09 19:50:06 +00:00
|
|
|
int do_hw_dr1;
|
2012-12-11 17:27:34 +00:00
|
|
|
int vo_initialized;
|
|
|
|
int best_csp;
|
2013-06-07 23:35:44 +00:00
|
|
|
struct mp_image_params image_params;
|
2012-12-11 17:27:34 +00:00
|
|
|
AVRational last_sample_aspect_ratio;
|
|
|
|
enum AVDiscard skip_frame;
|
core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)
The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)
demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.
Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.
Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-09 14:15:19 +00:00
|
|
|
const char *software_fallback_decoder;
|
2013-03-09 19:50:06 +00:00
|
|
|
|
|
|
|
bool do_dr1;
|
2012-12-11 17:27:34 +00:00
|
|
|
struct FramePool *dr1_buffer_pool;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
struct mp_image_pool *non_dr1_pool;
|
2012-12-11 17:27:34 +00:00
|
|
|
} vd_ffmpeg_ctx;
|
|
|
|
|
2013-03-09 19:50:06 +00:00
|
|
|
// lavc_dr1.c
|
2012-12-11 17:27:34 +00:00
|
|
|
int mp_codec_get_buffer(AVCodecContext *s, AVFrame *frame);
|
|
|
|
void mp_codec_release_buffer(AVCodecContext *s, AVFrame *frame);
|
|
|
|
struct FrameBuffer;
|
|
|
|
void mp_buffer_ref(struct FrameBuffer *buffer);
|
|
|
|
void mp_buffer_unref(struct FrameBuffer *buffer);
|
2012-12-11 23:43:50 +00:00
|
|
|
bool mp_buffer_is_unique(struct FrameBuffer *buffer);
|
2012-12-11 17:27:34 +00:00
|
|
|
void mp_buffer_pool_free(struct FramePool **pool);
|
|
|
|
|
|
|
|
#endif
|