diff options
author | wm4 <wm4@nowhere> | 2012-12-12 00:43:50 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 17:39:32 +0100 |
commit | 881f82dd33fe8d13e731bfe04077d3abcd149fa3 (patch) | |
tree | 8d252a933f51523a73cc93a06af40b515e671bbb /video/decode/lavc.h | |
parent | 65a0b5fdc609dac739f6ad1681f845b78589777b (diff) | |
download | mpv-881f82dd33fe8d13e731bfe04077d3abcd149fa3.tar.bz2 mpv-881f82dd33fe8d13e731bfe04077d3abcd149fa3.tar.xz |
vd_lavc: use refcounting
Note that if the codec doesn't support DR1, the image has to be copied.
There is no other way to guarantee that the image will be valid after
decoding the next image.
The only important codec that doesn't support DR1 yet is rawvideo. It's
likely that ffmpeg/Libav will fix this at some time. For now, this
decoder uses an evil hack and puts pointers to the packet data into the
returned frame. This means the image will actually get invalid as soon
as the corresponding video packet is free'd, so copying the image is the
only reasonable thing anyway.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r-- | video/decode/lavc.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index bf8a3fc12c..c4d24aad94 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -1,6 +1,8 @@ #ifndef MPV_LAVC_H #define MPV_LAVC_H +#include <stdbool.h> + #include <libavcodec/avcodec.h> #include "demux/stheader.h" @@ -11,11 +13,11 @@ typedef struct ffmpeg_ctx { AVCodecContext *avctx; AVFrame *pic; - struct mp_image export_mpi; + struct mp_image *last_mpi; struct mp_image hwdec_mpi[MAX_NUM_MPI]; struct hwdec *hwdec; enum PixelFormat pix_fmt; - int do_dr1; + int do_hw_dr1, do_dr1; int vo_initialized; int best_csp; int qp_stat[32]; @@ -35,6 +37,7 @@ struct FrameBuffer; void mp_buffer_ref(struct FrameBuffer *buffer); void mp_buffer_unref(struct FrameBuffer *buffer); +bool mp_buffer_is_unique(struct FrameBuffer *buffer); void mp_buffer_pool_free(struct FramePool **pool); |