forked from centricular/gstcefsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gstcefaudiometa.cc
66 lines (52 loc) · 1.51 KB
/
gstcefaudiometa.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "gstcefaudiometa.h"
static gboolean
gst_cef_audio_meta_init (GstMeta * meta, gpointer params, GstBuffer * buffer)
{
GstCefAudioMeta *ameta = (GstCefAudioMeta *) meta;
ameta->buffers = NULL;
return TRUE;
}
static void
gst_cef_audio_meta_free (GstMeta * meta, GstBuffer * buffer)
{
GstCefAudioMeta *ameta = (GstCefAudioMeta *) meta;
if (ameta->buffers) {
gst_buffer_list_unref (ameta->buffers);
ameta->buffers = NULL;
}
}
GstCefAudioMeta *
gst_buffer_add_cef_audio_meta (GstBuffer * buffer, GstBufferList *buffers)
{
GstCefAudioMeta *ameta;
ameta =
(GstCefAudioMeta *) gst_buffer_add_meta (buffer, GST_CEF_AUDIO_META_INFO, NULL);
ameta->buffers = buffers;
return ameta;
}
GType
gst_cef_audio_meta_api_get_type (void)
{
static GType type;
static const gchar *tags[] = { NULL };
if (g_once_init_enter (&type)) {
GType _type = gst_meta_api_type_register ("GstCefAudioMetaAPI", tags);
g_once_init_leave (&type, _type);
}
return type;
}
const GstMetaInfo *
gst_cef_audio_meta_get_info (void)
{
static const GstMetaInfo *gst_cef_audio_meta_info = NULL;
if (g_once_init_enter ((GstMetaInfo **) &gst_cef_audio_meta_info)) {
const GstMetaInfo *meta =
gst_meta_register (GST_CEF_AUDIO_META_API_TYPE,
"GstCefAudioMeta", sizeof (GstCefAudioMeta),
gst_cef_audio_meta_init, gst_cef_audio_meta_free,
NULL);
g_once_init_leave ((GstMetaInfo **) &gst_cef_audio_meta_info,
(GstMetaInfo *) meta);
}
return gst_cef_audio_meta_info;
}