xuesong.jiang | ae1548e | 2022-05-06 16:38:46 +0800 | [diff] [blame^] | 1 | /* GStreamer |
| 2 | * Copyright (C) 2022 <xuesong.jiang@amlogic.com> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public |
| 15 | * License along with this library; if not, write to the |
| 16 | * Free Software Foundation, Inc., 51 Franklin Street, Suite 500, |
| 17 | * Boston, MA 02110-1335, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GST_AML_V4L2_VIDEO_DEC_H__ |
| 21 | #define __GST_AML_V4L2_VIDEO_DEC_H__ |
| 22 | |
| 23 | #include <gst/gst.h> |
| 24 | #include <gst/video/video.h> |
| 25 | #include <gst/video/gstvideodecoder.h> |
| 26 | #include <gst/video/gstvideometa.h> |
| 27 | |
| 28 | #include <gstamlv4l2object.h> |
| 29 | #include <gstamlv4l2bufferpool.h> |
| 30 | |
| 31 | G_BEGIN_DECLS |
| 32 | |
| 33 | #define GST_TYPE_AML_V4L2_VIDEO_DEC \ |
| 34 | (gst_aml_v4l2_video_dec_get_type()) |
| 35 | #define GST_AML_V4L2_VIDEO_DEC(obj) \ |
| 36 | (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AML_V4L2_VIDEO_DEC, GstAmlV4l2VideoDec)) |
| 37 | #define GST_AML_V4L2_VIDEO_DEC_CLASS(klass) \ |
| 38 | (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AML_V4L2_VIDEO_DEC, GstAmlV4l2VideoDecClass)) |
| 39 | #define GST_IS_AML_V4L2_VIDEO_DEC(obj) \ |
| 40 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AML_V4L2_VIDEO_DEC)) |
| 41 | #define GST_IS_AML_V4L2_VIDEO_DEC_CLASS(obj) \ |
| 42 | (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AML_V4L2_VIDEO_DEC)) |
| 43 | |
| 44 | typedef struct _GstAmlV4l2VideoDec GstAmlV4l2VideoDec; |
| 45 | typedef struct _GstAmlV4l2VideoDecClass GstAmlV4l2VideoDecClass; |
| 46 | |
| 47 | struct _GstAmlV4l2VideoDec |
| 48 | { |
| 49 | GstVideoDecoder parent; |
| 50 | |
| 51 | /* < private > */ |
| 52 | GstAmlV4l2Object *v4l2output; |
| 53 | GstAmlV4l2Object *v4l2capture; |
| 54 | |
| 55 | /* pads */ |
| 56 | GstCaps *probed_srccaps; |
| 57 | GstCaps *probed_sinkcaps; |
| 58 | |
| 59 | /* State */ |
| 60 | GstVideoCodecState *input_state; |
| 61 | gboolean active; |
| 62 | GstFlowReturn output_flow; |
| 63 | |
| 64 | /* flags */ |
| 65 | gboolean is_secure_path; |
| 66 | }; |
| 67 | |
| 68 | struct _GstAmlV4l2VideoDecClass |
| 69 | { |
| 70 | GstVideoDecoderClass parent_class; |
| 71 | |
| 72 | gchar *default_device; |
| 73 | }; |
| 74 | |
| 75 | GType gst_aml_v4l2_video_dec_get_type(void); |
| 76 | |
| 77 | gboolean gst_aml_v4l2_is_video_dec(GstCaps *sink_caps, GstCaps *src_caps); |
| 78 | void gst_aml_v4l2_video_dec_register(GstPlugin *plugin, |
| 79 | const gchar *basename, |
| 80 | const gchar *device_path, |
| 81 | GstCaps *sink_caps, GstCaps *src_caps); |
| 82 | |
| 83 | G_END_DECLS |
| 84 | |
| 85 | #endif /* __GST_AML_V4L2_VIDEO_DEC_H__ */ |