decklink: Initialize refcount of our C++ classes in the constructor

CID 1262288
CID 1262287
CID 1262289
This commit is contained in:
Sebastian Dröge 2015-01-12 15:57:53 +01:00
parent 0b3f5dafa6
commit b79ece392c
3 changed files with 6 additions and 1 deletions

View file

@ -405,7 +405,8 @@ private:
gint m_refcount;
public:
GStreamerDecklinkInputCallback (GstDecklinkInput * input)
: IDeckLinkInputCallback ()
: IDeckLinkInputCallback (),
m_refcount (1)
{
m_input = input;
g_mutex_init (&m_mutex);

View file

@ -140,6 +140,8 @@ class GStreamerAudioOutputCallback:public IDeckLinkAudioOutputCallback
{
public:
GStreamerAudioOutputCallback (GstDecklinkAudioSinkRingBuffer * ringbuffer)
: IDeckLinkAudioOutputCallback (),
m_refcount (1)
{
m_ringbuffer =
GST_DECKLINK_AUDIO_SINK_RING_BUFFER_CAST (gst_object_ref (ringbuffer));

View file

@ -343,6 +343,8 @@ class GStreamerVideoOutputCallback:public IDeckLinkVideoOutputCallback
{
public:
GStreamerVideoOutputCallback (GstDecklinkVideoSink * sink)
: IDeckLinkVideoOutputCallback (),
m_refcount (1)
{
m_sink = GST_DECKLINK_VIDEO_SINK_CAST (gst_object_ref (sink));
g_mutex_init (&m_mutex);