mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
d3d11: Add support for MPEG-2 video decoding
Add DXVA/Direct3D11 API based MPEG-2 decoder element Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1969>
This commit is contained in:
parent
3ed0ee95f2
commit
6f6a82d0f5
6 changed files with 1075 additions and 0 deletions
|
@ -627,6 +627,10 @@ gst_d3d11_decoder_open (GstD3D11Decoder * decoder, GstD3D11Codec codec,
|
||||||
else
|
else
|
||||||
alignment = 16;
|
alignment = 16;
|
||||||
break;
|
break;
|
||||||
|
case GST_D3D11_CODEC_MPEG2:
|
||||||
|
/* XXX: ffmpeg does this */
|
||||||
|
alignment = 32;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
alignment = 16;
|
alignment = 16;
|
||||||
break;
|
break;
|
||||||
|
@ -676,6 +680,7 @@ gst_d3d11_decoder_open (GstD3D11Decoder * decoder, GstD3D11Codec codec,
|
||||||
case GST_D3D11_CODEC_H265:
|
case GST_D3D11_CODEC_H265:
|
||||||
case GST_D3D11_CODEC_VP9:
|
case GST_D3D11_CODEC_VP9:
|
||||||
case GST_D3D11_CODEC_VP8:
|
case GST_D3D11_CODEC_VP8:
|
||||||
|
case GST_D3D11_CODEC_MPEG2:
|
||||||
if (config_list[i].ConfigBitstreamRaw == 1)
|
if (config_list[i].ConfigBitstreamRaw == 1)
|
||||||
best_config = &config_list[i];
|
best_config = &config_list[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,6 +39,7 @@ typedef enum
|
||||||
GST_D3D11_CODEC_VP9,
|
GST_D3D11_CODEC_VP9,
|
||||||
GST_D3D11_CODEC_H265,
|
GST_D3D11_CODEC_H265,
|
||||||
GST_D3D11_CODEC_VP8,
|
GST_D3D11_CODEC_VP8,
|
||||||
|
GST_D3D11_CODEC_MPEG2,
|
||||||
|
|
||||||
/* the last of supported codec */
|
/* the last of supported codec */
|
||||||
GST_D3D11_CODEC_LAST
|
GST_D3D11_CODEC_LAST
|
||||||
|
|
1028
sys/d3d11/gstd3d11mpeg2dec.c
Normal file
1028
sys/d3d11/gstd3d11mpeg2dec.c
Normal file
File diff suppressed because it is too large
Load diff
34
sys/d3d11/gstd3d11mpeg2dec.h
Normal file
34
sys/d3d11/gstd3d11mpeg2dec.h
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) 2021 Seungha Yang <seungha@centricular.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GST_D3D11_MPEG2_DEC_H__
|
||||||
|
#define __GST_D3D11_MPEG2_DEC_H__
|
||||||
|
|
||||||
|
#include "gstd3d11decoder.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
void gst_d3d11_mpeg2_dec_register (GstPlugin * plugin,
|
||||||
|
GstD3D11Device * device,
|
||||||
|
GstD3D11Decoder * decoder,
|
||||||
|
guint rank);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GST_D3D11_MPEG2_DEC_H__ */
|
|
@ -21,6 +21,7 @@ d3d11_dec_sources = [
|
||||||
'gstd3d11h264dec.c',
|
'gstd3d11h264dec.c',
|
||||||
'gstd3d11vp9dec.c',
|
'gstd3d11vp9dec.c',
|
||||||
'gstd3d11h265dec.c',
|
'gstd3d11h265dec.c',
|
||||||
|
'gstd3d11mpeg2dec.c',
|
||||||
'gstd3d11vp8dec.c',
|
'gstd3d11vp8dec.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "gstd3d11h265dec.h"
|
#include "gstd3d11h265dec.h"
|
||||||
#include "gstd3d11vp9dec.h"
|
#include "gstd3d11vp9dec.h"
|
||||||
#include "gstd3d11vp8dec.h"
|
#include "gstd3d11vp8dec.h"
|
||||||
|
#include "gstd3d11mpeg2dec.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DXGI_DESKTOP_DUP
|
#ifdef HAVE_DXGI_DESKTOP_DUP
|
||||||
#include "gstd3d11desktopdupsrc.h"
|
#include "gstd3d11desktopdupsrc.h"
|
||||||
|
@ -57,6 +58,7 @@ GST_DEBUG_CATEGORY (gst_d3d11_h264_dec_debug);
|
||||||
GST_DEBUG_CATEGORY (gst_d3d11_h265_dec_debug);
|
GST_DEBUG_CATEGORY (gst_d3d11_h265_dec_debug);
|
||||||
GST_DEBUG_CATEGORY (gst_d3d11_vp9_dec_debug);
|
GST_DEBUG_CATEGORY (gst_d3d11_vp9_dec_debug);
|
||||||
GST_DEBUG_CATEGORY (gst_d3d11_vp8_dec_debug);
|
GST_DEBUG_CATEGORY (gst_d3d11_vp8_dec_debug);
|
||||||
|
GST_DEBUG_CATEGORY (gst_d3d11_mpeg2_dec_debug);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DXGI_DESKTOP_DUP
|
#ifdef HAVE_DXGI_DESKTOP_DUP
|
||||||
|
@ -109,6 +111,8 @@ plugin_init (GstPlugin * plugin)
|
||||||
"d3d11h265dec", 0, "Direct3D11 H.265 Video Decoder");
|
"d3d11h265dec", 0, "Direct3D11 H.265 Video Decoder");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_vp8_dec_debug,
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_vp8_dec_debug,
|
||||||
"d3d11vp8dec", 0, "Direct3D11 VP8 Decoder");
|
"d3d11vp8dec", 0, "Direct3D11 VP8 Decoder");
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_mpeg2_dec_debug,
|
||||||
|
"d3d11mpeg2dec", 0, "Direct3D11 MPEG2 Decoder");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -156,6 +160,8 @@ plugin_init (GstPlugin * plugin)
|
||||||
GST_RANK_SECONDARY);
|
GST_RANK_SECONDARY);
|
||||||
gst_d3d11_vp8_dec_register (plugin, device, decoder,
|
gst_d3d11_vp8_dec_register (plugin, device, decoder,
|
||||||
GST_RANK_SECONDARY);
|
GST_RANK_SECONDARY);
|
||||||
|
gst_d3d11_mpeg2_dec_register (plugin, device, decoder,
|
||||||
|
GST_RANK_SECONDARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue