summaryrefslogtreecommitdiffstats
path: root/src/gui/pepper/plugin_object.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/pepper/plugin_object.cc')
-rw-r--r--src/gui/pepper/plugin_object.cc49
1 files changed, 3 insertions, 46 deletions
diff --git a/src/gui/pepper/plugin_object.cc b/src/gui/pepper/plugin_object.cc
index 1f65a214a7..1922368e3e 100644
--- a/src/gui/pepper/plugin_object.cc
+++ b/src/gui/pepper/plugin_object.cc
@@ -226,27 +226,6 @@ void FlushCallback(NPP , NPDeviceContext* ,
NPExtensions* extensions = NULL;
-// Sine wave similar to one from simple_sources.cc
-// F is the desired frequency (e.g. 200), T is sample type (e.g. int16)
-template <int F, typename T> void SineWaveCallback(
- NPDeviceContextAudio *context) {
-
- const size_t n_samples = context->config.sampleFrameCount;
- const size_t n_channels = context->config.outputChannelMap;
- const double th = 2 * 3.141592653589 * F / context->config.sampleRate;
- // store time value to avoid clicks on buffer boundries
- intptr_t t = (intptr_t)context->config.userData;
-
- T* buf = reinterpret_cast<T*>(context->outBuffer);
- for (size_t sample = 0; sample < n_samples; ++sample) {
- T value = static_cast<T>(sin(th * t++) * std::numeric_limits<T>::max());
- for (size_t channel = 0; channel < n_channels; ++channel) {
- *buf++ = value;
- }
- }
- context->config.userData = reinterpret_cast<void *>(t);
-}
-
const int32 kCommandBufferSize = 1024 * 1024;
} // namespace
@@ -256,16 +235,14 @@ const int32 kCommandBufferSize = 1024 * 1024;
PluginObject::PluginObject(NPP npp)
: npp_(npp),
- test_object_(browser->createobject(npp, GetTestClass())),
- device2d_(NULL),
- deviceaudio_(NULL) {
- memset(&context_audio_, 0, sizeof(context_audio_));
+ //test_object_(browser->createobject(npp, GetTestClass())),
+ device2d_(NULL) {
plugin_object = this;
}
PluginObject::~PluginObject() {
- browser->releaseobject(test_object_);
+ // browser->releaseobject(test_object_);
plugin_object = 0;
}
@@ -282,13 +259,8 @@ void PluginObject::New(NPMIMEType pluginType,
if (!extensions) {
browser->getvalue(npp_, NPNVPepperExtensions,
reinterpret_cast<void*>(&extensions));
- // CHECK(extensions);
}
device2d_ = extensions->acquireDevice(npp_, NPPepper2DDevice);
- // CHECK(device2d_);
-
- // deviceaudio_ = extensions->acquireDevice(npp_, NPPepperAudioDevice);
- // CHECK(deviceaudio_);
}
void PluginObject::SetWindow(const NPWindow& window) {
@@ -310,21 +282,6 @@ void PluginObject::SetWindow(const NPWindow& window) {
qt_nacl_setup();
qtSetupDone = true;
}
-
-#if 0
- // testing any field would do
- if (!context_audio_.config.callback) {
- NPDeviceContextAudioConfig cfg;
- cfg.sampleRate = 44100;
- cfg.sampleType = NPAudioSampleTypeInt16;
- cfg.outputChannelMap = NPAudioChannelStereo;
- cfg.inputChannelMap = NPAudioChannelNone;
- cfg.sampleFrameCount = 2048;
- cfg.flags = 0;
- cfg.callback = &SineWaveCallback<200, int16>;
- deviceaudio_->initializeContext(npp_, &cfg, &context_audio_);
- }
-#endif
}