v4l2codecs: Unify the src template caps format

Notably NV12_4L4 ended up being applied to only VP9 decoder. This fixes the
situation by using a central define for all static src pad templated formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/965>
This commit is contained in:
Nicolas Dufresne 2020-07-14 11:11:11 -04:00 committed by GStreamer Marge Bot
parent a67e9fb05f
commit 107088a658
5 changed files with 10 additions and 5 deletions

View file

@ -24,6 +24,7 @@
#include "gstv4l2codecallocator.h" #include "gstv4l2codecallocator.h"
#include "gstv4l2codech264dec.h" #include "gstv4l2codech264dec.h"
#include "gstv4l2codecpool.h" #include "gstv4l2codecpool.h"
#include "gstv4l2format.h"
#include "linux/v4l2-controls.h" #include "linux/v4l2-controls.h"
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
@ -52,7 +53,7 @@ GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SINK_NAME,
static GstStaticPadTemplate src_template = static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME, GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME,
GST_PAD_SRC, GST_PAD_ALWAYS, GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ NV12, YUY2, NV12_32L32 }"))); GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_V4L2_DEFAULT_VIDEO_FORMATS)));
struct _GstV4l2CodecH264Dec struct _GstV4l2CodecH264Dec
{ {

View file

@ -25,6 +25,7 @@
#include "gstv4l2codecallocator.h" #include "gstv4l2codecallocator.h"
#include "gstv4l2codecmpeg2dec.h" #include "gstv4l2codecmpeg2dec.h"
#include "gstv4l2codecpool.h" #include "gstv4l2codecpool.h"
#include "gstv4l2format.h"
#include "linux/v4l2-controls.h" #include "linux/v4l2-controls.h"
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
@ -55,7 +56,7 @@ GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SINK_NAME,
static GstStaticPadTemplate src_template = static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME, GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME,
GST_PAD_SRC, GST_PAD_ALWAYS, GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ NV12, YUY2, NV12_32L32 }"))); GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_V4L2_DEFAULT_VIDEO_FORMATS)));
struct _GstV4l2CodecMpeg2Dec struct _GstV4l2CodecMpeg2Dec
{ {

View file

@ -25,6 +25,7 @@
#include "gstv4l2codecalphadecodebin.h" #include "gstv4l2codecalphadecodebin.h"
#include "gstv4l2codecpool.h" #include "gstv4l2codecpool.h"
#include "gstv4l2codecvp8dec.h" #include "gstv4l2codecvp8dec.h"
#include "gstv4l2format.h"
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
@ -56,7 +57,7 @@ GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SINK_NAME,
static GstStaticPadTemplate src_template = static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME, GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME,
GST_PAD_SRC, GST_PAD_ALWAYS, GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ NV12, YUY2, NV12_32L32 }"))); GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_V4L2_DEFAULT_VIDEO_FORMATS)));
struct _GstV4l2CodecVp8Dec struct _GstV4l2CodecVp8Dec
{ {

View file

@ -26,6 +26,7 @@
#include "gstv4l2codecalphadecodebin.h" #include "gstv4l2codecalphadecodebin.h"
#include "gstv4l2codecpool.h" #include "gstv4l2codecpool.h"
#include "gstv4l2codecvp9dec.h" #include "gstv4l2codecvp9dec.h"
#include "gstv4l2format.h"
#include "linux/v4l2-controls.h" #include "linux/v4l2-controls.h"
#include "linux/videodev2.h" #include "linux/videodev2.h"
@ -57,8 +58,7 @@ GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SINK_NAME,
static GstStaticPadTemplate src_template = static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME, GST_STATIC_PAD_TEMPLATE (GST_VIDEO_DECODER_SRC_NAME,
GST_PAD_SRC, GST_PAD_ALWAYS, GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_V4L2_DEFAULT_VIDEO_FORMATS)));
("{ NV12, YUY2, NV12_32L32, NV12_4L4 }")));
struct _GstV4l2CodecVp9Dec struct _GstV4l2CodecVp9Dec
{ {

View file

@ -24,6 +24,8 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include "linux/videodev2.h" #include "linux/videodev2.h"
#define GST_V4L2_DEFAULT_VIDEO_FORMATS "{ NV12, YUY2, NV12_4L4, NV12_32L32 }"
gboolean gst_v4l2_format_to_video_info (struct v4l2_format * fmt, gboolean gst_v4l2_format_to_video_info (struct v4l2_format * fmt,
GstVideoInfo * out_info); GstVideoInfo * out_info);