diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llmedia/llmediaimplgstreamervidplug.h | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/llmedia/llmediaimplgstreamervidplug.h')
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamervidplug.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamervidplug.h b/linden/indra/llmedia/llmediaimplgstreamervidplug.h new file mode 100644 index 0000000..2bfb853 --- /dev/null +++ b/linden/indra/llmedia/llmediaimplgstreamervidplug.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /** | ||
2 | * @file llmediaimplgstreamervidplug.h | ||
3 | * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl | ||
4 | * | ||
5 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef __GST_SLVIDEO_H__ | ||
30 | #define __GST_SLVIDEO_H__ | ||
31 | |||
32 | #if LL_GSTREAMER_ENABLED | ||
33 | |||
34 | extern "C" { | ||
35 | #include <gst/gst.h> | ||
36 | #include <gst/video/video.h> | ||
37 | #include <gst/video/gstvideosink.h> | ||
38 | } | ||
39 | |||
40 | G_BEGIN_DECLS | ||
41 | |||
42 | /* #defines don't like whitespacey bits */ | ||
43 | #define GST_TYPE_SLVIDEO \ | ||
44 | (gst_slvideo_get_type()) | ||
45 | #define GST_SLVIDEO(obj) \ | ||
46 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SLVIDEO,GstSLVideo)) | ||
47 | #define GST_SLVIDEO_CLASS(klass) \ | ||
48 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SLVIDEO,GstSLVideoClass)) | ||
49 | #define GST_IS_SLVIDEO(obj) \ | ||
50 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SLVIDEO)) | ||
51 | #define GST_IS_SLVIDEO_CLASS(klass) \ | ||
52 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SLVIDEO)) | ||
53 | |||
54 | typedef struct _GstSLVideo GstSLVideo; | ||
55 | typedef struct _GstSLVideoClass GstSLVideoClass; | ||
56 | |||
57 | typedef enum { | ||
58 | SLV_PF_UNKNOWN = 0, | ||
59 | SLV_PF_RGBX = 1, | ||
60 | SLV_PF_BGRX = 2, | ||
61 | SLV__END = 3 | ||
62 | } SLVPixelFormat; | ||
63 | const int SLVPixelFormatBytes[SLV__END] = {1, 4, 4}; | ||
64 | |||
65 | struct _GstSLVideo | ||
66 | { | ||
67 | GstVideoSink video_sink; | ||
68 | |||
69 | GstCaps *caps; | ||
70 | |||
71 | int fps_n, fps_d; | ||
72 | int par_n, par_d; | ||
73 | int height, width; | ||
74 | SLVPixelFormat format; | ||
75 | |||
76 | // SHARED WITH APPLICATION: | ||
77 | // Access to the following should be protected by GST_OBJECT_LOCK() on | ||
78 | // the GstSLVideo object, and should be totally consistent upon UNLOCK | ||
79 | // (i.e. all written at once to reflect the current retained frame info | ||
80 | // when the retained frame is updated.) | ||
81 | bool retained_frame_ready; // new frame ready since flag last reset. (*TODO: could get the writer to wait on a semaphore instead of having the reader poll, potentially making dropped frames somewhat cheaper.) | ||
82 | U8* retained_frame_data; | ||
83 | int retained_frame_allocbytes; | ||
84 | int retained_frame_width, retained_frame_height; | ||
85 | SLVPixelFormat retained_frame_format; | ||
86 | }; | ||
87 | |||
88 | struct _GstSLVideoClass | ||
89 | { | ||
90 | GstVideoSink parent_class; | ||
91 | }; | ||
92 | |||
93 | GType gst_slvideo_get_type (void); | ||
94 | |||
95 | void gst_slvideo_init_class (void); | ||
96 | |||
97 | G_END_DECLS | ||
98 | |||
99 | #endif // LL_GSTREAMER_ENABLED | ||
100 | |||
101 | #endif /* __GST_SLVIDEO_H__ */ | ||