y4m: move y4mdec to good to have a single y4m plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8719>
This commit is contained in:
Víctor Manuel Jáquez Leal 2025-03-27 16:48:36 +01:00 committed by GStreamer Marge Bot
parent b9a5efbe07
commit 16d34468fb
11 changed files with 101 additions and 117 deletions

View File

@ -257669,44 +257669,6 @@
"tracers": {},
"url": "Unknown package origin"
},
"y4mdec": {
"description": "Demuxes/decodes YUV4MPEG streams",
"elements": {
"y4mdec": {
"author": "David Schleef <ds@schleef.org>",
"description": "Demuxes/decodes YUV4MPEG streams",
"hierarchy": [
"GstY4mDec",
"GstElement",
"GstObject",
"GInitiallyUnowned",
"GObject"
],
"klass": "Codec/Demuxer",
"long-name": "YUV4MPEG demuxer/decoder",
"pad-templates": {
"sink": {
"caps": "application/x-yuv4mpeg:\n y4mversion: 2\n",
"direction": "sink",
"presence": "always"
},
"src": {
"caps": "video/x-raw:\n format: { I420, Y41B, Y42B, Y444, I420_10LE, I422_10LE, Y444_10LE, I420_12LE, I422_12LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
"direction": "src",
"presence": "always"
}
},
"rank": "secondary"
}
},
"filename": "gsty4mdec",
"license": "LGPL",
"other-types": {},
"package": "GStreamer Bad Plug-ins",
"source": "gst-plugins-bad",
"tracers": {},
"url": "Unknown package origin"
},
"zbar": {
"description": "zbar barcode scanner",
"elements": {

View File

@ -13,6 +13,6 @@ foreach plugin : ['accurip', 'adpcmdec', 'adpcmenc', 'aiff', 'asfmux',
'segmentclip', 'siren', 'smooth', 'speed', 'subenc', 'switchbin',
'tensordecoders', 'timecode', 'transcode', 'unixfd', 'videofilters',
'videoframe_audiolevel', 'videoparsers', 'videosignal',
'vmnc', 'y4m']
'vmnc']
subdir(plugin)
endforeach

View File

@ -1,30 +0,0 @@
y4_sources = [
'gsty4mdec.c'
]
y4_headers = [
'gsty4mdec.h',
]
doc_sources = []
foreach s: y4_sources + y4_headers
doc_sources += meson.current_source_dir() / s
endforeach
plugin_sources += {
'y4mdec': pathsep.join(doc_sources)
}
if get_option('y4m').disabled()
subdir_done()
endif
gsty4mdec = library('gsty4mdec',
y4_sources,
c_args : gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep],
install : true,
install_dir : plugins_install_dir,
)
plugins += [gsty4mdec]

View File

@ -73,7 +73,6 @@ option('videoframe_audiolevel', type : 'feature', value : 'auto')
option('videoparsers', type : 'feature', value : 'auto')
option('videosignal', type : 'feature', value : 'auto')
option('vmnc', type : 'feature', value : 'auto')
option('y4m', type : 'feature', value : 'auto')
# Feature options for libraries that need external deps
option('opencv', type : 'feature', value : 'auto', description : 'OpenCV computer vision library support')

View File

