Skip to content

Commit c9519b6

Browse files
author
Alexander Matveev
committed
8232589: Remove CoreAudio Utility Classes
Reviewed-by: kcr, jvos
1 parent df8b3c5 commit c9519b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+599
-14323
lines changed

modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/spectrum/gstspectrum.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ static GstFlowReturn gst_spectrum_transform_ip (GstBaseTransform * trans,
158158
static gboolean gst_spectrum_setup (GstAudioFilter * base,
159159
const GstAudioInfo * info);
160160

161+
#if defined (GSTREAMER_LITE) && defined (OSX)
162+
gboolean gst_spectrum_setup_api (GstAudioFilter * base, const GstAudioInfo * info,
163+
guint bps_user, guint bpf_user) {
164+
GstSpectrum *spectrum = GST_SPECTRUM (base);
165+
spectrum->bps_user = bps_user;
166+
spectrum->bpf_user = bpf_user;
167+
return gst_spectrum_setup(base, info);
168+
}
169+
170+
GstFlowReturn
171+
gst_spectrum_transform_ip_api (GstBaseTransform * trans, GstBuffer * buffer) {
172+
return gst_spectrum_transform_ip(trans, buffer);
173+
}
174+
#endif // GSTREAMER_LITE and OSX
175+
161176
static void
162177
gst_spectrum_class_init (GstSpectrumClass * klass)
163178
{
@@ -251,6 +266,12 @@ gst_spectrum_init (GstSpectrum * spectrum)
251266
spectrum->bands = DEFAULT_BANDS;
252267
spectrum->threshold = DEFAULT_THRESHOLD;
253268

269+
#if defined (GSTREAMER_LITE) && defined (OSX)
270+
spectrum->bps_user = 0;
271+
spectrum->bpf_user = 0;
272+
spectrum->user_data = NULL;
273+
#endif // GSTREAMER_LITE and OSX
274+
254275
g_mutex_init (&spectrum->lock);
255276
}
256277

@@ -714,10 +735,24 @@ gst_spectrum_message_new (GstSpectrum * spectrum, GstClockTime timestamp,
714735

715736
GST_DEBUG_OBJECT (spectrum, "preparing message, bands =%d ", spectrum->bands);
716737

738+
#if defined (GSTREAMER_LITE) && defined (OSX)
739+
// When running spectrum directly we cannot figure out time stamps, since we do not
740+
// have full pipeline. Caller will be responsible to handle time stamps.
741+
if (spectrum->user_data != NULL) {
742+
running_time = 0;
743+
stream_time = 0;
744+
} else {
745+
running_time = gst_segment_to_running_time (&trans->segment, GST_FORMAT_TIME,
746+
timestamp);
747+
stream_time = gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME,
748+
timestamp);
749+
}
750+
#else // GSTREAMER_LITE and OSX
717751
running_time = gst_segment_to_running_time (&trans->segment, GST_FORMAT_TIME,
718752
timestamp);
719753
stream_time = gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME,
720754
timestamp);
755+
#endif // GSTREAMER_LITE and OSX
721756
/* endtime is for backwards compatibility */
722757
endtime = stream_time + duration;
723758

@@ -877,6 +912,12 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
877912
channels = GST_AUDIO_FILTER_CHANNELS (spectrum);
878913
bps = GST_AUDIO_FILTER_BPS (spectrum);
879914
bpf = GST_AUDIO_FILTER_BPF (spectrum);
915+
#ifdef OSX
916+
if (spectrum->bps_user != 0 && spectrum->bpf_user != 0) {
917+
bps = spectrum->bps_user;
918+
bpf = spectrum->bpf_user;
919+
}
920+
#endif // OSX
880921
output_channels = spectrum->multi_channel ? channels : 1;
881922
max_value = (1UL << ((bps << 3) - 1)) - 1;
882923
bands = spectrum->bands;

modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/spectrum/gstspectrum.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ struct _GstSpectrum
8181
GMutex lock;
8282

8383
GstSpectrumInputData input_data;
84+
85+
#if defined (GSTREAMER_LITE) && defined (OSX)
86+
guint bps_user; // User provided values to avoid more complex spectrum initialization
87+
guint bpf_user;
88+
void *user_data;
89+
#endif // GSTREAMER_LITE and OSX
8490
};
8591

8692
struct _GstSpectrumClass
@@ -90,6 +96,14 @@ struct _GstSpectrumClass
9096

9197
GType gst_spectrum_get_type (void);
9298

99+
#if defined (GSTREAMER_LITE) && defined (OSX)
100+
GST_EXPORT gboolean gst_spectrum_setup_api (GstAudioFilter * base,
101+
const GstAudioInfo * info, guint bps_user, guint bpf_user);
102+
103+
GST_EXPORT GstFlowReturn
104+
gst_spectrum_transform_ip_api (GstBaseTransform * trans, GstBuffer * buffer);
105+
#endif // GSTREAMER_LITE and OSX
106+
93107
G_END_DECLS
94108

95109
#endif /* __GST_SPECTRUM_H__ */

0 commit comments

Comments
 (0)