Created
June 18, 2018 16:53
-
-
Save SethDusek/123e67b34b94bf0a88508abb07fd91fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <libavutil/pixdesc.h> | |
#include <libavcodec/avcodec.h> | |
#include <libavutil/hwcontext_drm.h> | |
#include <libavutil/hwcontext.h> | |
#include <libavutil/buffer.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
struct primecorder { | |
AVBufferRef *hw_context; | |
}; | |
static int device_open(AVBufferRef **ctx, const char *filename) { | |
return av_hwdevice_ctx_create(ctx, AV_HWDEVICE_TYPE_DRM, filename, NULL, 0); | |
} | |
static off_t sizeof_fd(int fd) { | |
return lseek(fd, 0, SEEK_END); | |
} | |
int main() { | |
AVBufferRef *hw_context = NULL; | |
printf("%d\n", device_open(&hw_context, "/dev/dri/renderD128")); | |
AVHWFramesConstraints *constraints = av_hwdevice_get_hwframe_constraints(hw_context, NULL); | |
if (constraints==NULL){ | |
printf("error getting constraints"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment