• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) <2015> British Broadcasting Corporation
3  *   Author: Chris Bass <dash@rd.bbc.co.uk>
4  *
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.
9  *
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.
14  *
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.
19  */
20 
21 #ifndef __GST_SUBTITLE_META_H__
22 #define __GST_SUBTITLE_META_H__
23 
24 #include <gst/gst.h>
25 #include "subtitle.h"
26 
27 G_BEGIN_DECLS
28 
29 typedef struct _GstSubtitleMeta GstSubtitleMeta;
30 
31 /**
32  * GstSubtitleMeta:
33  * @meta: The parent #GstMeta.
34  * @regions: The #GstSubtitleRegions containing layout and styling information
35  * needed to render the subtitle text contained in the associated #GstBuffer.
36  *
37  * Metadata type that describes the layout and styling of subtitle text
38  * contained in a #GstBuffer.
39  */
40 struct _GstSubtitleMeta {
41   GstMeta meta;
42 
43   GPtrArray *regions;
44 };
45 
46 GType gst_subtitle_meta_api_get_type (void);
47 #define GST_SUBTITLE_META_API_TYPE (gst_subtitle_meta_api_get_type())
48 
49 #define gst_buffer_get_subtitle_meta(b) \
50     ((GstSubtitleMeta*)gst_buffer_get_meta ((b), GST_SUBTITLE_META_API_TYPE))
51 
52 #define GST_SUBTITLE_META_INFO (gst_subtitle_meta_get_info())
53 
54 gboolean gst_subtitle_meta_init (GstMeta * meta, gpointer params,
55     GstBuffer * buffer);
56 
57 void gst_subtitle_meta_free (GstMeta * meta, GstBuffer * buffer);
58 
59 const GstMetaInfo * gst_subtitle_meta_get_info (void);
60 
61 GstSubtitleMeta * gst_buffer_add_subtitle_meta (GstBuffer * buffer,
62     GPtrArray * regions);
63 
64 G_END_DECLS
65 
66 #endif /* __GST_SUBTITLE_META_H__ */
67