~ubuntu-branches/ubuntu/quantal/gst-plugins-bad-multiverse0.10/quantal

« back to all changes in this revision

Viewing changes to sys/vdpau/basevideodecoder/gstvideoframe.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-09-03 16:57:09 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20100903165709-5158pp06sfg0i6dv
Tags: 0.10.20-1
* New upstream release:
  + debian/build-deps.in:
    - Update build dependencies.
* debian/source/format,
  debian/compat,
  debian/rules,
  debian/patches:
  + Update to debhelper compat level 7.
  + Update to source format 3.0 (quilt).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* GStreamer
 
3
* Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
 
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., 59 Temple Place - Suite 330,
 
18
* Boston, MA 02111-1307, USA.
 
19
*/
 
20
 
 
21
#ifndef _GST_VIDEO_FRAME_H_
 
22
#define _GST_VIDEO_FRAME_H_
 
23
 
 
24
#include <gst/gst.h>
 
25
 
 
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)
 
30
 
 
31
/**
 
32
 * GstVideoFrameFlag:
 
33
 * @GST_VIDEO_FRAME_FLAG_PREROLL: the frame is part of a preroll and should not be
 
34
 * displayed.
 
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
 
37
 * network source.
 
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.
 
48
 */
 
49
typedef enum
 
50
{
 
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)
 
59
} GstVideoFrameFlag;
 
60
 
 
61
typedef struct _GstVideoFrame GstVideoFrame;
 
62
typedef struct _GstVideoFrameClass GstVideoFrameClass;
 
63
 
 
64
struct _GstVideoFrame
 
65
{
 
66
  GstMiniObject mini_object;
 
67
 
 
68
  GstClockTime decode_timestamp;
 
69
  GstClockTime presentation_timestamp;
 
70
  GstClockTime presentation_duration;
 
71
 
 
72
  gint system_frame_number;
 
73
  gint decode_frame_number;
 
74
  gint presentation_frame_number;
 
75
 
 
76
  gint distance_from_sync;
 
77
 
 
78
        GstBuffer *sink_buffer;
 
79
  GstBuffer *src_buffer;
 
80
  
 
81
  gint field_index;
 
82
  gint n_fields;
 
83
  
 
84
};
 
85
 
 
86
struct _GstVideoFrameClass
 
87
{
 
88
  GstMiniObjectClass mini_object_class;
 
89
};
 
90
 
 
91
/* refcounting */
 
92
/**
 
93
 * gst_video_frame_ref:
 
94
 * @frame: a #GstVideoFrame.
 
95
 *
 
96
 * Increases the refcount of the given frame by one.
 
97
 *
 
98
 * Returns: @frame
 
99
 */
 
100
#ifdef _FOOL_GTK_DOC_
 
101
G_INLINE_FUNC GstVideoFrame * gst_buffer_ref (GstVideoFrame * frame);
 
102
#endif
 
103
 
 
104
static inline GstVideoFrame *
 
105
gst_video_frame_ref (GstVideoFrame *frame)
 
106
{
 
107
  return (GstVideoFrame *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (frame));
 
108
}
 
109
 
 
110
/**
 
111
 * gst_video_frame_unref:
 
112
 * @frame: a #GstVideoFrame.
 
113
 *
 
114
 * Decreases the refcount of the frame. If the refcount reaches 0, the frame
 
115
 * will be freed.
 
116
 */
 
117
#ifdef _FOOL_GTK_DOC_
 
118
G_INLINE_FUNC void gst_video_frame_unref (GstVideoFrame * frame);
 
119
#endif
 
120
 
 
121
static inline void
 
122
gst_video_frame_unref (GstVideoFrame * frame)
 
123
{
 
124
  gst_mini_object_unref (GST_MINI_OBJECT_CAST (frame));
 
125
}
 
126
 
 
127
/**
 
128
 * GST_VIDEO_FRAME_FLAG_IS_SET:
 
129
 * @buf: a #GstVideoFrame.
 
130
 * @flag: the #GstVideoFrameFlag to check.
 
131
 *
 
132
 * Gives the status of a specific flag on a video frame.
 
133
 */
 
134
#define GST_VIDEO_FRAME_FLAG_IS_SET(frame,flag)        GST_MINI_OBJECT_FLAG_IS_SET (frame, flag)
 
135
/**
 
136
 * GST_VIDEO_FRAME_FLAG_SET:
 
137
 * @buf: a #GstVideoFrame.
 
138
 * @flag: the #GstVideoFrameFlag to set.
 
139
 *
 
140
 * Sets a frame flag on a video frame.
 
141
 */
 
142
#define GST_VIDEO_FRAME_FLAG_SET(frame,flag)           GST_MINI_OBJECT_FLAG_SET (frame, flag)
 
143
/**
 
144
 * GST_VIDEO_FRAME_FLAG_UNSET:
 
145
 * @buf: a #GstVideoFrame.
 
146
 * @flag: the #GstVideoFrameFlag to clear.
 
147
 *
 
148
 * Clears a frame flag.
 
149
 */
 
150
#define GST_VIDEO_FRAME_FLAG_UNSET(frame,flag)         GST_MINI_OBJECT_FLAG_UNSET (frame, flag)
 
151
 
 
152
GstVideoFrame *gst_video_frame_new (void);
 
153
 
 
154
GType gst_video_frame_get_type (void);
 
155
 
 
156
#endif
 
 
b'\\ No newline at end of file'