Skip to content

Instantly share code, notes, and snippets.

@Neko3000
Created August 15, 2020 09:40
Show Gist options
  • Save Neko3000/83354f8dde60a5430ae12a9983cd6e48 to your computer and use it in GitHub Desktop.
Save Neko3000/83354f8dde60a5430ae12a9983cd6e48 to your computer and use it in GitHub Desktop.
AVDev Chapter1
typedef struct AVFrame {
#define AV_NUM_DATA_POINTERS 8
/**
* pointer to the picture/channel planes.
* This might be different from the first allocated byte
*
* Some decoders access areas outside 0,0 - width,height, please
* see avcodec_align_dimensions2(). Some filters and swscale can read
* up to 16 bytes beyond the planes, if these filters are to be used,
* then 16 extra bytes must be allocated.
*/
uint8_t *data[AV_NUM_DATA_POINTERS];
...
/**
* AVBuffer references backing the data for this frame. If all elements of
* this array are NULL, then this frame is not reference counted. This array
* must be filled contiguously -- if buf[i] is non-NULL then buf[j] must
* also be non-NULL for all j < i.
*
* There may be at most one AVBuffer per data plane, so for video this array
* always contains all the references. For planar audio with more than
* AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
* this array. Then the extra AVBufferRef pointers are stored in the
* extended_buf array.
*/
AVBufferRef *buf[AV_NUM_DATA_POINTERS];
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment