summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 01:35:50 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 01:35:50 +0000
commit56e8cc35efd400a3c38a8d459dff06bd20e9e899 (patch)
tree8333c74ebf20d17930caff775d28c9be9d1e8849 /ppapi
parentf76f2689acac6ec1fd8e39f9a5cf46749e3c1834 (diff)
downloadchromium_src-56e8cc35efd400a3c38a8d459dff06bd20e9e899.zip
chromium_src-56e8cc35efd400a3c38a8d459dff06bd20e9e899.tar.gz
chromium_src-56e8cc35efd400a3c38a8d459dff06bd20e9e899.tar.bz2
Remove dev/audio, dev/audio_config, and dev/audio_trusted
Also, bump NaCl in deps to pull in new version of NaCl, which has now migrated to non-dev audio. Review URL: http://codereview.chromium.org/6281007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/dev/ppb_audio_config_dev.h97
-rw-r--r--ppapi/c/dev/ppb_audio_dev.h73
-rw-r--r--ppapi/c/dev/ppb_audio_trusted_dev.h50
-rw-r--r--ppapi/cpp/dev/audio_config_dev.cc48
-rw-r--r--ppapi/cpp/dev/audio_config_dev.h60
-rw-r--r--ppapi/cpp/dev/audio_dev.cc41
-rw-r--r--ppapi/cpp/dev/audio_dev.h38
-rw-r--r--ppapi/ppapi.gyp7
-rw-r--r--ppapi/tests/all_c_includes.h6
-rw-r--r--ppapi/tests/all_cpp_includes.h4
10 files changed, 5 insertions, 419 deletions
diff --git a/ppapi/c/dev/ppb_audio_config_dev.h b/ppapi/c/dev/ppb_audio_config_dev.h
deleted file mode 100644
index 0a1be2a..0000000
--- a/ppapi/c/dev/ppb_audio_config_dev.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_
-#define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_
-
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_macros.h"
-#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/pp_stdint.h"
-
-#define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.4"
-
-enum {
- PP_AUDIOMINSAMPLEFRAMECOUNT = 64,
- PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768
-};
-
-typedef enum {
- PP_AUDIOSAMPLERATE_NONE = 0,
- PP_AUDIOSAMPLERATE_44100 = 44100,
- PP_AUDIOSAMPLERATE_48000 = 48000
-} PP_AudioSampleRate_Dev;
-PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_AudioSampleRate_Dev, 4);
-
-/**
- * Audio configuration. This base configuration interface supports only stereo
- * 16bit output. This class is not mutable, therefore it is okay to access
- * instances from different threads.
- */
-struct PPB_AudioConfig_Dev {
- /**
- * Create a 16 bit stereo config with the given sample rate. We guarantee
- * that PP_AUDIOSAMPLERATE_44100 and PP_AUDIOSAMPLERATE_48000 sample rates
- * are supported. The |sample_frame_count| should be the result of calling
- * RecommendSampleFrameCount. If the sample frame count or bit rate aren't
- * supported, this function will fail and return a null resource.
- *
- * A single sample frame on a stereo device means one value for the left
- * channel and one value for the right channel.
- *
- * Buffer layout for a stereo int16 configuration:
- * int16_t *buffer16;
- * buffer16[0] is the first left channel sample
- * buffer16[1] is the first right channel sample
- * buffer16[2] is the second left channel sample
- * buffer16[3] is the second right channel sample
- * ...
- * buffer16[2 * (sample_frame_count - 1)] is the last left channel sample
- * buffer16[2 * (sample_frame_count - 1) + 1] is the last right channel sample
- * Data will always be in the native endian format of the platform.
- */
- PP_Resource (*CreateStereo16Bit)(PP_Instance instance,
- PP_AudioSampleRate_Dev sample_rate,
- uint32_t sample_frame_count);
-
- /*
- * Returns a supported sample frame count closest to the given requested
- * count. The sample frame count determines the overall latency of audio.
- * Since one "frame" is always buffered in advance, smaller frame counts
- * will yield lower latency, but higher CPU utilization.
- *
- * Supported sample frame counts will vary by hardware and system (consider
- * that the local system might be anywhere from a cell phone or a high-end
- * audio workstation). Sample counts less than PP_AUDIOMINSAMPLEFRAMECOUNT
- * and greater than PP_AUDIOMAXSAMPLEFRAMECOUNT are never supported on any
- * system, but values in between aren't necessarily valid. This function
- * will return a supported count closest to the requested value.
- *
- * If you pass 0 as the requested sample count, the recommended sample for
- * the local system is returned.
- */
- uint32_t (*RecommendSampleFrameCount)(uint32_t requested_sample_frame_count);
-
- /**
- * Returns true if the given resource is an AudioConfig object.
- */
- PP_Bool (*IsAudioConfig)(PP_Resource resource);
-
- /**
- * Returns the sample rate for the given AudioConfig resource. If the
- * resource is invalid, this will return PP_AUDIOSAMPLERATE_NONE.
- */
- PP_AudioSampleRate_Dev (*GetSampleRate)(PP_Resource config);
-
- /**
- * Returns the sample frame count for the given AudioConfig resource. If the
- * resource is invalid, this will return 0. See RecommendSampleFrameCount for
- * more on sample frame counts.
- */
- uint32_t (*GetSampleFrameCount)(PP_Resource config);
-};
-
-#endif /* PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ */
-
diff --git a/ppapi/c/dev/ppb_audio_dev.h b/ppapi/c/dev/ppb_audio_dev.h
deleted file mode 100644
index 8d4e4c5..0000000
--- a/ppapi/c/dev/ppb_audio_dev.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef PPAPI_C_DEV_PPB_AUDIO_DEV_H_
-#define PPAPI_C_DEV_PPB_AUDIO_DEV_H_
-
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_module.h"
-#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/pp_stdint.h"
-
-#define PPB_AUDIO_DEV_INTERFACE "PPB_Audio(Dev);0.4"
-
-// Callback function type for SetCallback.
-typedef void (*PPB_Audio_Callback)(void* sample_buffer,
- size_t buffer_size_in_bytes,
- void* user_data);
-
-// Callback-based audio interface. User of audio must set the callback that will
-// be called each time that the buffer needs to be filled.
-//
-// A C++ example:
-//
-// void audio_callback(void* sample_buffer,
-// size_t buffer_size_in_bytes,
-// void* user_data) {
-// ... fill in the buffer with samples ...
-// }
-//
-// uint32_t obtained;
-// AudioConfig config(PP_AUDIOSAMPLERATE_44100, 4096, &obtained);
-// Audio audio(config, audio_callback, NULL);
-// audio.StartPlayback();
-//
-struct PPB_Audio_Dev {
- // Creates a paused audio interface. No sound will be heard until
- // StartPlayback() is called. The callback is called with the buffer address
- // and given user data whenever the buffer needs to be filled. From within the
- // callback, you should not call PPB_Audio functions. The callback will be
- // called on a different thread than the one which created the interface. For
- // performance-critical applications (i.e. low-latency audio), the callback
- // should avoid blocking or calling functions that can obtain locks, such as
- // malloc. The layout and the size of the buffer passed to the audio callback
- // will be determined by the device configuration and is specified in the
- // AudioConfig documentation. If the configuration cannot be honored, or the
- // callback is null, the function returns 0.
- PP_Resource (*Create)(PP_Instance instance, PP_Resource config,
- PPB_Audio_Callback audio_callback, void* user_data);
-
- /**
- * Returns PP_TRUE if the given resource is an Audio resource, PP_FALSE
- * otherwise.
- */
- PP_Bool (*IsAudio)(PP_Resource resource);
-
- // Get the current configuration.
- PP_Resource (*GetCurrentConfig)(PP_Resource audio);
-
- // Start the playback. Begin periodically calling the callback. If called
- // while playback is already in progress, will return PP_TRUE and be a no-op.
- // On error, return PP_FALSE.
- PP_Bool (*StartPlayback)(PP_Resource audio);
-
- // Stop the playback. If playback is already stopped, this is a no-op and
- // returns PP_TRUE. On error, returns PP_FALSE. If a callback is in progress,
- // StopPlayback will block until callback completes.
- PP_Bool (*StopPlayback)(PP_Resource audio);
-};
-
-#endif /* PPAPI_C_DEV_PPB_DEVICE_CONTEXT_AUDIO_DEV_H_ */
-
diff --git a/ppapi/c/dev/ppb_audio_trusted_dev.h b/ppapi/c/dev/ppb_audio_trusted_dev.h
deleted file mode 100644
index 0c1ff3b6..0000000
--- a/ppapi/c/dev/ppb_audio_trusted_dev.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_
-#define PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_
-
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_resource.h"
-
-#define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.3"
-
-/**
- * This interface is to be used by proxy implementations. All
- * functions should be called from the main thread only. The
- * resource returned is an Audio resource; most of the PPB_Audio_Dev
- * interface is also usable on this resource.
- */
-struct PPB_AudioTrusted_Dev {
- /** Returns an audio resource. */
- PP_Resource (*CreateTrusted)(PP_Instance instance);
-
- /**
- * Opens a paused audio interface, used by trusted side of proxy.
- * Returns PP_ERROR_WOULD_BLOCK on success, and invokes
- * the |create_callback| asynchronously to complete.
- * As this function should always be invoked from the main thread,
- * do not use the blocking variant of PP_CompletionCallback.
- */
- int32_t (*Open)(PP_Resource audio, PP_Resource config,
- struct PP_CompletionCallback create_callback);
-
- /**
- * Get the sync socket. Use once Open has completed.
- * Returns PP_OK on success.
- */
- int32_t (*GetSyncSocket)(PP_Resource audio, int* sync_socket);
-
- /**
- * Get the shared memory interface. Use once Open has completed.
- * Returns PP_OK on success.
- */
- int32_t (*GetSharedMemory)(PP_Resource audio,
- int* shm_handle,
- uint32_t* shm_size);
-};
-
-#endif /* PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ */
-
diff --git a/ppapi/cpp/dev/audio_config_dev.cc b/ppapi/cpp/dev/audio_config_dev.cc
deleted file mode 100644
index 754a78f..0000000
--- a/ppapi/cpp/dev/audio_config_dev.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ppapi/cpp/dev/audio_config_dev.h"
-
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/module_impl.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_AudioConfig_Dev>() {
- return PPB_AUDIO_CONFIG_DEV_INTERFACE;
-}
-
-} // namespace
-
-AudioConfig_Dev::AudioConfig_Dev()
- : sample_rate_(PP_AUDIOSAMPLERATE_NONE),
- sample_frame_count_(0) {
-}
-
-AudioConfig_Dev::AudioConfig_Dev(Instance* instance,
- PP_AudioSampleRate_Dev sample_rate,
- uint32_t sample_frame_count)
- : sample_rate_(sample_rate),
- sample_frame_count_(sample_frame_count) {
- if (has_interface<PPB_AudioConfig_Dev>()) {
- PassRefFromConstructor(
- get_interface<PPB_AudioConfig_Dev>()->CreateStereo16Bit(
- instance->pp_instance(), sample_rate, sample_frame_count));
- }
-}
-
-// static
-uint32_t AudioConfig_Dev::RecommendSampleFrameCount(
- uint32_t requested_sample_frame_count) {
- if (!has_interface<PPB_AudioConfig_Dev>())
- return 0;
- return get_interface<PPB_AudioConfig_Dev>()->
- RecommendSampleFrameCount(requested_sample_frame_count);
-}
-
-} // namespace pp
-
diff --git a/ppapi/cpp/dev/audio_config_dev.h b/ppapi/cpp/dev/audio_config_dev.h
deleted file mode 100644
index 64079f0..0000000
--- a/ppapi/cpp/dev/audio_config_dev.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
-#define PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
-
-#include "ppapi/c/dev/ppb_audio_config_dev.h"
-#include "ppapi/c/pp_stdint.h"
-#include "ppapi/cpp/resource.h"
-
-namespace pp {
-
-class Instance;
-
-// Typical usage:
-//
-// // Create an audio config with a supported frame count.
-// uint32_t sample_frame_count =
-// AudioConfig_Dev::RecommendSampleFrameCount(4096);
-// AudioConfig_Dev config(PP_AUDIOSAMPLERATE_44100, sample_frame_count);
-// if (config.is_null())
-// return false; // Couldn't configure audio.
-//
-// // Then use the config to create your audio resource.
-// Audio_dev audio(..., config, ...);
-// if (audio.is_null())
-// return false; // Couldn't create audio.
-class AudioConfig_Dev : public Resource {
- public:
- AudioConfig_Dev();
-
- // Creates an audio config based on the given sample rate and frame count.
- // If the rate and frame count aren't supported, the resulting resource
- // will be is_null(). Pass the result of RecommendSampleFrameCount as the
- // sample frame count.
- //
- // See PPB_AudioConfigDev.CreateStereo16Bit for more.
- AudioConfig_Dev(Instance* instance,
- PP_AudioSampleRate_Dev sample_rate,
- uint32_t sample_frame_count);
-
- // Returns a supported frame count for use in the constructor.
- //
- // See PPB_AudioConfigDev.RecommendSampleFrameCount.
- static uint32_t RecommendSampleFrameCount(
- uint32_t requested_sample_frame_count);
-
- PP_AudioSampleRate_Dev sample_rate() const { return sample_rate_; }
- uint32_t sample_frame_count() { return sample_frame_count_; }
-
- private:
- PP_AudioSampleRate_Dev sample_rate_;
- uint32_t sample_frame_count_;
-};
-
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
-
diff --git a/ppapi/cpp/dev/audio_dev.cc b/ppapi/cpp/dev/audio_dev.cc
deleted file mode 100644
index b80d196..0000000
--- a/ppapi/cpp/dev/audio_dev.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ppapi/cpp/dev/audio_dev.h"
-
-#include "ppapi/cpp/module_impl.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_Audio_Dev>() {
- return PPB_AUDIO_DEV_INTERFACE;
-}
-
-} // namespace
-
-Audio_Dev::Audio_Dev(Instance* instance,
- const AudioConfig_Dev& config,
- PPB_Audio_Callback callback,
- void* user_data)
- : config_(config) {
- if (has_interface<PPB_Audio_Dev>()) {
- PassRefFromConstructor(get_interface<PPB_Audio_Dev>()->Create(
- instance->pp_instance(), config.pp_resource(), callback, user_data));
- }
-}
-
-bool Audio_Dev::StartPlayback() {
- return has_interface<PPB_Audio_Dev>() &&
- get_interface<PPB_Audio_Dev>()->StartPlayback(pp_resource());
-}
-
-bool Audio_Dev::StopPlayback() {
- return has_interface<PPB_Audio_Dev>() &&
- get_interface<PPB_Audio_Dev>()->StopPlayback(pp_resource());
-}
-
-} // namespace pp
-
diff --git a/ppapi/cpp/dev/audio_dev.h b/ppapi/cpp/dev/audio_dev.h
deleted file mode 100644
index a355cb6..0000000
--- a/ppapi/cpp/dev/audio_dev.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PPAPI_CPP_DEV_AUDIO_DEV_H_
-#define PPAPI_CPP_DEV_AUDIO_DEV_H_
-
-#include "ppapi/c/pp_stdint.h"
-#include "ppapi/c/dev/ppb_audio_dev.h"
-#include "ppapi/cpp/dev/audio_config_dev.h"
-#include "ppapi/cpp/dev/buffer_dev.h"
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/resource.h"
-
-namespace pp {
-
-class Audio_Dev : public Resource {
- public:
- Audio_Dev() {}
- Audio_Dev(Instance* instance,
- const AudioConfig_Dev& config,
- PPB_Audio_Callback callback,
- void* user_data);
-
- AudioConfig_Dev& config() { return config_; }
- const AudioConfig_Dev& config() const { return config_; }
-
- bool StartPlayback();
- bool StopPlayback();
-
- private:
- AudioConfig_Dev config_;
-};
-
-} // namespace pp
-
-#endif // PPAPI_CPP_DEV_AUDIO_DEV_H_
-
diff --git a/ppapi/ppapi.gyp b/ppapi/ppapi.gyp
index d2e9d70..1a04afa 100644
--- a/ppapi/ppapi.gyp
+++ b/ppapi/ppapi.gyp
@@ -70,9 +70,6 @@
'c/dev/pp_file_info_dev.h',
'c/dev/pp_graphics_3d_dev.h',
'c/dev/pp_video_dev.h',
- 'c/dev/ppb_audio_config_dev.h',
- 'c/dev/ppb_audio_dev.h',
- 'c/dev/ppb_audio_trusted_dev.h',
'c/dev/ppb_buffer_dev.h',
'c/dev/ppb_char_set_dev.h',
'c/dev/ppb_context_3d_dev.h',
@@ -170,10 +167,6 @@
'cpp/var.h',
# Dev interfaces.
- 'cpp/dev/audio_config_dev.cc',
- 'cpp/dev/audio_config_dev.h',
- 'cpp/dev/audio_dev.cc',
- 'cpp/dev/audio_dev.h',
'cpp/dev/buffer_dev.cc',
'cpp/dev/buffer_dev.h',
'cpp/dev/context_3d_dev.cc',
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index fde2c02..208c362 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -13,9 +13,6 @@
#include "ppapi/c/dev/pp_file_info_dev.h"
#include "ppapi/c/dev/pp_graphics_3d_dev.h"
#include "ppapi/c/dev/pp_video_dev.h"
-#include "ppapi/c/dev/ppb_audio_config_dev.h"
-#include "ppapi/c/dev/ppb_audio_dev.h"
-#include "ppapi/c/dev/ppb_audio_trusted_dev.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
#include "ppapi/c/dev/ppb_char_set_dev.h"
#include "ppapi/c/dev/ppb_context_3d_dev.h"
@@ -64,6 +61,8 @@
#include "ppapi/c/pp_time.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppb.h"
+#include "ppapi/c/ppb_audio.h"
+#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/c/ppb_class.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/c/ppb_graphics_2d.h"
@@ -75,6 +74,7 @@
#include "ppapi/c/ppb_var.h"
#include "ppapi/c/ppp.h"
#include "ppapi/c/ppp_instance.h"
+#include "ppapi/c/trusted/ppb_audio_trusted.h"
#include "ppapi/c/trusted/ppb_image_data_trusted.h"
#include "ppapi/c/trusted/ppb_url_loader_trusted.h"
diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h
index c835195..5860f65 100644
--- a/ppapi/tests/all_cpp_includes.h
+++ b/ppapi/tests/all_cpp_includes.h
@@ -8,11 +8,11 @@
#ifndef PPAPI_TESTS_ALL_CPP_INCLUDES_H_
#define PPAPI_TESTS_ALL_CPP_INCLUDES_H_
+#include "ppapi/cpp/audio.h"
+#include "ppapi/cpp/audio_config.h"
#include "ppapi/cpp/common.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/core.h"
-#include "ppapi/cpp/dev/audio_config_dev.h"
-#include "ppapi/cpp/dev/audio_dev.h"
#include "ppapi/cpp/dev/buffer_dev.h"
#include "ppapi/cpp/dev/context_3d_dev.h"
#include "ppapi/cpp/dev/directory_entry_dev.h"