root / switcher / video-test-source.cpp @ 440227f8
History | View | Annotate | Download (1.6 kB)
| 1 |
/*
|
|---|---|
| 2 |
* Copyright (C) 2012 Nicolas Bouillot (http://www.nicolasbouillot.net) |
| 3 |
* |
| 4 |
* This file is part of switcher. |
| 5 |
* |
| 6 |
* switcher is free software: you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation, either version 3 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* switcher is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with switcher. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include "switcher/property.h" |
| 21 |
#include "switcher/video-test-source.h" |
| 22 |
#include <gst/gst.h> |
| 23 |
|
| 24 |
namespace switcher
|
| 25 |
{
|
| 26 |
|
| 27 |
VideoTestSource::VideoTestSource () |
| 28 |
{
|
| 29 |
g_print ("video test source constructor \n");
|
| 30 |
videotestsrc_ = gst_element_factory_make ("videotestsrc",NULL); |
| 31 |
|
| 32 |
guint numproperty; |
| 33 |
GParamSpec **property = g_object_class_list_properties (G_OBJECT_GET_CLASS(videotestsrc_), &numproperty); |
| 34 |
for (guint i = 0; i < numproperty; i++) { |
| 35 |
Property *prop = new Property (G_OBJECT (videotestsrc_),property[i]);
|
| 36 |
prop->print(); |
| 37 |
} |
| 38 |
|
| 39 |
g_print ("-------------------------------\n");
|
| 40 |
|
| 41 |
GParamSpec *pspec = g_object_class_find_property (G_OBJECT_GET_CLASS(videotestsrc_), "pattern");
|
| 42 |
if (pspec != NULL) |
| 43 |
{
|
| 44 |
Property *prop = new Property (G_OBJECT (videotestsrc_), pspec);
|
| 45 |
prop->print(); |
| 46 |
} |
| 47 |
|
| 48 |
name_ = gst_element_get_name (videotestsrc_); |
| 49 |
set_raw_video_element (videotestsrc_); |
| 50 |
} |
| 51 |
|
| 52 |
} |