@ -29611,9 +29611,34 @@
"tracers": {},
"url": "Unknown package origin"
},
"y4menc": {
"description": "Encodes a YUV frame into the yuv4mpeg format (mjpegtools)",
"y4m": {
"description": "Encodes and demuxes/decodes YUV4MPEG streams (mjpegtools)",
"elements": {
"y4mdec": {
"author": "David Schleef <ds@schleef.org>",
"description": "Demuxes/decodes YUV4MPEG streams",
"hierarchy": [
"GstY4mDec",
"GstElement",
"GstObject",
"GInitiallyUnowned",
"GObject"
],
"klass": "Codec/Demuxer",
"pad-templates": {
"sink": {
"caps": "application/x-yuv4mpeg:\n y4mversion: 2\n",
"direction": "sink",
"presence": "always"
},
"src": {
"caps": "video/x-raw:\n format: { I420, Y41B, Y42B, Y444, I420_10LE, I422_10LE, Y444_10LE, I420_12LE, I422_12LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
"direction": "src",
"presence": "always"
}
},
"rank": "secondary"
},
"y4menc": {
"author": "Wim Taymans <wim.taymans@gmail.com>",
"description": "Encodes a YUV frame into the yuv4mpeg format (mjpegtools)",
@ -29629,7 +29654,6 @@
"GstPreset"
],
"klass": "Codec/Encoder/Video",
"long-name": "YUV4MPEG video encoder",
"pad-templates": {
"sink": {
"caps": "video/x-raw:\n format: { IYUV, I420, Y42B, Y41B, Y444 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
@ -29642,11 +29666,10 @@
"presence": "always"
}
},
"properties": {},
"rank": "primary"
}
},
"filename": "gsty4menc",
"filename": "gsty4m",
"license": "LGPL",
"other-types": {},
"package": "GStreamer Good Plug-ins",

View File

@ -33,13 +33,11 @@
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gsty4mdec.h"
#include <stdlib.h>
#include <string.h>
#include "gsty4mdec.h"
#define MAX_SIZE 32768
GST_DEBUG_CATEGORY (y4mdec_debug);
@ -47,7 +45,6 @@ GST_DEBUG_CATEGORY (y4mdec_debug);
/* prototypes */
static void gst_y4m_dec_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec);
static void gst_y4m_dec_get_property (GObject * object,
@ -952,16 +949,3 @@ gst_y4m_dec_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
return res;
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (y4mdec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
y4mdec,
"Demuxes/decodes YUV4MPEG streams",
plugin_init, VERSION, "LGPL", PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View File

@ -22,6 +22,7 @@
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
@ -62,6 +63,7 @@ struct _GstY4mDecClass
};
GType gst_y4m_dec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (y4mdec);
G_END_DECLS

View File

@ -39,10 +39,10 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gsty4mencode.h"
#include "gsty4menc.h"
/* Filter signals and args */
enum
@ -390,15 +390,3 @@ not_negotiated:
return GST_FLOW_NOT_NEGOTIATED;
}
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (y4menc, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
y4menc,
"Encodes a YUV frame into the yuv4mpeg format (mjpegtools)",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View File

@ -23,6 +23,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
G_BEGIN_DECLS

View File

@ -1,30 +1,33 @@
y4menc_sources = [
'gsty4mencode.c',
y4m_sources = [
'plugin.c',
'gsty4menc.c',
'gsty4mdec.c'
]
y4menc_headers = [
'gsty4mencode.h',
y4m_headers = [
'gsty4menc.h',
'gsty4mdec.h',
]
doc_sources = []
foreach s: y4menc_sources + y4menc_headers
foreach s: y4m_sources + y4m_headers
doc_sources += meson.current_source_dir() / s
endforeach
plugin_sources += {
'y4menc': pathsep.join(doc_sources)
'y4m': pathsep.join(doc_sources)
}
if get_option('y4m').disabled()
subdir_done()
endif
gsty4menc = library('gsty4menc',
y4menc_sources,
gsty4m = library('gsty4m',
y4m_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep],
install : true,
install_dir : plugins_install_dir,
)
plugins += [gsty4menc]
plugins += [gsty4m]

View File

@ -0,0 +1,52 @@
/* GStreamer
* Copyright (C) 2025 Igalia, S.L.
* author: Víctor Jáquez <vjaquez@igalia.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.
*/
/**
* SECTION:plugin-y4m
* @title: YUV4MEG
*
* Plugin for YUV4MEG (y4m) streams.
*
* Since: 2.28
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gsty4menc.h"
#include "gsty4mdec.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean ret;
ret = GST_ELEMENT_REGISTER (y4mdec, plugin);
ret |= GST_ELEMENT_REGISTER (y4menc, plugin);
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
y4m,
"Encodes and demuxes/decodes YUV4MPEG streams (mjpegtools)",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)