Skip to content

Commit

Permalink
mfxh264enc: disable multiframe encode option when building on Windows
Browse files Browse the repository at this point in the history
Fixes intel#169
  • Loading branch information
ishmael1985 committed Jul 30, 2019
1 parent d5fbd1f commit caef21d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
8 changes: 6 additions & 2 deletions gst-libs/mfx/gstmfxencoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,17 +562,19 @@ gst_mfx_encoder_finalize_params (GstMfxEncoder * encoder)
/* Encoder expects progressive frames as input */
priv->params.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;

if (MFX_CODEC_AVC == priv->profile.codec) {
#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
if (MFX_CODEC_AVC == priv->profile.codec) {
if (GST_MFX_CHECK_RUNTIME_VERSION (priv->aggregator, 1, 25)) {
priv->extmfp.Header.BufferId = MFX_EXTBUFF_MULTI_FRAME_PARAM;
priv->extmfp.Header.BufferSz = sizeof (priv->extmfp);
priv->extmfp.MFMode = priv->multiframe_mode;
priv->extparam_internal[priv->params.NumExtParam++] =
(mfxExtBuffer *) & priv->extmfp;
}
#endif
}
#endif
#endif

/* Write colorimetry information to bitstream */
gst_mfx_encoder_extsig_from_colorimetry (encoder,
Expand Down Expand Up @@ -1727,6 +1729,7 @@ gst_mfx_encoder_preset_get_type (void)
return g_type;
}

#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
GType
gst_mfx_encoder_multiframe_get_type (void)
Expand All @@ -1751,6 +1754,7 @@ gst_mfx_encoder_multiframe_get_type (void)
return g_type;
}
#endif
#endif

GType
gst_mfx_encoder_trellis_get_type (void)
Expand Down
5 changes: 4 additions & 1 deletion gst-libs/mfx/gstmfxencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ typedef enum
GST_MFX_ENCODER_TRELLIS_IPB = MFX_TRELLIS_I | MFX_TRELLIS_P | MFX_TRELLIS_B,
} GstMfxEncoderTrellis;

#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
typedef enum
{
Expand All @@ -72,7 +73,7 @@ typedef enum
GST_MFX_ENCODER_MULTIFRAME_AUTO = MFX_MF_AUTO,
} GstMfxEncoderMultiFrame;
#endif

#endif
typedef enum
{
GST_MFX_ENCODER_PRESET_VERY_SLOW = MFX_TARGETUSAGE_BEST_QUALITY,
Expand Down Expand Up @@ -127,8 +128,10 @@ typedef struct
GType
gst_mfx_encoder_preset_get_type (void);

#ifdef WITH_LIBVA_BACKEND
GType
gst_mfx_encoder_multiframe_get_type (void);
#endif

GType
gst_mfx_encoder_trellis_get_type (void);
Expand Down
4 changes: 4 additions & 0 deletions gst-libs/mfx/gstmfxencoder_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,12 @@ gst_mfx_encoder_h264_set_property (GstMfxEncoder * base_encoder,
case GST_MFX_ENCODER_H264_PROP_TRELLIS:
priv->trellis = g_value_get_enum (value);
break;
#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
case GST_MFX_ENCODER_H264_PROP_MULTIFRAME:
priv->multiframe_mode = g_value_get_enum (value);
break;
#endif
#endif
case GST_MFX_ENCODER_H264_PROP_LOOKAHEAD_DS:
priv->look_ahead_downsampling = g_value_get_enum (value);
Expand Down Expand Up @@ -381,6 +383,7 @@ gst_mfx_encoder_h264_get_default_properties (void)
GST_MFX_ENCODER_LOOKAHEAD_DS_AUTO,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
/**
* GstMfxEncoderH264:multiframe
Expand All @@ -395,6 +398,7 @@ gst_mfx_encoder_h264_get_default_properties (void)
gst_mfx_encoder_multiframe_get_type (),
GST_MFX_ENCODER_MULTIFRAME_DISABLED,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
#endif
return props;
}
Expand Down
4 changes: 4 additions & 0 deletions gst-libs/mfx/gstmfxencoder_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ struct _GstMfxEncoderPrivate

/* Encoder params */
GstMfxEncoderPreset preset;
#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
GstMfxEncoderMultiFrame multiframe_mode;
#endif
#endif
GstMfxRateControl rc_method;
guint global_quality;
Expand All @@ -194,8 +196,10 @@ struct _GstMfxEncoderPrivate
mfxExtCodingOption3 extco3;
mfxExtHEVCParam exthevc;
mfxExtVideoSignalInfo extsig;
#ifdef WITH_LIBVA_BACKEND
#if MSDK_CHECK_VERSION(1,25)
mfxExtMultiFrameParam extmfp;
#endif
#endif
mfxExtBuffer *extparam_internal[6];

Expand Down

0 comments on commit caef21d

Please sign in to comment.