Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: media/cast/cast_receiver.h

Issue 214273003: [Cast] Remove AudioDecoder's dependency on WebRTC, and refactor/clean-up AudioReceiver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/cast_receiver.h
diff --git a/media/cast/cast_receiver.h b/media/cast/cast_receiver.h
index 581a27171db64bec2b144a77b74de8e0c8f2982c..65b0d1dba0463f2f96bba69e08ac6167e874513b 100644
--- a/media/cast/cast_receiver.h
+++ b/media/cast/cast_receiver.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
+#include "media/base/audio_bus.h"
#include "media/cast/cast_config.h"
#include "media/cast/cast_environment.h"
@@ -25,12 +26,21 @@ namespace transport {
class PacketSender;
}
-// Callback in which the raw audio frame and play-out time will be returned
-// once decoding is complete.
-typedef base::Callback<void(scoped_ptr<PcmAudioFrame>, const base::TimeTicks&)>
- AudioFrameDecodedCallback;
-
-// Callback in which the encoded audio frame and play-out time will be returned.
+// Callback in which the raw audio frame, play-out time, and a continuity flag
+// will be returned. |is_continuous| will be false to indicate the loss of
+// audio data due to a loss of packets (or decoding errors). This allows the
+// client to take steps to smooth discontinuities for playback. Note: A NULL
+// AudioBus can be returned when data is not available (e.g., bad packet or when
+// flushing callbacks during shutdown).
+typedef base::Callback<void(scoped_ptr<AudioBus> audio_bus,
+ const base::TimeTicks& playout_time,
+ bool is_continuous)> AudioFrameDecodedCallback;
+
+// Callback in which the encoded audio frame and play-out time will be
+// returned. The client should examine the EncodedAudioFrame::frame_id field to
+// determine whether any frames have been dropped (i.e., frame_id should be
+// incrementing by one each time). Note: A NULL EncodedAudioFrame can be
+// returned on error/shutdown.
typedef base::Callback<void(scoped_ptr<transport::EncodedAudioFrame>,
const base::TimeTicks&)> AudioFrameEncodedCallback;
@@ -46,9 +56,7 @@ typedef base::Callback<void(scoped_ptr<transport::EncodedVideoFrame>,
// This Class is thread safe.
class FrameReceiver : public base::RefCountedThreadSafe<FrameReceiver> {
public:
- virtual void GetRawAudioFrame(int number_of_10ms_blocks,
- int desired_frequency,
- const AudioFrameDecodedCallback& callback) = 0;
+ virtual void GetRawAudioFrame(const AudioFrameDecodedCallback& callback) = 0;
virtual void GetCodedAudioFrame(
const AudioFrameEncodedCallback& callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698