aboutsummaryrefslogtreecommitdiff
path: root/src/views/video/msink.h
blob: b23a31be6b13c0b6309f87edf0f7a31359703008 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#ifndef _HAVE_M_GST_VIDEO_SINK_H
#define _HAVE_M_GST_VIDEO_SINK_H

#include <glib-object.h>
#include <gst/base/gstbasesink.h>
#include <gst/gstplugin.h>

//! \cond
G_BEGIN_DECLS

#define M_GST_TYPE_VIDEO_SINK m_gst_video_sink_get_type()

#define M_GST_VIDEO_SINK(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
                                 M_GST_TYPE_VIDEO_SINK, MGstVideoSink))

#define M_GST_VIDEO_SINK_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST ((klass), \
                              M_GST_TYPE_VIDEO_SINK, MGstVideoSinkClass))

#define M_GST_IS_VIDEO_SINK(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
                                 M_GST_TYPE_VIDEO_SINK))

#define M_GST_IS_VIDEO_SINK_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), \
                              M_GST_TYPE_VIDEO_SINK))

#define M_GST_VIDEO_SINK_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), \
                                M_GST_TYPE_VIDEO_SINK, MGstVideoSinkClass))

typedef struct _MGstVideoSink        MGstVideoSink;
typedef struct _MGstVideoSinkClass   MGstVideoSinkClass;

/*!
 * \class MGstVideoSink
 * \brief MGstVideoSink is a simple video sink with a render callback function.
 *
 * MGstVideoSink provides callbacks for custom video rendering offering gstbuffer
 * to the frame_cb function.
 */
struct _MGstVideoSink {
    GstBaseSink parent;

    /*! render frame callback function
     * \param void pointer to GstBuffer
     * \param void pointer to user specified data
     */
    void (*frame_cb)(void *, void *);

    /*! render frame callback function
     * \param void pointer to user specified data
     */
    void (*ready_cb)(void *);

    void *user_data;

    int frameskip;
    guint yuv_mode;

    int w;
    int h;
};

struct _MGstVideoSinkClass {
    GstBaseSinkClass parent_class;
};

GType       m_gst_video_sink_get_type(void) G_GNUC_CONST;

/*!
 * \brief Constructor - creates RGB|BGR sink
 */
GstElement *m_gst_video_sink_new();

/*!
 * \brief Constructor - creates YUV sink
 */
GstElement *m_gst_video_sink_yuv_new();


G_END_DECLS
//! \endcond

#endif