3
* Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
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.
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.
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., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef _GST_VIDEO_FRAME_H_
22
#define _GST_VIDEO_FRAME_H_
26
#define GST_TYPE_VIDEO_FRAME (gst_video_frame_get_type())
27
#define GST_IS_VIDEO_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_FRAME))
28
#define GST_VIDEO_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_FRAME, GstVideoFrame))
29
#define GST_VIDEO_FRAME_CAST(obj) ((GstVideoFrame *)obj)
33
* @GST_VIDEO_FRAME_FLAG_PREROLL: the frame is part of a preroll and should not be
35
* @GST_VIDEO_FRAME_FLAG_DISCONT: the frame marks a discontinuity in the stream.
36
* This typically occurs after a seek or a dropped buffer from a live or
38
* @GST_VIDEO_FRAME_FLAG_GAP: the frame has been created to fill a gap in the
39
* stream and contains media neutral data (elements can switch to optimized code
40
* path that ignores the buffer content).
41
* @GST_VIDEO_FRAME_FLAG_DELTA_UNIT: the frame is a keyframe.
42
* @GST_VIDEO_FRAME_FLAG_SYNC_POINT: the frame marks a sync point.
43
* @GST_VIDEO_FRAME_FLAG_EOS: the frame is the last in the stream.
44
* @GST_VIDEO_FRAME_FLAG_TFF: If the frame is interlaced, then the first
45
* field in the video frame is the top field. If unset, the bottom field is first.
46
* @GST_VIDEO_FRAME_FLAG_LAST: additional flags can be added starting from this flag.
47
* A set of frame flags used to describe properties of a #GstVideoFrame.
51
GST_VIDEO_FRAME_FLAG_PREROLL = (GST_MINI_OBJECT_FLAG_LAST << 0),
52
GST_VIDEO_FRAME_FLAG_DISCONT = (GST_MINI_OBJECT_FLAG_LAST << 1),
53
GST_VIDEO_FRAME_FLAG_GAP = (GST_MINI_OBJECT_FLAG_LAST << 2),
54
GST_VIDEO_FRAME_FLAG_KEYFRAME = (GST_MINI_OBJECT_FLAG_LAST << 3),
55
GST_VIDEO_FRAME_FLAG_SYNC_POINT = (GST_MINI_OBJECT_FLAG_LAST << 4),
56
GST_VIDEO_FRAME_FLAG_EOS = (GST_MINI_OBJECT_FLAG_LAST << 5),
57
GST_VIDEO_FRAME_FLAG_TFF = (GST_MINI_OBJECT_FLAG_LAST << 6),
58
GST_VIDEO_FRAME_FLAG_LAST = (GST_MINI_OBJECT_FLAG_LAST << 7)
61
typedef struct _GstVideoFrame GstVideoFrame;
62
typedef struct _GstVideoFrameClass GstVideoFrameClass;
66
GstMiniObject mini_object;
68
GstClockTime decode_timestamp;
69
GstClockTime presentation_timestamp;
70
GstClockTime presentation_duration;
72
gint system_frame_number;
73
gint decode_frame_number;
74
gint presentation_frame_number;
76
gint distance_from_sync;
78
GstBuffer *sink_buffer;
79
GstBuffer *src_buffer;
86
struct _GstVideoFrameClass
88
GstMiniObjectClass mini_object_class;
93
* gst_video_frame_ref:
94
* @frame: a #GstVideoFrame.
96
* Increases the refcount of the given frame by one.
100
#ifdef _FOOL_GTK_DOC_
101
G_INLINE_FUNC GstVideoFrame * gst_buffer_ref (GstVideoFrame * frame);
104
static inline GstVideoFrame *
105
gst_video_frame_ref (GstVideoFrame *frame)
107
return (GstVideoFrame *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (frame));
111
* gst_video_frame_unref:
112
* @frame: a #GstVideoFrame.
114
* Decreases the refcount of the frame. If the refcount reaches 0, the frame
117
#ifdef _FOOL_GTK_DOC_
118
G_INLINE_FUNC void gst_video_frame_unref (GstVideoFrame * frame);
122
gst_video_frame_unref (GstVideoFrame * frame)
124
gst_mini_object_unref (GST_MINI_OBJECT_CAST (frame));
128
* GST_VIDEO_FRAME_FLAG_IS_SET:
129
* @buf: a #GstVideoFrame.
130
* @flag: the #GstVideoFrameFlag to check.
132
* Gives the status of a specific flag on a video frame.
134
#define GST_VIDEO_FRAME_FLAG_IS_SET(frame,flag) GST_MINI_OBJECT_FLAG_IS_SET (frame, flag)
136
* GST_VIDEO_FRAME_FLAG_SET:
137
* @buf: a #GstVideoFrame.
138
* @flag: the #GstVideoFrameFlag to set.
140
* Sets a frame flag on a video frame.
142
#define GST_VIDEO_FRAME_FLAG_SET(frame,flag) GST_MINI_OBJECT_FLAG_SET (frame, flag)
144
* GST_VIDEO_FRAME_FLAG_UNSET:
145
* @buf: a #GstVideoFrame.
146
* @flag: the #GstVideoFrameFlag to clear.
148
* Clears a frame flag.
150
#define GST_VIDEO_FRAME_FLAG_UNSET(frame,flag) GST_MINI_OBJECT_FLAG_UNSET (frame, flag)
152
GstVideoFrame *gst_video_frame_new (void);
154
GType gst_video_frame_get_type (void);
b'\\ No newline at end of file'