mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
Improve WMV3 detection yet further.
This commit is contained in:
parent
64479eb8f2
commit
fa7505c0c5
3 changed files with 25 additions and 7 deletions
|
@ -73,6 +73,7 @@ get_codec_id_from_codec(GstVaapiCodec codec)
|
||||||
case GST_VAAPI_CODEC_MPEG4: return CODEC_ID_MPEG4;
|
case GST_VAAPI_CODEC_MPEG4: return CODEC_ID_MPEG4;
|
||||||
case GST_VAAPI_CODEC_H263: return CODEC_ID_H263;
|
case GST_VAAPI_CODEC_H263: return CODEC_ID_H263;
|
||||||
case GST_VAAPI_CODEC_H264: return CODEC_ID_H264;
|
case GST_VAAPI_CODEC_H264: return CODEC_ID_H264;
|
||||||
|
case GST_VAAPI_CODEC_WMV3: return CODEC_ID_WMV3;
|
||||||
case GST_VAAPI_CODEC_VC1: return CODEC_ID_VC1;
|
case GST_VAAPI_CODEC_VC1: return CODEC_ID_VC1;
|
||||||
}
|
}
|
||||||
return CODEC_ID_NONE;
|
return CODEC_ID_NONE;
|
||||||
|
@ -340,6 +341,10 @@ gst_vaapi_decoder_ffmpeg_open(GstVaapiDecoderFfmpeg *ffdecoder, GstBuffer *buffe
|
||||||
input encoded buffers represent the whole NAL unit */
|
input encoded buffers represent the whole NAL unit */
|
||||||
parser_is_needed = priv->avctx->extradata_size == 0;
|
parser_is_needed = priv->avctx->extradata_size == 0;
|
||||||
break;
|
break;
|
||||||
|
case CODEC_ID_WMV3:
|
||||||
|
/* There is no WMV3 parser in FFmpeg */
|
||||||
|
parser_is_needed = FALSE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
parser_is_needed = TRUE;
|
parser_is_needed = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,9 +30,6 @@
|
||||||
#include "gstvaapicompat.h"
|
#include "gstvaapicompat.h"
|
||||||
#include "gstvaapiprofile.h"
|
#include "gstvaapiprofile.h"
|
||||||
|
|
||||||
#define GST_VAAPI_PROFILE_CODEC(profile) \
|
|
||||||
((GstVaapiCodec)(((guint32)profile) & GST_MAKE_FOURCC(0xff,0xff,0xff,0)))
|
|
||||||
|
|
||||||
typedef struct _GstVaapiProfileMap GstVaapiProfileMap;
|
typedef struct _GstVaapiProfileMap GstVaapiProfileMap;
|
||||||
typedef struct _GstVaapiEntrypointMap GstVaapiEntrypointMap;
|
typedef struct _GstVaapiEntrypointMap GstVaapiEntrypointMap;
|
||||||
|
|
||||||
|
@ -244,7 +241,7 @@ gst_vaapi_profile_from_caps(GstCaps *caps)
|
||||||
}
|
}
|
||||||
if (!profile)
|
if (!profile)
|
||||||
profile = gst_vaapi_profile_from_codec_data(
|
profile = gst_vaapi_profile_from_codec_data(
|
||||||
GST_VAAPI_PROFILE_CODEC(m->profile),
|
gst_vaapi_profile_get_codec(m->profile),
|
||||||
codec_data
|
codec_data
|
||||||
);
|
);
|
||||||
gst_caps_unref(caps_test);
|
gst_caps_unref(caps_test);
|
||||||
|
@ -307,7 +304,21 @@ gst_vaapi_profile_get_caps(GstVaapiProfile profile)
|
||||||
GstVaapiCodec
|
GstVaapiCodec
|
||||||
gst_vaapi_profile_get_codec(GstVaapiProfile profile)
|
gst_vaapi_profile_get_codec(GstVaapiProfile profile)
|
||||||
{
|
{
|
||||||
return GST_VAAPI_PROFILE_CODEC(profile);
|
GstVaapiCodec codec;
|
||||||
|
|
||||||
|
switch (profile) {
|
||||||
|
case GST_VAAPI_PROFILE_VC1_SIMPLE:
|
||||||
|
case GST_VAAPI_PROFILE_VC1_MAIN:
|
||||||
|
codec = GST_VAAPI_CODEC_WMV3;
|
||||||
|
break;
|
||||||
|
case GST_VAAPI_PROFILE_VC1_ADVANCED:
|
||||||
|
codec = GST_VAAPI_CODEC_VC1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
codec = (guint32)profile & GST_MAKE_FOURCC(0xff,0xff,0xff,0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return codec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -37,7 +37,8 @@ typedef enum _GstVaapiEntrypoint GstVaapiEntrypoint;
|
||||||
* @GST_VAAPI_CODEC_MPEG4: MPEG-4 Part 2 (ISO/IEC 14496-2)
|
* @GST_VAAPI_CODEC_MPEG4: MPEG-4 Part 2 (ISO/IEC 14496-2)
|
||||||
* @GST_VAAPI_CODEC_H263: H.263
|
* @GST_VAAPI_CODEC_H263: H.263
|
||||||
* @GST_VAAPI_CODEC_H264: H.264 aka MPEG-4 Part 10 (ISO/IEC 14496-10)
|
* @GST_VAAPI_CODEC_H264: H.264 aka MPEG-4 Part 10 (ISO/IEC 14496-10)
|
||||||
* @GST_VAAPI_CODEC_VC1: VC-1 (SMPTE 421M)
|
* @GST_VAAPI_CODEC_WMV3: Windows Media Video 9. VC-1 Simple or Main profile (SMPTE 421M)
|
||||||
|
* @GST_VAAPI_CODEC_VC1: VC-1 Advanced profile (SMPTE 421M)
|
||||||
*
|
*
|
||||||
* The set of all codecs for #GstVaapiCodec.
|
* The set of all codecs for #GstVaapiCodec.
|
||||||
*/
|
*/
|
||||||
|
@ -47,6 +48,7 @@ enum _GstVaapiCodec {
|
||||||
GST_VAAPI_CODEC_MPEG4 = GST_MAKE_FOURCC('M','P','4',0),
|
GST_VAAPI_CODEC_MPEG4 = GST_MAKE_FOURCC('M','P','4',0),
|
||||||
GST_VAAPI_CODEC_H263 = GST_MAKE_FOURCC('2','6','3',0),
|
GST_VAAPI_CODEC_H263 = GST_MAKE_FOURCC('2','6','3',0),
|
||||||
GST_VAAPI_CODEC_H264 = GST_MAKE_FOURCC('2','6','4',0),
|
GST_VAAPI_CODEC_H264 = GST_MAKE_FOURCC('2','6','4',0),
|
||||||
|
GST_VAAPI_CODEC_WMV3 = GST_MAKE_FOURCC('W','M','V',0),
|
||||||
GST_VAAPI_CODEC_VC1 = GST_MAKE_FOURCC('V','C','1',0),
|
GST_VAAPI_CODEC_VC1 = GST_MAKE_FOURCC('V','C','1',0),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,7 +88,7 @@ enum _GstVaapiCodec {
|
||||||
* @GST_VAAPI_PROFILE_VC1_SIMPLE:
|
* @GST_VAAPI_PROFILE_VC1_SIMPLE:
|
||||||
* VC-1 simple profile
|
* VC-1 simple profile
|
||||||
* @GST_VAAPI_PROFILE_VC1_MAIN:
|
* @GST_VAAPI_PROFILE_VC1_MAIN:
|
||||||
* VC-1 main profile (WMV3)
|
* VC-1 main profile
|
||||||
* @GST_VAAPI_PROFILE_VC1_ADVANCED:
|
* @GST_VAAPI_PROFILE_VC1_ADVANCED:
|
||||||
* VC-1 advanced profile
|
* VC-1 advanced profile
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue