mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
decklink: reindent
This commit is contained in:
parent
e37ce96b2c
commit
83e2ca791c
4 changed files with 71 additions and 75 deletions
|
@ -55,8 +55,7 @@ DeckLinkCaptureDelegate::~DeckLinkCaptureDelegate ()
|
|||
g_mutex_free (m_mutex);
|
||||
}
|
||||
|
||||
ULONG
|
||||
DeckLinkCaptureDelegate::AddRef (void)
|
||||
ULONG DeckLinkCaptureDelegate::AddRef (void)
|
||||
{
|
||||
g_mutex_lock (m_mutex);
|
||||
m_refCount++;
|
||||
|
@ -65,15 +64,15 @@ DeckLinkCaptureDelegate::AddRef (void)
|
|||
return (ULONG) m_refCount;
|
||||
}
|
||||
|
||||
ULONG
|
||||
DeckLinkCaptureDelegate::Release (void)
|
||||
ULONG DeckLinkCaptureDelegate::Release (void)
|
||||
{
|
||||
g_mutex_lock (m_mutex);
|
||||
m_refCount--;
|
||||
g_mutex_unlock (m_mutex);
|
||||
|
||||
if (m_refCount == 0) {
|
||||
delete this;
|
||||
delete
|
||||
this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,8 @@ gst_decklink_audio_connection_get_type (void)
|
|||
if (!type) {
|
||||
static const GEnumValue connections[] = {
|
||||
{GST_DECKLINK_AUDIO_CONNECTION_AUTO, "auto", "Automatic"},
|
||||
{GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED, "embedded", "SDI/HDMI embedded audio"},
|
||||
{GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED, "embedded",
|
||||
"SDI/HDMI embedded audio"},
|
||||
{GST_DECKLINK_AUDIO_CONNECTION_AES_EBU, "aes", "AES/EBU input"},
|
||||
{GST_DECKLINK_AUDIO_CONNECTION_ANALOG, "analog", "Analog input"},
|
||||
{0, NULL, NULL}
|
||||
|
@ -155,8 +156,7 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e)
|
|||
"interlaced", G_TYPE_BOOLEAN, mode->interlaced,
|
||||
"pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
|
||||
"color-matrix", G_TYPE_STRING, mode->is_hdtv ? "hdtv" : "sdtv",
|
||||
"chroma-site", G_TYPE_STRING, "mpeg2",
|
||||
NULL);
|
||||
"chroma-site", G_TYPE_STRING, "mpeg2", NULL);
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
|
|
|
@ -347,7 +347,8 @@ gst_decklink_sink_com_thread (GstDecklinkSink * src)
|
|||
|
||||
res = CoInitializeEx (0, COINIT_MULTITHREADED);
|
||||
if (res == S_FALSE)
|
||||
GST_WARNING_OBJECT (src, "COM has been already initialized in the same process");
|
||||
GST_WARNING_OBJECT (src,
|
||||
"COM has been already initialized in the same process");
|
||||
else if (res == RPC_E_CHANGED_MODE)
|
||||
GST_WARNING_OBJECT (src, "The concurrency model of COM has changed.");
|
||||
else
|
||||
|
@ -402,7 +403,8 @@ gst_decklink_sink_finalize (GObject * object)
|
|||
if (decklinksink->comInitialized) {
|
||||
g_mutex_lock (decklinksink->com_deinit_lock);
|
||||
g_cond_signal (decklinksink->com_uninitialize);
|
||||
g_cond_wait (decklinksink->com_uninitialized, decklinksink->com_deinit_lock);
|
||||
g_cond_wait (decklinksink->com_uninitialized,
|
||||
decklinksink->com_deinit_lock);
|
||||
g_mutex_unlock (decklinksink->com_deinit_lock);
|
||||
}
|
||||
|
||||
|
@ -455,8 +457,8 @@ gst_decklink_sink_start (GstDecklinkSink * decklinksink)
|
|||
}
|
||||
//decklinksink->video_enabled = TRUE;
|
||||
|
||||
decklinksink->output->
|
||||
SetScheduledFrameCompletionCallback (decklinksink->callback);
|
||||
decklinksink->output->SetScheduledFrameCompletionCallback (decklinksink->
|
||||
callback);
|
||||
|
||||
sample_depth = bmdAudioSampleType16bitInteger;
|
||||
ret = decklinksink->output->EnableAudioOutput (bmdAudioSampleRate48kHz,
|
||||
|
@ -1089,13 +1091,15 @@ HRESULT
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Output::ScheduledPlaybackHasStopped ()
|
||||
HRESULT
|
||||
Output::ScheduledPlaybackHasStopped ()
|
||||
{
|
||||
GST_ERROR ("ScheduledPlaybackHasStopped");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Output::RenderAudioSamples (bool preroll)
|
||||
HRESULT
|
||||
Output::RenderAudioSamples (bool preroll)
|
||||
{
|
||||
uint32_t samplesWritten;
|
||||
GstBuffer *buffer;
|
||||
|
@ -1108,9 +1112,7 @@ HRESULT Output::RenderAudioSamples (bool preroll)
|
|||
// running = true;
|
||||
} else {
|
||||
g_mutex_lock (decklinksink->audio_mutex);
|
||||
decklinksink->output->ScheduleAudioSamples (
|
||||
GST_BUFFER_DATA (decklinksink->audio_buffer),
|
||||
GST_BUFFER_SIZE (decklinksink->audio_buffer) / 4, // 2 bytes per sample, stereo
|
||||
decklinksink->output->ScheduleAudioSamples (GST_BUFFER_DATA (decklinksink->audio_buffer), GST_BUFFER_SIZE (decklinksink->audio_buffer) / 4, // 2 bytes per sample, stereo
|
||||
0, 0, &samplesWritten);
|
||||
|
||||
buffer =
|
||||
|
|
|
@ -415,7 +415,8 @@ gst_decklink_src_com_thread (GstDecklinkSrc * src)
|
|||
|
||||
res = CoInitializeEx (0, COINIT_MULTITHREADED);
|
||||
if (res == S_FALSE)
|
||||
GST_WARNING_OBJECT (src, "COM has been already initialized in the same process");
|
||||
GST_WARNING_OBJECT (src,
|
||||
"COM has been already initialized in the same process");
|
||||
else if (res == RPC_E_CHANGED_MODE)
|
||||
GST_WARNING_OBJECT (src, "The concurrency model of COM has changed.");
|
||||
else
|
||||
|
@ -470,7 +471,6 @@ gst_decklink_src_finalize (GObject * object)
|
|||
if (decklinksrc->video_caps) {
|
||||
gst_caps_unref (decklinksrc->video_caps);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* signal the COM thread that it should uninitialize COM */
|
||||
if (decklinksrc->comInitialized) {
|
||||
|
@ -1215,8 +1215,7 @@ gst_decklink_src_task (void *priv)
|
|||
GST_ELEMENT_WARNING (decklinksrc, RESOURCE, READ,
|
||||
("Dropped %d frame(s), for a total of %d frame(s)",
|
||||
decklinksrc->dropped_frames - decklinksrc->dropped_frames_old,
|
||||
decklinksrc->dropped_frames),
|
||||
(NULL));
|
||||
decklinksrc->dropped_frames), (NULL));
|
||||
decklinksrc->dropped_frames_old = decklinksrc->dropped_frames;
|
||||
}
|
||||
|
||||
|
@ -1273,8 +1272,7 @@ gst_decklink_src_task (void *priv)
|
|||
ret == GST_FLOW_WRONG_STATE)) {
|
||||
GST_ELEMENT_ERROR (decklinksrc, STREAM, FAILED,
|
||||
("Internal data stream error."),
|
||||
("stream stopped, reason %s",
|
||||
gst_flow_get_name (ret)));
|
||||
("stream stopped, reason %s", gst_flow_get_name (ret)));
|
||||
}
|
||||
|
||||
if (gst_pad_is_linked (decklinksrc->audiosrcpad)) {
|
||||
|
@ -1287,9 +1285,7 @@ gst_decklink_src_task (void *priv)
|
|||
gst_util_uint64_scale_int (decklinksrc->num_audio_samples * GST_SECOND,
|
||||
1, 48000);
|
||||
GST_BUFFER_DURATION (audio_buffer) =
|
||||
gst_util_uint64_scale_int ((decklinksrc->num_audio_samples +
|
||||
n_samples) * GST_SECOND, 1,
|
||||
48000) - GST_BUFFER_TIMESTAMP (audio_buffer);
|
||||
gst_util_uint64_scale_int (n_samples * GST_SECOND, 1, 48000);
|
||||
decklinksrc->num_audio_samples += n_samples;
|
||||
|
||||
if (decklinksrc->audio_caps == NULL) {
|
||||
|
@ -1307,8 +1303,7 @@ gst_decklink_src_task (void *priv)
|
|||
ret == GST_FLOW_WRONG_STATE)) {
|
||||
GST_ELEMENT_ERROR (decklinksrc, STREAM, FAILED,
|
||||
("Internal data stream error."),
|
||||
("stream stopped, reason %s",
|
||||
gst_flow_get_name (ret)));
|
||||
("stream stopped, reason %s", gst_flow_get_name (ret)));
|
||||
}
|
||||
}
|
||||
audio_frame->Release ();
|
||||
|
|
Loading…
Reference in a new issue