Created
June 16, 2018 11:44
-
-
Save SethDusek/2bf4664496a0032e6350142a775a504e 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 <fcntl.h> | |
static int device_open(AVBufferRef *ctx, const char *filename) { | |
return av_hwdevice_ctx_create(&ctx, AV_HWDEVICE_TYPE_DRM, filename, NULL, 0); | |
} | |
int main() { | |
AVBufferRef *hw_context = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_DRM); | |
printf("%d", device_open(hw_context, "/dev/dri/renderD128")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment