Go to the documentation of this file.
56 if (!sw_frame || !hw_frame || !download) {
76 for (
int y = 0; y <
h; y++)
77 for (
int x = 0; x < linesizes[
i]; x++)
79 (uint8_t)(x + y * 3 +
i * 17);
84 if (!hw_frame->hw_frames_ctx) {
97 download->format = fmt;
99 download->height = 64;
116 for (
int y = 0; y <
h; y++) {
118 if (memcmp(sw_frame->
data[
i] + off,
119 download->data[
i] + off,
121 printf(
"fail: %-16s plane %d row %d mismatch\n",
178 printf(
"No CUDA device available, skipping.\n");
192 printf(
"fail: %-16s wrongly accepted\n",
199 printf(
"fail: %-16s %s\n",
212 printf(
"%d tests passed.\n", total);
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
__device__ int printf(const char *,...)
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
#define AV_LOG_QUIET
Print no output.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
uint8_t * data
The data buffer.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
This structure describes decoded (raw) audio or video data.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
int width
The allocated dimensions of the frames in this pool.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
@ AV_PIX_FMT_NB
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define FF_ARRAY_ELEMS(a)
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
#define AV_CEIL_RSHIFT(a, b)
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
static int shift(int a, int b)
#define i(width, name, range_min, range_max)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
#define AV_LOG_INFO
Standard information.
void av_log_set_level(int level)
Set the log level.
This struct describes a set or pool of "hardware" frames (i.e.
int av_hwdevice_ctx_create(AVBufferRef **pdevice_ref, enum AVHWDeviceType type, const char *device, AVDictionary *opts, int flags)
Open a device of the specified type and create an AVHWDeviceContext for it.
int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags)
Copy data to or from a hw surface.
static int test_rejected(AVBufferRef *device_ref, enum AVPixelFormat fmt)
A reference to a data buffer.
static int test_format(AVBufferRef *device_ref, enum AVPixelFormat fmt)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.