lavc: Add codec metadata to indicate hardware support

This commit is contained in:
Mark Thompson
2017-10-26 00:18:39 +01:00
parent 2779d33ed9
commit 24cc0a53e9
5 changed files with 109 additions and 2 deletions

View File

@@ -45,6 +45,7 @@
#include "libavutil/thread.h"
#include "avcodec.h"
#include "decode.h"
#include "hwaccel.h"
#include "libavutil/opt.h"
#include "me_cmp.h"
#include "mpegvideo.h"
@@ -1886,6 +1887,17 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
return i;
}
const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index)
{
int i;
if (!codec->hw_configs || index < 0)
return NULL;
for (i = 0; i <= index; i++)
if (!codec->hw_configs[i])
return NULL;
return &codec->hw_configs[index]->public;
}
static AVHWAccel *first_hwaccel = NULL;
static AVHWAccel **last_hwaccel = &first_hwaccel;