summaryrefslogtreecommitdiffstats
path: root/video/decode/lavc_dr1.c
Commit message (Collapse)AuthorAgeFilesLines
* vd_lavc: make non-reference frames writeablewm42013-01-131-1/+18
| | | | | | | | | | | | | This allows avoiding a copy. The logic about using the AVFrame.reference field if buffer hints are not available is similar to mplayer-svn's direct rendering code. This is needed because h264 decoding doesn't set buffer hints. <wm4> michaelni: couldn't it set buffer hints from AVFrame.reference then? <michaelni> i see no reason ATM why that wouldnt be possible OK...
* vd_lavc: use refcountingwm42013-01-131-0/+5
| | | | | | | | | | | | | 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.
* vd_lavc: add DR1 supportwm42013-01-131-0/+227
Replace libavcodec's native buffer allocation with code taken from ffplay/ffmpeg's libavfilter support. The code in lavc_dr1.c is directly copied from cmdutils.c. Note that this is quite arcane code, which contains some workarounds for decoder bugs and the like. This is not really a maintainance burden, since fixes from ffmpeg can be directly applied to the code in lavc_dr1.c. It's unknown why libavcodec doesn't provide such a function directly. avcodec_default_get_buffer() can't be reused for various reasons. There's some hope that the work known as The Evil Plan [1] will make custom get_buffer implementations unneeded. The DR1 support as of this commit does nothing. A future commit will use it to implement ref-counting for mp_image (similar to how AVFrame will be ref-counted with The Evil Plan.) [1] http://lists.libav.org/pipermail/libav-devel/2012-December/039781.html