2 * Copyright (C) 2017 Collabora Inc.
3 * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
32 #include "gstv4l2object.h"
33 #include "gstv4l2h263enc.h"
36 #include <gst/gst-i18n-plugin.h>
38 GST_DEBUG_CATEGORY_STATIC (gst_v4l2_h263_enc_debug);
39 #define GST_CAT_DEFAULT gst_v4l2_h263_enc_debug
42 static GstStaticCaps src_template_caps =
43 GST_STATIC_CAPS ("video/x-h263, variant=(string) itu");
48 V4L2_STD_OBJECT_PROPS,
49 /* TODO add H263 controls */
52 #define gst_v4l2_h263_enc_parent_class parent_class
53 G_DEFINE_TYPE (GstV4l2H263Enc, gst_v4l2_h263_enc, GST_TYPE_V4L2_VIDEO_ENC);
56 gst_v4l2_h263_enc_set_property (GObject * object,
57 guint prop_id, const GValue * value, GParamSpec * pspec)
63 gst_v4l2_h263_enc_get_property (GObject * object,
64 guint prop_id, GValue * value, GParamSpec * pspec)
70 gst_v4l2_h263_enc_init (GstV4l2H263Enc * self)
76 gst_v4l2_h263_enc_class_init (GstV4l2H263EncClass * klass)
78 GstElementClass *element_class;
79 GObjectClass *gobject_class;
81 parent_class = g_type_class_peek_parent (klass);
83 element_class = (GstElementClass *) klass;
84 gobject_class = (GObjectClass *) klass;
86 GST_DEBUG_CATEGORY_INIT (gst_v4l2_h263_enc_debug, "v4l2h263enc", 0,
87 "V4L2 H.263 Encoder");
89 gst_element_class_set_static_metadata (element_class,
91 "Codec/Encoder/Video",
92 "Encode H.263 video streams via V4L2 API",
93 "Nicolas Dufresne <nicolas.dufresne@collabora.com>");
95 gobject_class->set_property =
96 GST_DEBUG_FUNCPTR (gst_v4l2_h263_enc_set_property);
97 gobject_class->get_property =
98 GST_DEBUG_FUNCPTR (gst_v4l2_h263_enc_get_property);
101 /* Probing functions */
103 gst_v4l2_is_h263_enc (GstCaps * sink_caps, GstCaps * src_caps)
105 return gst_v4l2_is_video_enc (sink_caps, src_caps,
106 gst_static_caps_get (&src_template_caps));
110 gst_v4l2_h263_enc_register (GstPlugin * plugin, const gchar * basename,
111 const gchar * device_path, GstCaps * sink_caps, GstCaps * src_caps)
113 gst_v4l2_video_enc_register (plugin, GST_TYPE_V4L2_H263_ENC,
114 "h263", basename, device_path, sink_caps,
115 gst_static_caps_get (&src_template_caps), src_caps);