1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef GST_MUX_BIN_H 17 #define GST_MUX_BIN_H 18 19 #include <gst/gst.h> 20 21 G_BEGIN_DECLS 22 23 GType gst_mux_bin_get_type(void); 24 #define GST_TYPE_MUX_BIN \ 25 (gst_mux_bin_get_type()) 26 #define GST_MUX_BIN(obj) \ 27 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_MUX_BIN, GstMuxBin)) 28 #define GST_MUX_BIN_CLASS(klass) \ 29 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_MUX_BIN, GstMuxBinClass)) 30 #define GST_IS_MUX_BIN(obj) \ 31 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_MUX_BIN)) 32 #define GST_IS_MUX_BIN_CLASS(klass) \ 33 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_MUX_BIN)) 34 #define GST_MUX_BIN_GET_CLASS(obj) \ 35 (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_MUX_BIN, GstMuxBinClass)) 36 37 struct _GstTrackInfo { 38 gchar *srcName_; 39 gchar *parseName_; 40 GstElement *src_; 41 GstElement *parse_; 42 }; 43 44 struct _GstMuxBin { 45 GstPipeline parent_; 46 47 /* private */ 48 GSList *video_src_list; 49 GSList *audio_src_list; 50 GstElement *split_mux_sink; 51 52 gint out_fd; 53 gchar *mux; 54 gint rotation; 55 gint latitude; 56 gint longitude; 57 }; 58 59 struct _GstMuxBinClass { 60 GstPipelineClass parent_class; 61 void (*add_track)(_GstMuxBin *mux_bin, const char *src_name, const char *parse_name, int32_t track_type); 62 }; 63 64 using GstMuxBin = struct _GstMuxBin; 65 using GstMuxBinClass = struct _GstMuxBinClass; 66 using GstTrackInfo = struct _GstTrackInfo; 67 68 G_GNUC_INTERNAL GType gst_mux_bin_get_type(void); 69 70 G_END_DECLS 71 #endif // GST_MUX_BIN_H