1 /* 2 * Copyright (C) 2023 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_SUBTITLE_SRT_PARSE_H 17 #define GST_SUBTITLE_SRT_PARSE_H 18 19 #include "gst_subtitle_base_parse.h" 20 21 #define GST_TYPE_SUBTITLE_SRT_PARSE (gst_subtitle_srt_parse_get_type()) 22 #define GST_SUBTITLE_SRT_PARSE_CAST(obj) ((GstSubtitleSrtParse *)(obj)) 23 24 typedef enum { 25 SUBNUM_STATE, 26 TIME_STATE, 27 SUBTEXT_STATE, 28 VALID_STATE 29 } SrtParseState; 30 31 typedef struct { 32 GstSubtitleBaseParse parent; 33 SrtParseState state; 34 GString *buf; 35 gint64 last_end; 36 } GstSubtitleSrtParse; 37 38 typedef struct { 39 GstSubtitleBaseParseClass parent_class; 40 } GstSubtitleSrtParseClass; 41 42 gboolean gst_subtitle_srt_parse_register(GstPlugin *plugin); 43 GType gst_subtitle_srt_parse_get_type(void); 44 45 #endif // GST_SUBTITLE_SRT_PARSE_H 46