2 * Copyright (C) 2011 David Schleef <ds@schleef.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
17 * Boston, MA 02110-1335, USA.
25 #include "gstdecklink.h"
26 #include "gstdecklinksrc.h"
27 #include "gstdecklinksink.h"
30 gst_decklink_mode_get_type (void)
35 static const GEnumValue modes[] = {
36 {GST_DECKLINK_MODE_NTSC, "ntsc", "NTSC SD 60i"},
37 {GST_DECKLINK_MODE_PAL, "pal", "PAL SD 50i"},
38 {GST_DECKLINK_MODE_1080i50, "1080i50", "HD1080 50i"},
39 {GST_DECKLINK_MODE_1080i60, "1080i60", "HD1080 60i"},
40 {GST_DECKLINK_MODE_720p50, "720p50", "HD720 50p"},
41 {GST_DECKLINK_MODE_720p60, "720p60", "HD720 60p"},
45 type = g_enum_register_static ("GstDecklinkModes", modes);
50 static const GstDecklinkMode modes[] = {
51 {bmdModeNTSC, 720, 486, 30000, 1001, true},
52 {bmdModePAL, 720, 576, 25, 1, true},
53 {bmdModeHD1080i50, 1920, 1080, 25, 1, true},
54 {bmdModeHD1080i5994, 1920, 1080, 30000, 1001, true},
55 {bmdModeHD720p50, 1280, 720, 50, 1, true},
56 {bmdModeHD720p5994, 1280, 720, 60000, 1001, true}
60 //{ bmdModeNTSC2398, 720,486,24000,1001,true },
61 //{ bmdModeHD1080p2398, 1920,1080,24000,1001,false },
62 //{ bmdModeHD1080p24, 1920,1080,24,1,false },
63 //{ bmdModeHD1080p25, 1920,1080,25,1,false },
64 //{ bmdModeHD1080p2997, 1920,1080,30000,1001,false },
65 //{ bmdModeHD1080p30, 1920,1080,30,1,false },
66 //{ bmdModeHD1080i6000, 1920,1080,30,1,true },
67 //{ bmdModeHD720p60, 1280,720,60,1,true }
70 const GstDecklinkMode *
71 gst_decklink_get_mode (GstDecklinkModeEnum e)
77 gst_decklink_mode_get_caps (GstDecklinkModeEnum e)
79 const GstDecklinkMode *mode = &modes[e];
81 return gst_caps_new_simple ("video/x-raw-yuv",
82 "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'),
83 "width", G_TYPE_INT, mode->width,
84 "height", G_TYPE_INT, mode->height,
85 "framerate", GST_TYPE_FRACTION,
86 mode->fps_n, mode->fps_d,
87 "interlaced", G_TYPE_BOOLEAN, mode->interlaced, NULL);
92 plugin_init (GstPlugin * plugin)
95 gst_element_register (plugin, "decklinksrc", GST_RANK_NONE,
96 gst_decklink_src_get_type ());
97 gst_element_register (plugin, "decklinksink", GST_RANK_NONE,
98 gst_decklink_sink_get_type ());
103 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
106 "Blackmagic Decklink plugin",
107 plugin_init, VERSION, "LGPL", PACKAGE_NAME, GST_PACKAGE_ORIGIN)